1 // RUN
: %clang_cc1 -cl-std
=CL2.0 -O0 -emit-llvm -o - -triple amdgcn
< %s | FileCheck %s --check-prefixes
=COMMON
,AMDGPU
2 // RUN
: %clang_cc1 -cl-std
=CL2.0 -O0 -emit-llvm -o - -triple
"spir-unknown-unknown" < %s | FileCheck %s --check-prefixes
=COMMON
,SPIR32
,SPIR
3 // RUN
: %clang_cc1 -cl-std
=CL2.0 -O0 -emit-llvm -o - -triple
"spir64-unknown-unknown" < %s | FileCheck %s --check-prefixes
=COMMON
,SPIR64
,SPIR
4 // RUN
: %clang_cc1 -cl-std
=CL2.0 -O0 -debug-info-kind
=limited -gno-column-info -emit-llvm -o - -triple amdgcn
< %s | FileCheck %s --check-prefixes
=CHECK-DEBUG
6 // Check that the enqueue_kernel array temporary is in the entry block to avoid
9 typedef struct
{int a
;} ndrange_t;
11 kernel void test
(int i
) {
12 // AMDGPU-LABEL
: define
{{.
*}} amdgpu_kernel void
@test
13 // SPIR-LABEL
: define
{{.
*}} spir_kernel void
@test
15 // COMMON-LABEL
: entry
:
16 // AMDGPU
: %block_sizes
= alloca
[1 x i64
]
17 // SPIR32
: %block_sizes
= alloca
[1 x i32
]
18 // SPIR64
: %block_sizes
= alloca
[1 x i64
]
19 // COMMON-LABEL
: if.then
:
21 // CHECK-DEBUG
: getelementptr
{{.
*}} %block_sizes
, {{.
*}} !dbg
![[TEMPLOCATION
:[0-
9]+]]
22 // COMMON-LABEL
: if.end
23 queue_t default_queue
;
27 enqueue_kernel
(default_queue, flags
, ndrange
, ^
(local void
*a
) { }, 32);
30 // AMDGPU-LABEL
: define internal void
@__test_block_invoke
(
31 // SPIR-LABEL
: define internal spir_func void
@__test_block_invoke
(
33 // AMDGPU-LABEL
: define internal amdgpu_kernel void
@__test_block_invoke_kernel
34 // SPIR-LABEL
: define spir_kernel void
@__test_block_invoke_kernel
36 // Check that the temporary is scoped to the
`if
`
38 // CHECK-DEBUG
: ![[TESTFILE
:[0-
9]+]] = !DIFile
(filename: "<stdin>"
39 // CHECK-DEBUG
: ![[TESTSCOPE
:[0-
9]+]] = distinct
!DISubprogram
(name: "test", {{.
*}} file
: ![[TESTFILE]]
40 // CHECK-DEBUG: ![[IFSCOPE:[0-9]+]] = distinct !DILexicalBlock(scope: ![[TESTSCOPE]], file: ![[TESTFILE]], line
: 26)
41 // CHECK-DEBUG
: ![[TEMPLOCATION]] = !DILocation(line: 27, scope: ![[IFSCOPE]])