summaryrefslogtreecommitdiffstats
path: root/test/CodeGenOpenCL
diff options
context:
space:
mode:
authorYaxun Liu <Yaxun.Liu@amd.com>2017-10-23 17:49:26 +0000
committerYaxun Liu <Yaxun.Liu@amd.com>2017-10-23 17:49:26 +0000
commit5d089284208206e4a621f99513a8a8ede1f9ac7e (patch)
tree0dd66f5a784f429774024ba0784c7ffaadc0b91b /test/CodeGenOpenCL
parent8b07e281bf02e8cb4e598bc6cab958ee00d41a29 (diff)
CodeGen: Fix invalid bitcast in partial initialization of automatic arrary variable
Differential Revision: https://reviews.llvm.org/D39184 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316353 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenOpenCL')
-rw-r--r--test/CodeGenOpenCL/amdgcn-automatic-variable.cl8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/CodeGenOpenCL/amdgcn-automatic-variable.cl b/test/CodeGenOpenCL/amdgcn-automatic-variable.cl
index 19287c7d89..fefe1c4a41 100644
--- a/test/CodeGenOpenCL/amdgcn-automatic-variable.cl
+++ b/test/CodeGenOpenCL/amdgcn-automatic-variable.cl
@@ -58,3 +58,11 @@ void func2(void) {
const int lvc = 4;
lv1 = lvc;
}
+
+// CHECK-LABEL: define void @func3()
+// CHECK: %a = alloca [16 x [1 x float]], align 4, addrspace(5)
+// CHECK: %[[CAST:.+]] = bitcast [16 x [1 x float]] addrspace(5)* %a to i8 addrspace(5)*
+// CHECK: call void @llvm.memset.p5i8.i64(i8 addrspace(5)* %[[CAST]], i8 0, i64 64, i32 4, i1 false)
+void func3(void) {
+ float a[16][1] = {{0.}};
+}