summaryrefslogtreecommitdiffstats
path: root/test/SemaOpenCL
diff options
context:
space:
mode:
authorJoey Gouly <joey.gouly@arm.com>2013-03-14 09:54:43 +0000
committerJoey Gouly <joey.gouly@arm.com>2013-03-14 09:54:43 +0000
commit96cead513761d287c88a4f05c712aee3b26b9d6f (patch)
tree24c61d7927c36601c108c6ee72ff46262b1989b4 /test/SemaOpenCL
parent8ef19a22956defa392df46c79e2d499ab7b16647 (diff)
Add support for the 'endian' attribute for OpenCL.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177035 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaOpenCL')
-rw-r--r--test/SemaOpenCL/endian-attr.cl9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaOpenCL/endian-attr.cl b/test/SemaOpenCL/endian-attr.cl
new file mode 100644
index 0000000000..e851cdf90b
--- /dev/null
+++ b/test/SemaOpenCL/endian-attr.cl
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -verify %s
+
+constant long a __attribute__((endian(host))) = 100;
+
+constant long b __attribute__((endian(device))) = 100;
+
+constant long c __attribute__((endian(none))) = 100; // expected-warning {{unknown endian 'none'}}
+
+void func() __attribute__((endian(host))); // expected-warning {{endian attribute only applies to variables}}