aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/address-space.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/address-space.c')
-rw-r--r--test/CodeGen/address-space.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/CodeGen/address-space.c b/test/CodeGen/address-space.c
index 61deb2625336..5d57d5b6ebe5 100644
--- a/test/CodeGen/address-space.c
+++ b/test/CodeGen/address-space.c
@@ -1,4 +1,6 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm < %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm < %s | FileCheck -check-prefixes=CHECK,GIZ %s
+// RUN: %clang_cc1 -triple amdgcn -emit-llvm < %s | FileCheck -check-prefixes=CHECK,PIZ %s
+// RUN: %clang_cc1 -triple amdgcn---amdgiz -emit-llvm < %s | FileCheck -check-prefixes=CHeCK,GIZ %s
// CHECK: @foo = common addrspace(1) global
int foo __attribute__((address_space(1)));
@@ -6,6 +8,9 @@ int foo __attribute__((address_space(1)));
// CHECK: @ban = common addrspace(1) global
int ban[10] __attribute__((address_space(1)));
+// CHECK: @a = common global
+int a __attribute__((address_space(0)));
+
// CHECK-LABEL: define i32 @test1()
// CHECK: load i32, i32 addrspace(1)* @foo
int test1() { return foo; }
@@ -19,9 +24,11 @@ int test2(int i) { return ban[i]; }
__attribute__((address_space(2))) int *A, *B;
// CHECK-LABEL: define void @test3()
-// CHECK: load i32 addrspace(2)*, i32 addrspace(2)** @B
+// GIZ: load i32 addrspace(2)*, i32 addrspace(2)** @B
+// PIZ: load i32 addrspace(2)*, i32 addrspace(2)* addrspace(4)* @B
// CHECK: load i32, i32 addrspace(2)*
-// CHECK: load i32 addrspace(2)*, i32 addrspace(2)** @A
+// GIZ: load i32 addrspace(2)*, i32 addrspace(2)** @A
+// PIZ: load i32 addrspace(2)*, i32 addrspace(2)* addrspace(4)* @A
// CHECK: store i32 {{.*}}, i32 addrspace(2)*
void test3() {
*A = *B;