summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenOpenCL/const-str-array-decay.cl
diff options
context:
space:
mode:
authorPekka Jaaskelainen <pekka.jaaskelainen@tut.fi>2014-12-19 18:04:27 +0000
committerPekka Jaaskelainen <pekka.jaaskelainen@tut.fi>2014-12-19 18:04:27 +0000
commite94b0e187005ddbc3e5e8018829fada07379a542 (patch)
treec17430d467b933e3eb80184ea07aca1300d2736f /clang/test/CodeGenOpenCL/const-str-array-decay.cl
parentcd8500e500d9359575a1b762d8dfc7d608e20d47 (diff)
downloadbcm5719-llvm-e94b0e187005ddbc3e5e8018829fada07379a542.tar.gz
bcm5719-llvm-e94b0e187005ddbc3e5e8018829fada07379a542.zip
Fix an address space id reset with array decay's
implicit conversion. The issue was produced with OpenCL C code that called a function with a constant string literal argument. llvm-svn: 224592
Diffstat (limited to 'clang/test/CodeGenOpenCL/const-str-array-decay.cl')
-rw-r--r--clang/test/CodeGenOpenCL/const-str-array-decay.cl11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/CodeGenOpenCL/const-str-array-decay.cl b/clang/test/CodeGenOpenCL/const-str-array-decay.cl
new file mode 100644
index 00000000000..dbbe08989cb
--- /dev/null
+++ b/clang/test/CodeGenOpenCL/const-str-array-decay.cl
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - -ffake-address-space-map | FileCheck %s
+
+int test_func(constant char* foo);
+
+kernel void str_array_decy() {
+ test_func("Test string literal");
+}
+
+// CHECK: i8 addrspace(3)* getelementptr inbounds ([20 x i8] addrspace(3)*
+// CHECK-NOT: addrspacecast
+
OpenPOWER on IntegriCloud