diff options
author | Anastasia Stulova <anastasia.stulova@arm.com> | 2019-08-02 11:19:35 +0000 |
---|---|---|
committer | Anastasia Stulova <anastasia.stulova@arm.com> | 2019-08-02 11:19:35 +0000 |
commit | 8d99a5c0e629131e732baf02cfeea8f42f61f5f2 (patch) | |
tree | f777003fecb385c04998bcf48fe3ca2f5ffaf3dd /clang/test/SemaOpenCL | |
parent | 397a516a52d52a530a29351bbe4de02e72c884bd (diff) | |
download | bcm5719-llvm-8d99a5c0e629131e732baf02cfeea8f42f61f5f2.tar.gz bcm5719-llvm-8d99a5c0e629131e732baf02cfeea8f42f61f5f2.zip |
[OpenCL] Allow OpenCL C style vector initialization in C++
Allow creating vector literals from other vectors.
float4 a = (float4)(1.0f, 2.0f, 3.0f, 4.0f);
float4 v = (float4)(a.s23, a.s01);
Differential revision: https://reviews.llvm.org/D65286
llvm-svn: 367675
Diffstat (limited to 'clang/test/SemaOpenCL')
-rw-r--r-- | clang/test/SemaOpenCL/vector_literals_const.cl | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/clang/test/SemaOpenCL/vector_literals_const.cl b/clang/test/SemaOpenCL/vector_literals_const.cl deleted file mode 100644 index ee5ae2002a3..00000000000 --- a/clang/test/SemaOpenCL/vector_literals_const.cl +++ /dev/null @@ -1,27 +0,0 @@ -// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -// expected-no-diagnostics - -typedef int int2 __attribute((ext_vector_type(2))); -typedef int int3 __attribute((ext_vector_type(3))); -typedef int int4 __attribute((ext_vector_type(4))); - -__constant int4 i_1_1_1_1 = (int4)(1,2,3,4); -__constant int4 i_2_1_1 = (int4)((int2)(1,2),3,4); -__constant int4 i_1_2_1 = (int4)(1,(int2)(2,3),4); -__constant int4 i_1_1_2 = (int4)(1,2,(int2)(3,4)); -__constant int4 i_2_2 = (int4)((int2)(1,2),(int2)(3,4)); -__constant int4 i_3_1 = (int4)((int3)(1,2,3),4); -__constant int4 i_1_3 = (int4)(1,(int3)(2,3,4)); - -typedef float float2 __attribute((ext_vector_type(2))); -typedef float float3 __attribute((ext_vector_type(3))); -typedef float float4 __attribute((ext_vector_type(4))); - -__constant float4 f_1_1_1_1 = (float4)(1,2,3,4); -__constant float4 f_2_1_1 = (float4)((float2)(1,2),3,4); -__constant float4 f_1_2_1 = (float4)(1,(float2)(2,3),4); -__constant float4 f_1_1_2 = (float4)(1,2,(float2)(3,4)); -__constant float4 f_2_2 = (float4)((float2)(1,2),(float2)(3,4)); -__constant float4 f_3_1 = (float4)((float3)(1,2,3),4); -__constant float4 f_1_3 = (float4)(1,(float3)(2,3,4)); - |