summaryrefslogtreecommitdiffstats
path: root/test/SemaOpenCL
diff options
context:
space:
mode:
authorJoey Gouly <joey.gouly@arm.com>2013-11-14 18:26:10 +0000
committerJoey Gouly <joey.gouly@arm.com>2013-11-14 18:26:10 +0000
commit758c4d86bb9b2298374fce5b3ca4a35f953f2d2e (patch)
treec5f886e049e56b69df48c7c8369934dcd26067c8 /test/SemaOpenCL
parent6973a27866b176b1cf4e3e3ebcf0196e101b85dd (diff)
[OpenCL] Make sure we put string literals in the constant address space.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194717 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaOpenCL')
-rw-r--r--test/SemaOpenCL/str_literals.cl13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaOpenCL/str_literals.cl b/test/SemaOpenCL/str_literals.cl
new file mode 100644
index 0000000000..da665c3fd1
--- /dev/null
+++ b/test/SemaOpenCL/str_literals.cl
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 %s -verify
+// expected-no-diagnostics
+
+constant char * __constant x = "hello world";
+
+void foo(__constant char * a) {
+
+}
+
+void bar() {
+ foo("hello world");
+ foo(x);
+}