diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-02-15 19:46:41 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-02-15 19:46:41 +0000 |
commit | e91b2dbdf155b9e9f8ec790e77487bf2de96ea88 (patch) | |
tree | 0dbeb5ba9f48d375b98f9812018ea783c7433357 /clang/test/CodeGenOpenCL | |
parent | 5df20e02af72fdb1328c981f6f2b6dd7e1d24c1b (diff) | |
download | bcm5719-llvm-e91b2dbdf155b9e9f8ec790e77487bf2de96ea88.tar.gz bcm5719-llvm-e91b2dbdf155b9e9f8ec790e77487bf2de96ea88.zip |
OpenCL: standardise naming of test cases
llvm-svn: 125590
Diffstat (limited to 'clang/test/CodeGenOpenCL')
-rw-r--r-- | clang/test/CodeGenOpenCL/ext-vector-shuffle.cl | 17 | ||||
-rw-r--r-- | clang/test/CodeGenOpenCL/single-precision-constant.cl | 7 |
2 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/CodeGenOpenCL/ext-vector-shuffle.cl b/clang/test/CodeGenOpenCL/ext-vector-shuffle.cl new file mode 100644 index 00000000000..ee88ba3c06d --- /dev/null +++ b/clang/test/CodeGenOpenCL/ext-vector-shuffle.cl @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 %s -cl-opt-disable -emit-llvm -o - | not grep 'extractelement' +// RUN: %clang_cc1 %s -cl-opt-disable -emit-llvm -o - | not grep 'insertelement' +// RUN: %clang_cc1 %s -cl-opt-disable -emit-llvm -o - | grep 'shufflevector' + +typedef __attribute__(( ext_vector_type(2) )) float float2; +typedef __attribute__(( ext_vector_type(4) )) float float4; + +float2 test1(float4 V) { + return V.xy + V.wz; +} + +float4 test2(float4 V) { + float2 W = V.ww; + return W.xyxy + W.yxyx; +} + +float4 test3(float4 V1, float4 V2) { return (float4)(V1.zw, V2.xy); } diff --git a/clang/test/CodeGenOpenCL/single-precision-constant.cl b/clang/test/CodeGenOpenCL/single-precision-constant.cl new file mode 100644 index 00000000000..62b37c13613 --- /dev/null +++ b/clang/test/CodeGenOpenCL/single-precision-constant.cl @@ -0,0 +1,7 @@ +// RUN: %clang_cc1 %s -cl-single-precision-constant -emit-llvm -o - | FileCheck %s + +float fn(float f) { + // CHECK: fmul float + // CHECK: fadd float + return f*2. + 1.; +} |