diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CodeGen/address-space.c | 4 | ||||
-rw-r--r-- | clang/test/CodeGen/default-address-space.c | 19 | ||||
-rw-r--r-- | clang/test/CodeGen/x86_64-arguments.c | 4 | ||||
-rw-r--r-- | clang/test/CodeGenCXX/amdgcn-automatic-variable.cpp | 16 |
4 files changed, 28 insertions, 15 deletions
diff --git a/clang/test/CodeGen/address-space.c b/clang/test/CodeGen/address-space.c index 35e3dbdcfa7..54e05938577 100644 --- a/clang/test/CodeGen/address-space.c +++ b/clang/test/CodeGen/address-space.c @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm < %s | FileCheck -check-prefixes=CHECK,GIZ %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm < %s | FileCheck -check-prefixes=CHECK,X86,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 +// RUN: %clang_cc1 -triple amdgcn---amdgiz -emit-llvm < %s | FileCheck -check-prefixes=CHECK,AMDGIZ,GIZ %s // CHECK: @foo = common addrspace(1) global int foo __attribute__((address_space(1))); diff --git a/clang/test/CodeGen/default-address-space.c b/clang/test/CodeGen/default-address-space.c index 07ddf48fac2..fc5f55ffd6f 100644 --- a/clang/test/CodeGen/default-address-space.c +++ b/clang/test/CodeGen/default-address-space.c @@ -22,9 +22,10 @@ int *B; int test1() { return foo; } // COM-LABEL: define i32 @test2(i32 %i) -// PIZ: load i32, i32 addrspace(4)* +// COM: %[[addr:.*]] = getelementptr +// PIZ: load i32, i32 addrspace(4)* %[[addr]] // PIZ-NEXT: ret i32 -// CHECK: load i32, i32* +// CHECK: load i32, i32* %[[addr]] // CHECK-NEXT: ret i32 int test2(int i) { return ban[i]; } @@ -42,15 +43,17 @@ void test3() { } // PIZ-LABEL: define void @test4(i32 addrspace(4)* %a) -// PIZ: %[[a_addr:.*]] = alloca i32 addrspace(4)* -// PIZ: store i32 addrspace(4)* %a, i32 addrspace(4)** %[[a_addr]] -// PIZ: %[[r0:.*]] = load i32 addrspace(4)*, i32 addrspace(4)** %[[a_addr]] +// PIZ: %[[alloca:.*]] = alloca i32 addrspace(4)* +// PIZ: %[[a_addr:.*]] = addrspacecast{{.*}} %[[alloca]] to i32 addrspace(4)* addrspace(4)* +// PIZ: store i32 addrspace(4)* %a, i32 addrspace(4)* addrspace(4)* %[[a_addr]] +// PIZ: %[[r0:.*]] = load i32 addrspace(4)*, i32 addrspace(4)* addrspace(4)* %[[a_addr]] // PIZ: %[[arrayidx:.*]] = getelementptr inbounds i32, i32 addrspace(4)* %[[r0]] // PIZ: store i32 0, i32 addrspace(4)* %[[arrayidx]] // CHECK-LABEL: define void @test4(i32* %a) -// CHECK: %[[a_addr:.*]] = alloca i32*, align 4, addrspace(5) -// CHECK: store i32* %a, i32* addrspace(5)* %[[a_addr]] -// CHECK: %[[r0:.*]] = load i32*, i32* addrspace(5)* %[[a_addr]] +// CHECK: %[[alloca:.*]] = alloca i32*, align 4, addrspace(5) +// CHECK: %[[a_addr:.*]] = addrspacecast{{.*}} %[[alloca]] to i32** +// CHECK: store i32* %a, i32** %[[a_addr]] +// CHECK: %[[r0:.*]] = load i32*, i32** %[[a_addr]] // CHECK: %[[arrayidx:.*]] = getelementptr inbounds i32, i32* %[[r0]] // CHECK: store i32 0, i32* %[[arrayidx]] void test4(int *a) { diff --git a/clang/test/CodeGen/x86_64-arguments.c b/clang/test/CodeGen/x86_64-arguments.c index 9f375d780c9..d24ea4dbab3 100644 --- a/clang/test/CodeGen/x86_64-arguments.c +++ b/clang/test/CodeGen/x86_64-arguments.c @@ -460,7 +460,7 @@ void test54() { test54_helper(x54, x54, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0i); } // AVX: @test54_helper(<8 x float> {{%[a-zA-Z0-9]+}}, <8 x float> {{%[a-zA-Z0-9]+}}, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double {{%[a-zA-Z0-9]+}}, double {{%[a-zA-Z0-9]+}}) -// AVX: @test54_helper(<8 x float> {{%[a-zA-Z0-9]+}}, <8 x float> {{%[a-zA-Z0-9]+}}, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, { double, double }* byval align 8 {{%[a-zA-Z0-9]+}}) +// AVX: @test54_helper(<8 x float> {{%[a-zA-Z0-9]+}}, <8 x float> {{%[a-zA-Z0-9]+}}, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, { double, double }* byval align 8 {{%[^)]+}}) typedef float __m512 __attribute__ ((__vector_size__ (64))); typedef struct { @@ -529,7 +529,7 @@ void f63(__m512 *m, __builtin_va_list argList) { } // AVX512: @f64_helper(<16 x float> {{%[a-zA-Z0-9]+}}, <16 x float> {{%[a-zA-Z0-9]+}}, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double {{%[a-zA-Z0-9]+}}, double {{%[a-zA-Z0-9]+}}) -// AVX512: @f64_helper(<16 x float> {{%[a-zA-Z0-9]+}}, <16 x float> {{%[a-zA-Z0-9]+}}, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, { double, double }* byval align 8 {{%[a-zA-Z0-9]+}}) +// AVX512: @f64_helper(<16 x float> {{%[a-zA-Z0-9]+}}, <16 x float> {{%[a-zA-Z0-9]+}}, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, { double, double }* byval align 8 {{%[^)]+}}) void f64_helper(__m512, ...); __m512 x64; void f64() { 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); +} |