summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Tweed <david.tweed@arm.com>2013-09-09 09:55:07 +0000
committerDavid Tweed <david.tweed@arm.com>2013-09-09 09:55:07 +0000
commit1bcaeb24032f8ac265c89e06d9415b4b021b16aa (patch)
tree4e3238dda79a65b162c2306161ce540a2c7a05af
parent2da64389698fcd6bc9dedd6ca47b8fb669d4e927 (diff)
downloadbcm5719-llvm-1bcaeb24032f8ac265c89e06d9415b4b021b16aa.tar.gz
bcm5719-llvm-1bcaeb24032f8ac265c89e06d9415b4b021b16aa.zip
Commit 190296 missed out the tests; add them now. Note that it actually tests
"long long" which is currently technically only "reserved for future" use in OpenCL, but since clang in OpenCL mode supports it we may as well test the modifications to the settings made for that type. llvm-svn: 190297
-rw-r--r--clang/test/Misc/languageOptsOpenCL.cl19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/Misc/languageOptsOpenCL.cl b/clang/test/Misc/languageOptsOpenCL.cl
new file mode 100644
index 00000000000..c81db995808
--- /dev/null
+++ b/clang/test/Misc/languageOptsOpenCL.cl
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -x cl %s -verify
+// expected-no-diagnostics
+
+// Test the forced language options for OpenCL are set correctly.
+
+__constant int v0[(sizeof(int) == 4) -1];
+__constant int v1[(__alignof(int) == 4) -1];
+__constant int v2[(sizeof(long) == 8) -1];
+__constant int v3[(__alignof(long) == 8) -1];
+__constant int v4[(sizeof(long long) == 16) -1];
+__constant int v5[(__alignof(long long) == 16) -1];
+__constant int v6[(sizeof(float) == 4) -1];
+__constant int v7[(__alignof(float) == 4) -1];
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+__constant int v8[(sizeof(double)==8) -1];
+__constant int v9[(__alignof(double)==8) -1];
+#pragma OPENCL EXTENSION cl_khr_fp16 : enable
+__constant int v10[(sizeof(half) == 2) -1];
+__constant int v11[(__alignof(half) == 2) -1];
OpenPOWER on IntegriCloud