summaryrefslogtreecommitdiffstats
path: root/test/SemaOpenCL/endian-attr.cl
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaOpenCL/endian-attr.cl')
-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 0000000..e851cdf
--- /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}}
OpenPOWER on IntegriCloud