diff options
Diffstat (limited to 'test/CodeGenOpenCL')
-rw-r--r-- | test/CodeGenOpenCL/amdgpu-debug-info-variable-expression.cl | 3 | ||||
-rw-r--r-- | test/CodeGenOpenCL/byval.cl | 18 | ||||
-rw-r--r-- | test/CodeGenOpenCL/lifetime.cl | 15 |
3 files changed, 34 insertions, 2 deletions
diff --git a/test/CodeGenOpenCL/amdgpu-debug-info-variable-expression.cl b/test/CodeGenOpenCL/amdgpu-debug-info-variable-expression.cl index b02ad46224b0..a962d3c75aaf 100644 --- a/test/CodeGenOpenCL/amdgpu-debug-info-variable-expression.cl +++ b/test/CodeGenOpenCL/amdgpu-debug-info-variable-expression.cl @@ -1,6 +1,5 @@ // RUN: %clang -cl-std=CL2.0 -emit-llvm -g -O0 -S -target amdgcn-amd-amdhsa -mcpu=fiji -o - %s | FileCheck %s -// CHECK-DAG: ![[NONE:[0-9]+]] = !DIExpression() // CHECK-DAG: ![[LOCAL:[0-9]+]] = !DIExpression(DW_OP_constu, 2, DW_OP_swap, DW_OP_xderef) // CHECK-DAG: ![[PRIVATE:[0-9]+]] = !DIExpression(DW_OP_constu, 1, DW_OP_swap, DW_OP_xderef) @@ -82,7 +81,7 @@ kernel void kernel1( int *FuncVar4 = Tmp1; // CHECK-DAG: ![[FUNCVAR5:[0-9]+]] = !DILocalVariable(name: "FuncVar5", scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: {{[0-9]+}}, type: !{{[0-9]+}}) - // CHECK-DAG: call void @llvm.dbg.declare(metadata i32 addrspace(1)** {{.*}}, metadata ![[FUNCVAR5]], metadata ![[NONE]]), !dbg !{{[0-9]+}} + // CHECK-DAG: call void @llvm.dbg.declare(metadata i32 addrspace(1)** {{.*}}, metadata ![[FUNCVAR5]], metadata ![[NONE:[0-9]+]]), !dbg !{{[0-9]+}} global int *constant FuncVar5 = KernelArg0; // CHECK-DAG: ![[FUNCVAR6:[0-9]+]] = !DILocalVariable(name: "FuncVar6", scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: {{[0-9]+}}, type: !{{[0-9]+}}) // CHECK-DAG: call void @llvm.dbg.declare(metadata i32 addrspace(2)** {{.*}}, metadata ![[FUNCVAR6]], metadata ![[NONE]]), !dbg !{{[0-9]+}} diff --git a/test/CodeGenOpenCL/byval.cl b/test/CodeGenOpenCL/byval.cl new file mode 100644 index 000000000000..1a8105c5207f --- /dev/null +++ b/test/CodeGenOpenCL/byval.cl @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -emit-llvm -o - -triple amdgcn %s | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -o - -triple amdgcn---amdgizcl %s | FileCheck %s -check-prefix=AMDGIZ + +struct A { + int x[100]; +}; + +int f(struct A a); + +int g() { + struct A a; + // CHECK: call i32 @f(%struct.A* byval{{.*}}%a) + // AMDGIZ: call i32 @f(%struct.A addrspace(5)* byval{{.*}}%a) + return f(a); +} + +// CHECK: declare i32 @f(%struct.A* byval{{.*}}) +// AMDGIZ: declare i32 @f(%struct.A addrspace(5)* byval{{.*}}) diff --git a/test/CodeGenOpenCL/lifetime.cl b/test/CodeGenOpenCL/lifetime.cl new file mode 100644 index 000000000000..430e0582aeda --- /dev/null +++ b/test/CodeGenOpenCL/lifetime.cl @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -o - -triple amdgcn---amdgizcl %s | FileCheck %s -check-prefix=AMDGIZ + +void use(char *a); + +__attribute__((always_inline)) void helper_no_markers() { + char a; + use(&a); +} + +void lifetime_test() { +// CHECK: @llvm.lifetime.start.p0i +// AMDGIZ: @llvm.lifetime.start.p5i + helper_no_markers(); +} |