diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
| commit | bca07a4524feb4edec581062d631a13116320a24 (patch) | |
| tree | a9243275843fbeaa590afc07ee888e006b8d54ea /test/CodeGenOpenCL | |
| parent | 998bc5802ecdd65ce3b270f6c69a8ae8557f0a10 (diff) | |
Notes
Diffstat (limited to 'test/CodeGenOpenCL')
| -rw-r--r-- | test/CodeGenOpenCL/ext-vector-shuffle.cl | 17 | ||||
| -rw-r--r-- | test/CodeGenOpenCL/kernel-metadata.cl | 10 | ||||
| -rw-r--r-- | test/CodeGenOpenCL/single-precision-constant.cl | 7 |
3 files changed, 34 insertions, 0 deletions
diff --git a/test/CodeGenOpenCL/ext-vector-shuffle.cl b/test/CodeGenOpenCL/ext-vector-shuffle.cl new file mode 100644 index 000000000000..ee88ba3c06d1 --- /dev/null +++ b/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/test/CodeGenOpenCL/kernel-metadata.cl b/test/CodeGenOpenCL/kernel-metadata.cl new file mode 100644 index 000000000000..3e10a119d044 --- /dev/null +++ b/test/CodeGenOpenCL/kernel-metadata.cl @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s + +void normal_function() { +} + +__kernel void kernel_function() { +} + +// CHECK: !opencl.kernels = !{!0} +// CHECK: !0 = metadata !{void ()* @kernel_function} diff --git a/test/CodeGenOpenCL/single-precision-constant.cl b/test/CodeGenOpenCL/single-precision-constant.cl new file mode 100644 index 000000000000..62b37c136137 --- /dev/null +++ b/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.; +} |
