xref: /aosp_15_r20/external/clang/test/CodeGenOpenCL/ext-vector-shuffle.cl (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 %s -cl-opt-disable -emit-llvm -o - | not grep 'extractelement'
2*67e74705SXin Li// RUN: %clang_cc1 %s -cl-opt-disable -emit-llvm -o - | not grep 'insertelement'
3*67e74705SXin Li// RUN: %clang_cc1 %s -cl-opt-disable -emit-llvm -o - | grep 'shufflevector'
4*67e74705SXin Li
5*67e74705SXin Litypedef __attribute__(( ext_vector_type(2) )) float float2;
6*67e74705SXin Litypedef __attribute__(( ext_vector_type(4) )) float float4;
7*67e74705SXin Li
8*67e74705SXin Lifloat2 test1(float4 V) {
9*67e74705SXin Li  return V.xy + V.wz;
10*67e74705SXin Li}
11*67e74705SXin Li
12*67e74705SXin Lifloat4 test2(float4 V) {
13*67e74705SXin Li  float2 W = V.ww;
14*67e74705SXin Li  return W.xyxy + W.yxyx;
15*67e74705SXin Li}
16*67e74705SXin Li
17*67e74705SXin Lifloat4 test3(float4 V1, float4 V2) { return (float4)(V1.zw, V2.xy); }
18