1
- // RUN: %clangxx -fsycl -fsycl-id-queries-fit-in-int -O0 -c -S -emit-llvm -o %t.ll %s
1
+ // RUN: %clangxx -fsycl-device-only -fsycl-id-queries-fit-in-int -fno-sycl-early-optimizations -S -o %t.ll %s
2
2
// RUN: FileCheck %s --input-file %t.ll
3
3
4
4
#include < CL/sycl.hpp>
5
5
6
6
using namespace sycl ;
7
7
8
- // CHECK: define dso_local i32 @main() {{.*}} {
9
- int main () {
10
- item<1 , true > TestItem = detail::Builder::createItem<1 , true >({3 }, {2 }, {1 });
8
+ // CHECK: define {{.*}}dso_local spir_func void @{{.*}}testItem{{.*}}(%"class.{{.*}}item"*{{.*}}%TestItem)
9
+ SYCL_EXTERNAL void testItem (item<1 > TestItem) {
11
10
// CHECK: call void @llvm.assume(i1 {{.*}})
12
11
int Id = TestItem.get_id (0 );
13
12
// CHECK: call void @llvm.assume(i1 {{.*}})
14
13
int Range = TestItem.get_range (0 );
15
14
// CHECK: call void @llvm.assume(i1 {{.*}})
16
15
int LinearId = TestItem.get_linear_id ();
16
+ }
17
17
18
- cl::sycl::nd_item<1 > TestNDItem =
19
- detail::Builder::createNDItem<1 >(detail::Builder::createItem<1 , false >({4 }, {2 }),
20
- detail::Builder::createItem<1 , false >({2 }, {0 }),
21
- detail::Builder::createGroup<1 >({4 }, {2 }, {1 }));
22
-
18
+ // CHECK: define {{.*}}dso_local spir_func void @{{.*}}testNDItem{{.*}}(%"class.{{.*}}nd_item"*{{.*}}%TestNDItem)
19
+ SYCL_EXTERNAL void testNDItem (nd_item<1 > TestNDItem) {
23
20
// CHECK: call void @llvm.assume(i1 {{.*}})
24
21
int GlobalId = TestNDItem.get_global_id (0 );
25
22
// CHECK: call void @llvm.assume(i1 {{.*}})
@@ -39,13 +36,10 @@ int main() {
39
36
// CHECK: call void @llvm.assume(i1 {{.*}})
40
37
int LocalRange = TestNDItem.get_local_range (0 );
41
38
39
+ // CHECK: call void @llvm.assume(i1 {{.*}})
42
40
int GlobalIdConverted = TestNDItem.get_global_id ();
43
41
// CHECK: call void @llvm.assume(i1 {{.*}})
44
42
int LocalIdConverted = TestNDItem.get_local_id ();
45
43
// CHECK: call void @llvm.assume(i1 {{.*}})
46
44
int OffsetConferted = TestNDItem.get_offset ();
47
- // CHECK: call void @llvm.assume(i1 {{.*}})
48
-
49
- return 0 ;
50
45
}
51
- // CHECK: }
0 commit comments