summaryrefslogtreecommitdiffstats
path: root/test/SemaOpenCL
Commit message (Collapse)AuthorAgeFilesLines
* Merging r228118:upstream/release_36Tom Stellard2015-06-221-3/+129
| | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r228118 | sameer.sahasrabuddhe | 2015-02-04 01:38:18 -0500 (Wed, 04 Feb 2015) | 8 lines OpenCL: handle ternary operator when the condition is a vector When the condition is a vector, OpenCL specifies additional requirements on the operand types, and also the operations required to determine the result type of the operator. This is a combination of OpenCL v1.1 s6.3.i and s6.11.6, and the semantics remain unchanged in later versions of OpenCL. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_36@240324 91177308-0d34-0410-b5e6-96231b3b80d8
* Workaround attribute ordering issue with kernel only attributesMatt Arsenault2014-12-051-0/+6
| | | | | | | | | | | Placing the attribute after the kernel keyword would incorrectly reject the attribute, so use the smae workaround that other kernel only attributes use. Also add a FIXME because there are two different phrasings now for the same error, althoug amdgpu_num_[sv]gpr uses a consistent one. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223490 91177308-0d34-0410-b5e6-96231b3b80d8
* Add attributes for AMDGPU register limits.Matt Arsenault2014-12-041-0/+34
| | | | | | | This is a performance hint that can be applied to kernels to attempt to limit the number of used registers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223384 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Implemented restrictions for pointer conversions specified in ↵Anastasia Stulova2014-11-261-0/+227
| | | | | | | | | | | | | | OpenCL v2.0. OpenCL v2.0 s6.5.5 restricts conversion of pointers to different address spaces: - the named address spaces (__global, __local, and __private) => __generic - implicitly converted; - __generic => named - with an explicit cast; - named <=> named - disallowed; - __constant <=> any other - disallowed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222834 91177308-0d34-0410-b5e6-96231b3b80d8
* OpenCL: Emit global variables in the constant addr space as constant globalsTom Stellard2014-10-162-2/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219929 91177308-0d34-0410-b5e6-96231b3b80d8
* OpenCL: Add -ffake-address-space-map to a testTom Stellard2014-10-161-2/+2
| | | | | | The ensures there is an explicit address space id in the output. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219928 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Reject reqd_work_group_size(X, Y, Z) where X, Y or Z == 0.Joey Gouly2014-05-191-0/+4
| | | | | | | Patch by Pedro Ferreira! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209127 91177308-0d34-0410-b5e6-96231b3b80d8
* Parameter/argument terminology fixesAlp Toker2014-05-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208499 91177308-0d34-0410-b5e6-96231b3b80d8
* Print detailed vector type information on diagnostics.Benjamin Kramer2014-04-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | We never aka vector types because our attributed syntax for it is less comprehensible than the typedefs. This leaves the user in the dark when the typedef isn't named that well. Example: v2s v; v4f w; w = v; The naming in this cases isn't even that bad, but the error we give is useless without looking up the actual typedefs. t.c:6:5: error: assigning to 'v4f' from incompatible type 'v2s' Now: t.c:6:5: error: assigning to 'v4f' (vector of 4 'float' values) from incompatible type 'v2s' (vector of 2 'int' values) We do this for all diagnostics that print a vector type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207267 91177308-0d34-0410-b5e6-96231b3b80d8
* Disallow driver use in more Sema testsAlp Toker2014-04-191-0/+4
| | | | | | | There are now only a handful of Sema tests remaining that use %clang in SemaCXX, SemaObjC and SemaTemplate. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206688 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow address space qualifiers on OpenCL array parametersFraser Cormack2014-04-152-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206275 91177308-0d34-0410-b5e6-96231b3b80d8
* Enforce the restriction that a parameter to a kernel functionDavid Tweed2014-03-271-0/+2
| | | | | | | | | | cannot be a pointer to the private address space (as clarified in the OpenCL 1.2 specification). Patch by Fraser Cormack! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204941 91177308-0d34-0410-b5e6-96231b3b80d8
* OpenCL: fix for the restriction on pointers to functions.Pekka Jaaskelainen2014-02-201-0/+16
| | | | | | | Patch from Anastasia Stulova! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201788 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow clang to compile the "extern" storage class in OpenCL 1.2. Pekka Jaaskelainen2014-01-231-0/+9
| | | | | | | | | | The tests (forgot to svn add, sorry!). Patch from Fraser Cormack! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199907 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplifying the OpenCL image attribute. It does not need a semantic integer ↵Aaron Ballman2014-01-141-1/+2
| | | | | | parameter because the required information is encoded in the spelling. Added an appropriate subject to the attribute, and simplified the semantic checking (which will likely be expanded upon in a future patch). Also, removed the GNU spelling since it was unsupported in the first place. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199229 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Disallow casts between address spaces.Joey Gouly2014-01-141-0/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199208 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Produce an error if an address space is used on the returnJoey Gouly2014-01-061-0/+12
| | | | | | | type of a function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198597 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Add test case for previous commit.Joey Gouly2014-01-031-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198422 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Variables in the constant address space must be initialized.Joey Gouly2014-01-032-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198417 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] The kernel attribute can only be used on functions.Joey Gouly2014-01-021-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198300 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Produce an error, instead of a warning, for sizeof(void) in OpenCL.Joey Gouly2013-12-311-0/+5
| | | | | | | Patch by joey.gouly@arm.com git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198264 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Produce an error when the work group and vec type hint attributesJoey Gouly2013-12-131-0/+11
| | | | | | | | | are used on non-kernel functions. Reviewed by Aaron over IRC! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197243 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Make sure we put string literals in the constant address space.Joey Gouly2013-11-141-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194717 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not allow functions or kernels called 'main' in OpenCL.Joey Gouly2013-11-051-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194068 91177308-0d34-0410-b5e6-96231b3b80d8
* Removing the endian attribute and updating associated test cases. This ↵Aaron Ballman2013-09-091-7/+1
| | | | | | functionality was never completely implemented, and this is an improvement over silently eating the attribute. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190303 91177308-0d34-0410-b5e6-96231b3b80d8
* OpenCL allows the (pre/post)-(increment/decrement) operator on integer ↵David Tweed2013-09-061-0/+19
| | | | | | | | | | | | vector types, so allow that case and add appropriate tests. Patch by Ruiling Song! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190129 91177308-0d34-0410-b5e6-96231b3b80d8
* Consolidating the notion of a GNU attribute parameter with the attribute ↵Aaron Ballman2013-08-311-1/+1
| | | | | | argument list. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189711 91177308-0d34-0410-b5e6-96231b3b80d8
* Added the attribute name to the err_attribute_wrong_number_arguments ↵Aaron Ballman2013-07-231-2/+2
| | | | | | | | diagnostic for clarity; updated almost all of the affected test cases. Thanks to Fariborz Jahanian for the suggestion! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186980 91177308-0d34-0410-b5e6-96231b3b80d8
* Error on more illegal kernel argument types for OpenCLMatt Arsenault2013-07-233-2/+135
| | | | | | | | bool, half, pointers and structs / unions containing any of these are not allowed. Does not yet reject size_t and related integer types that are also disallowed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186908 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an error to check that all program scope variables are in the constant ↵Tanya Lattner2013-04-052-1/+3
| | | | | | address space in OpenCL. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178906 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 178811 until I fix the unit tests.Tanya Lattner2013-04-042-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178813 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an error to check that all program scope variables are in the constant ↵Tanya Lattner2013-04-042-1/+3
| | | | | | address space in OpenCL. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178811 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for the 'endian' attribute for OpenCL.Joey Gouly2013-03-141-0/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177035 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a test case for the 'vec_type_hint' attribute that was introduced inJoey Gouly2013-03-111-0/+16
| | | | | | | r176686. I missed this file in the previous commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176803 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a 64-bit triple to these tests, to fix 32-bit bots.Joey Gouly2013-02-212-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175736 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to Sema and CodeGen for floating point vector types in OpenCL.Joey Gouly2013-02-212-0/+114
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175734 91177308-0d34-0410-b5e6-96231b3b80d8
* Diagnose loads of 'half' l-values in OpenCL.John McCall2013-02-121-15/+13
| | | | | | Patch by Joey Gouly! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174928 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable overloading of OpenCL events - this is needed for the overloaded ↵Guy Benyei2013-02-071-0/+11
| | | | | | OpenCL builtin functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174630 91177308-0d34-0410-b5e6-96231b3b80d8
* Add OpenCL samplers as Clang builtin types and check sampler related ↵Guy Benyei2013-02-072-0/+25
| | | | | | restrictions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174601 91177308-0d34-0410-b5e6-96231b3b80d8
* Add OpenCL error that a kernel function must have void return type. Includes ↵Tanya Lattner2013-01-301-0/+4
| | | | | | a test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173963 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a crash in OpenCL code by using the proper (RHS) bit-width.Joey Gouly2013-01-291-4/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173802 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a diagnostic for an OpenCL kernel with a pointer pointer argument.Joey Gouly2013-01-291-0/+3
| | | | | | | Also refactor the surrounding code a little. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173791 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a non-conformant OpenCL test case.Joey Gouly2013-01-241-1/+1
| | | | | | | | Program scope variables must be declared in the constant address space and are required to be initialized. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173354 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an OpenCL test case that was OpenCL conformant.Joey Gouly2013-01-241-0/+14
| | | | | | | | | It had program scope variables that were not in the constant address space, make them to be function scope variables instead. Also move the test to the SemaOpenCL directory. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173352 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new LangOpt NativeHalfType. This option allows for native half/fp16Joey Gouly2013-01-231-0/+42
| | | | | | | | | | operations (as opposed to storage only half/fp16). Also add some semantic checks for OpenCL half types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173254 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement OpenCL event_t as Clang builtin type, including event_t related ↵Guy Benyei2013-01-201-0/+17
| | | | | | OpenCL restrictions (OpenCL 1.2 spec 6.9) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172973 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some semantic checks for OpenCL. Variadic macros, VLAs and bitfields are ↵Joey Gouly2013-01-171-0/+9
| | | | | | not supported. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172732 91177308-0d34-0410-b5e6-96231b3b80d8
* Prior to adding the new "expected-no-diagnostics" directive to ↵Andy Gibbs2012-10-194-0/+4
| | | | | | VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166280 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable the warning for missing prototypes for OpenCL kernels. Includes ↵Tanya Lattner2012-07-261-0/+6
| | | | | | testcase. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160766 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend the support for cl-std to include 1.2.Tanya Lattner2012-06-191-0/+12
| | | | | | | | Add error checking for the static qualifier which is now allowed in certain situations for OpenCL 1.2. Use the CL version to turn on this feature. Added test case for 1.2 static storage class feature. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158759 91177308-0d34-0410-b5e6-96231b3b80d8