summaryrefslogtreecommitdiff
path: root/test/SemaOpenCL
Commit message (Collapse)AuthorAge
* [OpenCL] Reject reqd_work_group_size(X, Y, Z) where X, Y or Z == 0.Joey Gouly2014-05-19
| | | | | | | 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-11
| | | | 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-25
| | | | | | | | | | | | | | | | | | | | | | 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-19
| | | | | | | 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-15
| | | | 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-27
| | | | | | | | | | 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-20
| | | | | | | 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-23
| | | | | | | | | | 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-14
| | | | | | 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-14
| | | | 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-06
| | | | | | | 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-03
| | | | 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-03
| | | | 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-02
| | | | 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-31
| | | | | | | 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-13
| | | | | | | | | 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-14
| | | | 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-05
| | | | 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-09
| | | | | | 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-06
| | | | | | | | | | | | 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-31
| | | | | | 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-23
| | | | | | | | 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-23
| | | | | | | | 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-05
| | | | | | 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-04
| | | | 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-04
| | | | | | 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-14
| | | | 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-11
| | | | | | | 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-21
| | | | 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-21
| | | | 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-12
| | | | | | 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-07
| | | | | | 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-07
| | | | | | 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-30
| | | | | | 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-29
| | | | 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-29
| | | | | | | 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-24
| | | | | | | | 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-24
| | | | | | | | | 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-23
| | | | | | | | | | 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-20
| | | | | | 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-17
| | | | | | 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-19
| | | | | | 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-26
| | | | | | 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-19
| | | | | | | | 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
* Support constant evaluation for OpenCL nested vector literals. Patch by ↵Eli Friedman2012-01-03
| | | | | | Anton Lokhmotov. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147496 91177308-0d34-0410-b5e6-96231b3b80d8
* TypePrinter: print OpenCL address space names. Patch by RichardPeter Collingbourne2011-11-08
| | | | | | Membarth, test case by myself. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144063 91177308-0d34-0410-b5e6-96231b3b80d8
* The comparison of two vectors should return a signed result. ↵Tanya Lattner2011-10-17
| | | | | | | | | | hasIntegerRepresentation() used to always return false for vectors, but since it was changed, it also changed the return type of a compare of two unsigned vectors to be unsigned. This patch removes the check for hasIntegerRepresentation since its not needed and returns the appropriate signed type. I added a new test case and updated exisiting test cases that assumed an unsigned result. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142250 91177308-0d34-0410-b5e6-96231b3b80d8
* In OpenCL, conversions between different vector types are disallowedTobias Grosser2011-09-22
| | | | | | | | | | | | | | OpenCL 6.2.1 says: "Implicit conversions between built-in vector data types are disallowed." OpenCL 6.2.2 says: "Explicit casts between vector types are not legal." For example: uint4 u = (uint4)(1); int4 i = u; // invalid implicit conversion int4 e = (int4)u; // invalid explicit conversion Fixes PR10967. Submitted by: Anton Lokhmotov <Anton.lokhmotov@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140300 91177308-0d34-0410-b5e6-96231b3b80d8
* In the OpenCL mode, the AltiVec mode must be off and checks must be strictTobias Grosser2011-09-21
| | | | | | | | | | OpenCL is different from AltiVec in the way it supports vector literals. OpenCL is strict with regards to semantic checks. For example, implicit conversions and explicit casts between vectors of different types are disallowed. Fixes PR10975. Submitted by: Anton Lokhmotov <Anton.lokhmotov@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140270 91177308-0d34-0410-b5e6-96231b3b80d8
* OpenCL: introduce support for function scope __local variablesPeter Collingbourne2011-09-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140068 91177308-0d34-0410-b5e6-96231b3b80d8