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