Skip to content

Commit 55510a9

Browse files
Use markers in header. Update related tests. Make test mangling insensitive
Signed-off-by: Elizabeth Andrews <[email protected]>
1 parent d1e3854 commit 55510a9

13 files changed

+68
-68
lines changed

clang/test/CodeGenSYCL/Inputs/sycl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ class kernel_handler {
297297

298298
#define ATTR_SYCL_KERNEL __attribute__((sycl_kernel))
299299
template <typename KernelName = auto_name, typename KernelType>
300-
ATTR_SYCL_KERNEL void kernel_single_task(const KernelType &kernelFunc) {
300+
ATTR_SYCL_KERNEL void kernel_single_task(const KernelType &kernelFunc) { // #KernelSingleTask
301301
kernelFunc();
302302
}
303303

@@ -307,7 +307,7 @@ ATTR_SYCL_KERNEL void kernel_single_task(const KernelType &kernelFunc, kernel_ha
307307
}
308308

309309
template <typename KernelName = auto_name, typename KernelType>
310-
ATTR_SYCL_KERNEL void kernel_single_task_2017(KernelType kernelFunc) {
310+
ATTR_SYCL_KERNEL void kernel_single_task_2017(KernelType kernelFunc) { // #KernelSingleTask2017
311311
kernelFunc();
312312
}
313313

clang/test/CodeGenSYCL/kernel-by-reference.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ int simple_add(int i) {
1515
int main() {
1616
queue q;
1717
#if defined(SYCL2020)
18-
// expected-warning@Inputs/sycl.hpp:311 {{Passing kernel functions by value is deprecated in SYCL 2020}}
18+
// expected-warning@#KernelSingleTask2017 {{Passing kernel functions by value is deprecated in SYCL 2020}}
1919
// expected-note@+3 {{in instantiation of function template specialization}}
2020
#endif
2121
q.submit([&](handler &h) {
2222
h.single_task_2017<class sycl2017>([]() { simple_add(10); });
2323
});
2424

2525
#if defined(SYCL2017)
26-
// expected-warning@Inputs/sycl.hpp:300 {{Passing of kernel functions by reference is a SYCL 2020 extension}}
26+
// expected-warning@#KernelSingleTask {{Passing of kernel functions by reference is a SYCL 2020 extension}}
2727
// expected-note@+3 {{in instantiation of function template specialization}}
2828
#endif
2929
q.submit([&](handler &h) {

clang/test/CodeGenSYCL/kernel-handler.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ void test(int val) {
2222
});
2323
}
2424

25-
// NONATIVESUPPORT: define dso_local void @"_ZTSZZ4testiENK3$_0clERN2cl4sycl7handlerEE19test_kernel_handler"
25+
// NONATIVESUPPORT: define dso_local void @"{{.*}}test_kernel_handler{{.*}}"
2626
// NONATIVESUPPORT-SAME: (i32 %_arg_, i8* %_arg__specialization_constants_buffer)
27-
// NONATIVESUPPORT: %kh = alloca %"class._ZTSN2cl4sycl14kernel_handlerE.cl::sycl::kernel_handler", align 1
27+
// NONATIVESUPPORT: %kh = alloca %"class.[[MANGLEDCLASS:[a-zA-Z0-9_]+]].cl::sycl::kernel_handler", align 1
2828
// NONATIVESUPPORT: %[[KH:[0-9]+]] = load i8*, i8** %_arg__specialization_constants_buffer.addr, align 8
29-
// NONATIVESUPPORT: call void @_ZN2cl4sycl14kernel_handler38__init_specialization_constants_bufferEPc(%"class._ZTSN2cl4sycl14kernel_handlerE.cl::sycl::kernel_handler"* nonnull dereferenceable(1) %kh, i8* %[[KH]])
30-
// NONATIVESUPPORT: void @"_ZZZ4testiENK3$_0clERN2cl4sycl7handlerEENKUlT_E_clINS1_14kernel_handlerEEEDaS4_"
31-
// NONATIVESUPPORT-SAME: byval(%"class._ZTSN2cl4sycl14kernel_handlerE.cl::sycl::kernel_handler")
29+
// NONATIVESUPPORT: call void @{{.*}}__init_specialization_constants_buffer{{.*}}(%"class.[[MANGLEDCLASS]].cl::sycl::kernel_handler"* nonnull dereferenceable(1) %kh, i8* %[[KH]])
30+
// NONATIVESUPPORT: void @"[[MANGLEDKERNELCALL:[a-zA-Z0-9_$]+]]"
31+
// NONATIVESUPPORT-SAME: byval(%"class.[[MANGLEDCLASS]].cl::sycl::kernel_handler")
3232

33-
// NATIVESUPPORT: define dso_local spir_kernel void @"_ZTSZZ4testiENK3$_0clERN2cl4sycl7handlerEE19test_kernel_handler"
33+
// NATIVESUPPORT: define dso_local spir_kernel void @"{{.*}}test_kernel_handler{{.*}}"
3434
// NATIVESUPPORT-SAME: (i32 %_arg_)
35-
// NATIVESUPPORT: %kh = alloca %"class._ZTSN2cl4sycl14kernel_handlerE.cl::sycl::kernel_handler"
35+
// NATIVESUPPORT: %kh = alloca %"class.[[MANGLEDCLASS:[a-zA-Z0-9_]+]].cl::sycl::kernel_handler"
3636
// NATIVESUPPORT-NOT: __init_specialization_constants_buffer
37-
// NATIVE-SUPPORT: call spir_func void @"_ZZZ4testiENK3$_0clERN2cl4sycl7handlerEENKUlT_E_clINS1_14kernel_handlerEEEDaS4_"
38-
// NATIVE-SUPPORT-SAME: byval(%"class._ZTSN2cl4sycl14kernel_handlerE.cl::sycl::kernel_handler")
37+
// NATIVE-SUPPORT: call spir_func void @"[[MANGLEDKERNELCALL:[a-zA-Z0-9_$]+]]"
38+
// NATIVE-SUPPORT-SAME: byval(%"class.[[MANGLEDCLASS]].cl::sycl::kernel_handler")

clang/test/SemaSYCL/Inputs/sycl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ template <typename Type> struct get_kernel_wrapper_name_t {
228228
#define ATTR_SYCL_KERNEL __attribute__((sycl_kernel))
229229
template <typename KernelName = auto_name, typename KernelType>
230230
ATTR_SYCL_KERNEL void kernel_single_task(const KernelType &kernelFunc) {
231-
kernelFunc();
231+
kernelFunc(); // #KernelSingleTaskKernelFuncCall
232232
}
233233
template <typename KernelName = auto_name, typename KernelType>
234234
ATTR_SYCL_KERNEL void kernel_single_task(const KernelType &kernelFunc, kernel_handler kh) {
@@ -249,7 +249,7 @@ class handler {
249249
void single_task(const KernelType &kernelFunc) {
250250
using NameT = typename get_kernel_name_t<KernelName, KernelType>::name;
251251
#ifdef __SYCL_DEVICE_ONLY__
252-
kernel_single_task<NameT>(kernelFunc);
252+
kernel_single_task<NameT>(kernelFunc); // #KernelSingleTask
253253
#else
254254
kernelFunc();
255255
#endif

clang/test/SemaSYCL/args-size-overflow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ queue q;
1111
using Accessor =
1212
accessor<int, 1, cl::sycl::access::mode::read_write, cl::sycl::access::target::global_buffer>;
1313
#ifdef SPIR64
14-
// expected-warning@Inputs/sycl.hpp:252 {{size of kernel arguments (7994 bytes) may exceed the supported maximum of 2048 bytes on some devices}}
14+
// expected-warning@#KernelSingleTask {{size of kernel arguments (7994 bytes) may exceed the supported maximum of 2048 bytes on some devices}}
1515
#elif SPIR32
16-
// expected-warning@Inputs/sycl.hpp:252 {{size of kernel arguments (7986 bytes) may exceed the supported maximum of 2048 bytes on some devices}}
16+
// expected-warning@#KernelSingleTask {{size of kernel arguments (7986 bytes) may exceed the supported maximum of 2048 bytes on some devices}}
1717
#endif
1818

1919
void use() {

clang/test/SemaSYCL/deferred-diagnostics-aux-builtin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ int main(int argc, char **argv) {
1212
_mm_prefetch("test", 8); // expected-error {{argument value 8 is outside the valid range [0, 7]}}
1313

1414
deviceQueue.submit([&](sycl::handler &h) {
15-
// expected-note@Inputs/sycl.hpp:231 {{called by 'kernel_single_task<AName, (lambda}}
15+
// expected-note@#KernelSingleTaskKernelFuncCall {{called by 'kernel_single_task<AName, (lambda}}
1616
h.single_task<class AName>([]() {
1717
_mm_prefetch("test", 4); // expected-error {{builtin is not supported on this target}}
1818
_mm_prefetch("test", 8); // expected-error {{argument value 8 is outside the valid range [0, 7]}} expected-error {{builtin is not supported on this target}}

clang/test/SemaSYCL/deferred-diagnostics-emit.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ template <typename T>
6464
void setup_sycl_operation(const T VA[]) {
6565

6666
deviceQueue.submit([&](sycl::handler &h) {
67-
// expected-note@Inputs/sycl.hpp:231 {{called by 'kernel_single_task<AName, (lambda}}
67+
// expected-note@#KernelSingleTaskKernelFuncCall {{called by 'kernel_single_task<AName, (lambda}}
6868
h.single_task<class AName>([]() {
6969
// ======= Zero Length Arrays Not Allowed in Kernel ==========
7070
// expected-error@+1 {{zero-length arrays are not permitted in C++}}
@@ -156,7 +156,7 @@ int main(int argc, char **argv) {
156156

157157
// --- direct lambda testing ---
158158
deviceQueue.submit([&](sycl::handler &h) {
159-
// expected-note@Inputs/sycl.hpp:231 2 {{called by 'kernel_single_task<AName, (lambda}}
159+
// expected-note@#KernelSingleTaskKernelFuncCall 2 {{called by 'kernel_single_task<AName, (lambda}}
160160
h.single_task<class AName>([]() {
161161
// expected-error@+1 {{zero-length arrays are not permitted in C++}}
162162
int BadArray[0];

clang/test/SemaSYCL/float128.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ int main() {
7171
__float128 CapturedToDevice = 1;
7272
host_ok();
7373
deviceQueue.submit([&](sycl::handler &h) {
74-
// expected-note@Inputs/sycl.hpp:231 {{called by 'kernel_single_task<variables, (lambda}}
74+
// expected-note@#KernelSingleTaskKernelFuncCall {{called by 'kernel_single_task<variables, (lambda}}
7575
h.single_task<class variables>([=]() {
7676
// expected-error@+1 {{'__float128' is not supported on this target}}
7777
decltype(CapturedToDevice) D;
@@ -88,7 +88,7 @@ int main() {
8888
});
8989

9090
deviceQueue.submit([&](sycl::handler &h) {
91-
// expected-note@Inputs/sycl.hpp:231 4{{called by 'kernel_single_task<functions, (lambda}}
91+
// expected-note@#KernelSingleTaskKernelFuncCall 4{{called by 'kernel_single_task<functions, (lambda}}
9292
h.single_task<class functions>([=]() {
9393
// expected-note@+1 2{{called by 'operator()'}}
9494
usage();
@@ -104,7 +104,7 @@ int main() {
104104
});
105105

106106
deviceQueue.submit([&](sycl::handler &h) {
107-
// expected-note@Inputs/sycl.hpp:231 {{called by 'kernel_single_task<ok, (lambda}}
107+
// expected-note@#KernelSingleTaskKernelFuncCall {{called by 'kernel_single_task<ok, (lambda}}
108108
h.single_task<class ok>([=]() {
109109
// expected-note@+1 3{{used here}}
110110
Z<__float128> S;

clang/test/SemaSYCL/implicit_kernel_type.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ int main() {
2525
queue q;
2626

2727
#if defined(WARN)
28-
// expected-error@Inputs/sycl.hpp:252 {{'InvalidKernelName1' is an invalid kernel name type}}
29-
// expected-note@Inputs/sycl.hpp:252 {{'InvalidKernelName1' should be globally-visible}}
28+
// expected-error@#KernelSingleTask {{'InvalidKernelName1' is an invalid kernel name type}}
29+
// expected-note@#KernelSingleTask {{'InvalidKernelName1' should be globally-visible}}
3030
// expected-note@+8 {{in instantiation of function template specialization}}
3131
#elif defined(ERROR)
32-
// expected-error@Inputs/sycl.hpp:252 {{'InvalidKernelName1' is an invalid kernel name type}}
33-
// expected-note@Inputs/sycl.hpp:252 {{'InvalidKernelName1' should be globally-visible}}
32+
// expected-error@#KernelSingleTask {{'InvalidKernelName1' is an invalid kernel name type}}
33+
// expected-note@#KernelSingleTask {{'InvalidKernelName1' should be globally-visible}}
3434
// expected-note@+4 {{in instantiation of function template specialization}}
3535
#endif
3636
class InvalidKernelName1 {};
@@ -39,9 +39,9 @@ int main() {
3939
});
4040

4141
#if defined(WARN)
42-
// expected-warning@Inputs/sycl.hpp:252 {{SYCL 1.2.1 specification requires an explicit forward declaration for a kernel type name; your program may not be portable}}
42+
// expected-warning@#KernelSingleTask {{SYCL 1.2.1 specification requires an explicit forward declaration for a kernel type name; your program may not be portable}}
4343
#elif defined(ERROR)
44-
// expected-error@Inputs/sycl.hpp:252 {{SYCL 1.2.1 specification requires an explicit forward declaration for a kernel type name; your program may not be portable}}
44+
// expected-error@#KernelSingleTask {{SYCL 1.2.1 specification requires an explicit forward declaration for a kernel type name; your program may not be portable}}
4545
#endif
4646

4747
q.submit([&](handler &h) {
@@ -53,9 +53,9 @@ int main() {
5353
});
5454

5555
#if defined(WARN)
56-
// expected-warning@Inputs/sycl.hpp:252 {{SYCL 1.2.1 specification requires an explicit forward declaration for a kernel type name; your program may not be portable}}
56+
// expected-warning@#KernelSingleTask {{SYCL 1.2.1 specification requires an explicit forward declaration for a kernel type name; your program may not be portable}}
5757
#elif defined(ERROR)
58-
// expected-error@Inputs/sycl.hpp:252 {{SYCL 1.2.1 specification requires an explicit forward declaration for a kernel type name; your program may not be portable}}
58+
// expected-error@#KernelSingleTask {{SYCL 1.2.1 specification requires an explicit forward declaration for a kernel type name; your program may not be portable}}
5959
#endif
6060

6161
q.submit([&](handler &h) {

clang/test/SemaSYCL/int128.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ int main() {
8080
__int128 CapturedToDevice = 1;
8181
host_ok();
8282
deviceQueue.submit([&](sycl::handler &h) {
83-
// expected-note@Inputs/sycl.hpp:231 {{called by 'kernel_single_task<variables, (lambda}}
83+
// expected-note@#KernelSingleTaskKernelFuncCall {{called by 'kernel_single_task<variables, (lambda}}
8484
h.single_task<class variables>([=]() {
8585
// expected-error@+1 {{'__int128' is not supported on this target}}
8686
decltype(CapturedToDevice) D;
@@ -97,7 +97,7 @@ int main() {
9797
});
9898

9999
deviceQueue.submit([&](sycl::handler &h) {
100-
// expected-note@Inputs/sycl.hpp:231 5{{called by 'kernel_single_task<functions, (lambda}}
100+
// expected-note@#KernelSingleTaskKernelFuncCall 5{{called by 'kernel_single_task<functions, (lambda}}
101101
h.single_task<class functions>([=]() {
102102
// expected-note@+1 2{{called by 'operator()'}}
103103
usage();
@@ -115,7 +115,7 @@ int main() {
115115
});
116116

117117
deviceQueue.submit([&](sycl::handler &h) {
118-
// expected-note@Inputs/sycl.hpp:231 {{called by 'kernel_single_task<ok, (lambda}}
118+
// expected-note@#KernelSingleTaskKernelFuncCall {{called by 'kernel_single_task<ok, (lambda}}
119119
h.single_task<class ok>([=]() {
120120
// expected-note@+1 3{{used here}}
121121
Z<__int128> S;

clang/test/SemaSYCL/kernelname-enum.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ int main() {
6767
});
6868

6969
q.submit([&](cl::sycl::handler &cgh) {
70-
// expected-error@Inputs/sycl.hpp:252 {{'dummy_functor_2<val_3>' is an invalid kernel name type}}
71-
// expected-note@Inputs/sycl.hpp:252 {{unscoped enum 'unscoped_enum_no_type_set' requires fixed underlying type}}
70+
// expected-error@#KernelSingleTask {{'dummy_functor_2<val_3>' is an invalid kernel name type}}
71+
// expected-note@#KernelSingleTask {{unscoped enum 'unscoped_enum_no_type_set' requires fixed underlying type}}
7272
// expected-note@+1{{in instantiation of function template specialization}}
7373
cgh.single_task(f2);
7474
});
7575

7676
q.submit([&](cl::sycl::handler &cgh) {
77-
// expected-error@Inputs/sycl.hpp:252 {{'templated_functor<dummy_functor_2>' is an invalid kernel name type}}
78-
// expected-note@Inputs/sycl.hpp:252 {{unscoped enum 'unscoped_enum_no_type_set' requires fixed underlying type}}
77+
// expected-error@#KernelSingleTask {{'templated_functor<dummy_functor_2>' is an invalid kernel name type}}
78+
// expected-note@#KernelSingleTask {{unscoped enum 'unscoped_enum_no_type_set' requires fixed underlying type}}
7979
// expected-note@+1{{in instantiation of function template specialization}}
8080
cgh.single_task(f5);
8181
});

clang/test/SemaSYCL/stdtypes_kernel_type.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,38 +25,38 @@ queue q;
2525
int main() {
2626
#ifdef CHECK_ERROR
2727
q.submit([&](handler &h) {
28-
// expected-error@Inputs/sycl.hpp:252 {{'nullptr_t' is an invalid kernel name type}}
29-
// expected-note@Inputs/sycl.hpp:252 {{type 'nullptr_t' cannot be in the "std" namespace}}
28+
// expected-error@#KernelSingleTask {{'nullptr_t' is an invalid kernel name type}}
29+
// expected-note@#KernelSingleTask {{type 'nullptr_t' cannot be in the "std" namespace}}
3030
// expected-note@+1{{in instantiation of function template specialization}}
3131
h.single_task<std::nullptr_t>([=] {});
3232
});
3333
q.submit([&](handler &h) {
34-
// expected-error@Inputs/sycl.hpp:252 {{'std::T' is an invalid kernel name type}}
35-
// expected-note@Inputs/sycl.hpp:252 {{type 'std::T' cannot be in the "std" namespace}}
34+
// expected-error@#KernelSingleTask {{'std::T' is an invalid kernel name type}}
35+
// expected-note@#KernelSingleTask {{type 'std::T' cannot be in the "std" namespace}}
3636
// expected-note@+1{{in instantiation of function template specialization}}
3737
h.single_task<std::T>([=] {});
3838
});
3939
q.submit([&](handler &h) {
40-
// expected-error@Inputs/sycl.hpp:252 {{'Templated_kernel_name<nullptr_t>' is an invalid kernel name type}}
41-
// expected-note@Inputs/sycl.hpp:252 {{type 'nullptr_t' cannot be in the "std" namespace}}
40+
// expected-error@#KernelSingleTask {{'Templated_kernel_name<nullptr_t>' is an invalid kernel name type}}
41+
// expected-note@#KernelSingleTask {{type 'nullptr_t' cannot be in the "std" namespace}}
4242
// expected-note@+1{{in instantiation of function template specialization}}
4343
h.single_task<Templated_kernel_name<std::nullptr_t>>([=] {});
4444
});
4545
q.submit([&](handler &h) {
46-
// expected-error@Inputs/sycl.hpp:252 {{'Templated_kernel_name<std::U>' is an invalid kernel name type}}
47-
// expected-note@Inputs/sycl.hpp:252 {{type 'std::U' cannot be in the "std" namespace}}
46+
// expected-error@#KernelSingleTask {{'Templated_kernel_name<std::U>' is an invalid kernel name type}}
47+
// expected-note@#KernelSingleTask {{type 'std::U' cannot be in the "std" namespace}}
4848
// expected-note@+1{{in instantiation of function template specialization}}
4949
h.single_task<Templated_kernel_name<std::U>>([=] {});
5050
});
5151
q.submit([&](handler &cgh) {
52-
// expected-error@Inputs/sycl.hpp:252 {{'Templated_kernel_name2<Templated_kernel_name<std::Foo>>' is an invalid kernel name type}}
53-
// expected-note@Inputs/sycl.hpp:252{{type 'std::Foo' cannot be in the "std" namespace}}
52+
// expected-error@#KernelSingleTask {{'Templated_kernel_name2<Templated_kernel_name<std::Foo>>' is an invalid kernel name type}}
53+
// expected-note@#KernelSingleTask{{type 'std::Foo' cannot be in the "std" namespace}}
5454
// expected-note@+1{{in instantiation of function template specialization}}
5555
cgh.single_task<Templated_kernel_name2<Templated_kernel_name<std::Foo>>>([]() {});
5656
});
5757
q.submit([&](handler &cgh) {
58-
// expected-error@Inputs/sycl.hpp:252 {{'TemplParamPack<int, float, nullptr_t, double>' is an invalid kernel name type}}
59-
// expected-note@Inputs/sycl.hpp:252 {{type 'nullptr_t' cannot be in the "std" namespace}}
58+
// expected-error@#KernelSingleTask {{'TemplParamPack<int, float, nullptr_t, double>' is an invalid kernel name type}}
59+
// expected-note@#KernelSingleTask {{type 'nullptr_t' cannot be in the "std" namespace}}
6060
// expected-note@+1{{in instantiation of function template specialization}}
6161
cgh.single_task<TemplParamPack<int, float, std::nullptr_t, double>>([]() {});
6262
});

0 commit comments

Comments
 (0)