summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/amdgcn-automatic-variable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGenCXX/amdgcn-automatic-variable.cpp')
-rw-r--r--clang/test/CodeGenCXX/amdgcn-automatic-variable.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/clang/test/CodeGenCXX/amdgcn-automatic-variable.cpp b/clang/test/CodeGenCXX/amdgcn-automatic-variable.cpp
index aab720770d1..7df27c28e6d 100644
--- a/clang/test/CodeGenCXX/amdgcn-automatic-variable.cpp
+++ b/clang/test/CodeGenCXX/amdgcn-automatic-variable.cpp
@@ -3,9 +3,10 @@
// CHECK-LABEL: define void @_Z5func1Pi(i32* %x)
void func1(int *x) {
// CHECK: %[[x_addr:.*]] = alloca i32*{{.*}}addrspace(5)
- // CHECK: store i32* %x, i32* addrspace(5)* %[[x_addr]]
- // CHECK: %[[r0:.*]] = load i32*, i32* addrspace(5)* %[[x_addr]]
- // CHECK: store i32 1, i32* %[[r0]]
+ // CHECK: %[[r0:.*]] = addrspacecast i32* addrspace(5)* %[[x_addr]] to i32**
+ // CHECK: store i32* %x, i32** %[[r0]]
+ // CHECK: %[[r1:.*]] = load i32*, i32** %[[r0]]
+ // CHECK: store i32 1, i32* %[[r1]]
*x = 1;
}
@@ -70,3 +71,12 @@ void func3() {
// CHECK: call void @_ZN1AD1Ev(%class.A* %[[r0]])
A a;
}
+
+// CHECK-LABEL: define void @_Z5func4i
+void func4(int x) {
+ // CHECK: %[[x_addr:.*]] = alloca i32, align 4, addrspace(5)
+ // CHECK: %[[r0:.*]] = addrspacecast i32 addrspace(5)* %[[x_addr]] to i32*
+ // CHECK: store i32 %x, i32* %[[r0]], align 4
+ // CHECK: call void @_Z5func1Pi(i32* %[[r0]])
+ func1(&x);
+}
OpenPOWER on IntegriCloud