hanchenye-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
cond.cl OpenCL: handle ternary operator when the condition is a vector 2015-02-04 06:38:18 +00:00
endian-attr.cl
event_t.cl
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
half.cl
init.cl
invalid-constant.cl
invalid-kernel-attrs.cl
invalid-kernel-parameters.cl
invalid-kernel.cl
invalid-logical-ops-1.1.cl
invalid-logical-ops-1.2.cl
lit.local.cfg
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
storageclass.cl
str_literals.cl
unsupported.cl
vec_compare.cl
vec_step.cl
vector_conv_invalid.cl
vector_inc_dec_ops.cl
vector_literals_const.cl
vector_literals_invalid.cl
warn-missing-prototypes.cl