summaryrefslogtreecommitdiffstats
path: root/test/SemaOpenCL
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaOpenCL')
-rw-r--r--test/SemaOpenCL/cond.cl5
-rw-r--r--test/SemaOpenCL/extension-fp64.cl17
-rw-r--r--test/SemaOpenCL/init.cl15
3 files changed, 37 insertions, 0 deletions
diff --git a/test/SemaOpenCL/cond.cl b/test/SemaOpenCL/cond.cl
new file mode 100644
index 0000000..79dc82d
--- /dev/null
+++ b/test/SemaOpenCL/cond.cl
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+
+typedef __attribute__((ext_vector_type(4))) float float4;
+
+float4 foo(float4 a, float4 b, float4 c, float4 d) { return a < b ? c : d; }
diff --git a/test/SemaOpenCL/extension-fp64.cl b/test/SemaOpenCL/extension-fp64.cl
new file mode 100644
index 0000000..eaf2509
--- /dev/null
+++ b/test/SemaOpenCL/extension-fp64.cl
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+
+void f1(double da) { // expected-error {{requires cl_khr_fp64 extension}}
+ double d; // expected-error {{requires cl_khr_fp64 extension}}
+}
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+
+void f2(void) {
+ double d;
+}
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : disable
+
+void f3(void) {
+ double d; // expected-error {{requires cl_khr_fp64 extension}}
+}
diff --git a/test/SemaOpenCL/init.cl b/test/SemaOpenCL/init.cl
new file mode 100644
index 0000000..b3ecfec
--- /dev/null
+++ b/test/SemaOpenCL/init.cl
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+
+typedef float float8 __attribute((ext_vector_type(8)));
+
+typedef float float32_t;
+typedef __attribute__(( __vector_size__(16) )) float32_t __neon_float32x4_t;
+typedef struct __simd128_float32_t {
+ __neon_float32x4_t val;
+} float32x4_t;
+
+float8 foo(float8 x) {
+ float32x4_t lo;
+ float32x4_t hi;
+ return (float8) (lo.val, hi.val);
+}
OpenPOWER on IntegriCloud