llvm-project/clang/test/SemaOpenCL
Sameer Sahasrabuddhe a75db66eee Restores r228382, which was reverted in r228406.
The original commit failed to handle "shift assign" (<<=), which
broke the test mentioned in r228406. This is now fixed and the
test added to the lit tests under SemaOpenCL.

*** Original commit message from r228382 ***

OpenCL: handle shift operator with vector operands

Introduce a number of checks:
1. If LHS is a scalar, then RHS cannot be a vector.
2. Operands must be of integer type.
3. If both are vectors, then the number of elements must match.

Relax the requirement for "usual arithmetic conversions":
When LHS is a vector, a scalar RHS can simply be expanded into a
vector; OpenCL does not require that its rank be lower than the LHS.
For example, the following code is not an error even if the implicit
type of the constant literal is "int".

  char2 foo(char2 v) { return v << 1; }

Consolidate existing tests under CodeGenOpenCL, and add more tests
under SemaOpenCL.

llvm-svn: 230464
2015-02-25 05:48:23 +00:00
..
address-spaces-conversions-cl2.0.cl [OpenCL] Implemented restrictions for pointer conversions specified in OpenCL v2.0. 2014-11-26 15:36:41 +00:00
address-spaces.cl OpenCL: Emit global variables in the constant addr space as constant globals 2014-10-16 15:29:19 +00:00
amdgpu-num-register-attrs.cl Workaround attribute ordering issue with kernel only attributes 2014-12-05 18:03:58 +00:00
array-parameters.cl Allow address space qualifiers on OpenCL array parameters 2014-04-15 11:38:29 +00:00
cond.cl OpenCL: handle ternary operator when the condition is a vector 2015-02-04 06:38:18 +00:00
endian-attr.cl Removing the endian attribute and updating associated test cases. This functionality was never completely implemented, and this is an improvement over silently eating the attribute. 2013-09-09 12:57:20 +00:00
event_t.cl [OpenCL] Variables in the constant address space must be initialized. 2014-01-03 14:16:55 +00:00
event_t_overload.cl
extension-fp64-cl1.1.cl Fix OpenCL 1.2 double as an optional core feature behaviour 2015-01-30 10:51:46 +00:00
extension-fp64.cl
extern.cl OpenCL: Emit global variables in the constant addr space as constant globals 2014-10-16 15:29:19 +00:00
func_ptr.cl OpenCL: fix for the restriction on pointers to functions. 2014-02-20 13:52:08 +00:00
half.cl Parameter/argument terminology fixes 2014-05-11 16:06:11 +00:00
init.cl
invalid-constant.cl [OpenCL] Add test case for previous commit. 2014-01-03 15:11:57 +00:00
invalid-kernel-attrs.cl [OpenCL] Reject reqd_work_group_size(X, Y, Z) where X, Y or Z == 0. 2014-05-19 14:41:38 +00:00
invalid-kernel-parameters.cl
invalid-kernel.cl Allow address space qualifiers on OpenCL array parameters 2014-04-15 11:38:29 +00:00
invalid-logical-ops-1.1.cl
invalid-logical-ops-1.2.cl
lit.local.cfg Disallow driver use in more Sema tests 2014-04-19 19:07:31 +00:00
optional-core-fp64-cl1.2.cl Fix OpenCL 1.2 double as an optional core feature behaviour 2015-01-30 10:51:46 +00:00
optional-core-fp64-cl2.0.cl Fix OpenCL 1.2 double as an optional core feature behaviour 2015-01-30 10:51:46 +00:00
sampler_t.cl
sampler_t_overload.cl
shifts.cl Restores r228382, which was reverted in r228406. 2015-02-25 05:48:23 +00:00
sizeof.cl [OpenCL] Produce an error, instead of a warning, for sizeof(void) in OpenCL. 2013-12-31 15:47:49 +00:00
storageclass.cl
str_literals.cl [OpenCL] Make sure we put string literals in the constant address space. 2013-11-14 18:26:10 +00:00
unsupported.cl
vec_compare.cl
vec_step.cl
vector_conv_invalid.cl Print detailed vector type information on diagnostics. 2014-04-25 20:41:38 +00:00
vector_inc_dec_ops.cl
vector_literals_const.cl
vector_literals_invalid.cl
warn-missing-prototypes.cl