Skip to content

Commit 7dd04ea

Browse files
committed
Expand test case and add comments
1 parent 8c94561 commit 7dd04ea

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

clang/test/CodeGenSYCL/accessor_no_alias_property.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown-sycldevice -emit-llvm %s -o - | FileCheck %s
2+
// check that noalias parameter attribute is emitted when no_alias accessor property is used
3+
// CHECK: define {{.*}}spir_kernel void @_ZTSZ4mainE16kernel_function1({{.*}} noalias {{.*}} %_arg_, {{.*}})
24

3-
// CHECK: define {{.*}}spir_kernel void @_ZTSZ4mainE15kernel_function({{.*}} noalias {{.*}} %_arg_, {{.*}})
5+
// check that noalias parameter attribute is NOT emitted when it is not used
6+
// CHECK: define {{.*}}spir_kernel void @_ZTSZ4mainE16kernel_function2{{.*}} !kernel_arg_buffer_location
7+
// CHECK-NOT: define {{.*}}spir_kernel void @_ZTSZ4mainE16kernel_function2({{.*}} noalias {{.*}}
48

59
#include "Inputs/sycl.hpp"
610

@@ -11,9 +15,22 @@ int main() {
1115
cl::sycl::ONEAPI::accessor_property_list<
1216
cl::sycl::ONEAPI::property::no_alias::instance<true>>>
1317
accessorA;
14-
cl::sycl::kernel_single_task<class kernel_function>(
18+
19+
cl::sycl::accessor<int, 1, cl::sycl::access::mode::read_write,
20+
cl::sycl::access::target::global_buffer,
21+
cl::sycl::access::placeholder::false_t,
22+
cl::sycl::ONEAPI::accessor_property_list<
23+
cl::sycl::INTEL::property::buffer_location::instance<1>>>
24+
accessorB;
25+
26+
cl::sycl::kernel_single_task<class kernel_function1>(
1527
[=]() {
1628
accessorA.use();
1729
});
30+
31+
cl::sycl::kernel_single_task<class kernel_function2>(
32+
[=]() {
33+
accessorB.use();
34+
});
1835
return 0;
1936
}

0 commit comments

Comments
 (0)