Skip to content

Commit 86a696d

Browse files
committed
Fix tests to work around Windows restriction
1 parent 4fa3fbb commit 86a696d

File tree

3 files changed

+61
-61
lines changed

3 files changed

+61
-61
lines changed

clang/test/SemaSYCL/builtin_sycl_kernel.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,35 @@
66

77
__attribute__((sycl_device))
88
[[__sycl_detail__::add_ir_attributes_function("sycl-nd-range-kernel", 4)]]
9-
void sndrk_free_func(int *ptr, int start, int end) {
9+
void sndrk_free_func1(int *ptr, int start, int end) {
1010
for (int i = start; i <= end; i++)
1111
ptr[i] = start;
1212
}
1313

1414
__attribute__((sycl_device))
1515
[[__sycl_detail__::add_ir_attributes_function("sycl-single-task-kernel", "")]]
16-
void sstk_free_func(int *ptr, int start, int end) {
16+
void sstk_free_func1(int *ptr, int start, int end) {
1717
for (int i = start; i <= end; i++)
1818
ptr[i] = start;
1919
}
2020

2121
template <typename T>
2222
__attribute__((sycl_device))
2323
[[__sycl_detail__::add_ir_attributes_function("sycl-nd-range-kernel", 4)]]
24-
void sndrk_free_func_tmpl(T *ptr) {
24+
void sndrk_free_func_tmpl1(T *ptr) {
2525
for (int i = 0; i <= 7; i++)
2626
ptr[i] = i + 11;
2727
}
2828

2929
__attribute__((sycl_device))
3030
[[__sycl_detail__::add_ir_attributes_function("sycl-nd-range-kernel", 1)]]
31-
void ovl_free_func(int *ptr) {
31+
void ovl_free_func1(int *ptr) {
3232
for (int i = 0; i <= 7; i++)
3333
ptr[i] = i;
3434
}
3535

3636
[[__sycl_detail__::add_ir_attributes_function("sycl-single-task-kernel", 1)]]
37-
void ovl_free_func(int *ptr, int val) {
37+
void ovl_free_func1(int *ptr, int val) {
3838
for (int i = 0; i <= 7; i++)
3939
ptr[i] = i + val;
4040
}
@@ -46,13 +46,13 @@ void foo() {
4646
// expected-error@+1 {{builtin takes one argument}}
4747
bool b1 = __builtin_sycl_is_kernel();
4848
// expected-error@+1 {{builtin takes one argument}}
49-
bool b2 = __builtin_sycl_is_kernel(sndrk_free_func, 3);
49+
bool b2 = __builtin_sycl_is_kernel(sndrk_free_func1, 3);
5050

5151

5252
// The following four are okay.
53-
bool b3 = __builtin_sycl_is_kernel(sndrk_free_func); // Okay
54-
bool b4 = __builtin_sycl_is_kernel(*sndrk_free_func); // Okay
55-
bool b5 = __builtin_sycl_is_kernel(&sndrk_free_func); // Okay
53+
bool b3 = __builtin_sycl_is_kernel(sndrk_free_func1); // Okay
54+
bool b4 = __builtin_sycl_is_kernel(*sndrk_free_func1); // Okay
55+
bool b5 = __builtin_sycl_is_kernel(&sndrk_free_func1); // Okay
5656
bool b6 = __builtin_sycl_is_kernel(func); // Okay
5757

5858
// But the next two are not.
@@ -62,29 +62,29 @@ void foo() {
6262
bool b8 = __builtin_sycl_is_kernel(laterdef);
6363

6464
// Constexpr forms of the valid cases.
65-
constexpr bool b9 = __builtin_sycl_is_kernel(sndrk_free_func); // Okay and true.
65+
constexpr bool b9 = __builtin_sycl_is_kernel(sndrk_free_func1); // Okay and true.
6666
constexpr bool b10 = __builtin_sycl_is_kernel(func); // Okay, but false.
67-
constexpr bool b11 = __builtin_sycl_is_kernel(sstk_free_func); // Okay and true.
68-
constexpr bool b12 = __builtin_sycl_is_kernel(sndrk_free_func); // Okay and true.
67+
constexpr bool b11 = __builtin_sycl_is_kernel(sstk_free_func1); // Okay and true.
68+
constexpr bool b12 = __builtin_sycl_is_kernel(sndrk_free_func1); // Okay and true.
6969

7070
// expected-error@+1 {{constexpr variable 'b13' must be initialized by a constant expression}}
71-
constexpr bool b13 = __builtin_sycl_is_kernel(*sndrk_free_func);
71+
constexpr bool b13 = __builtin_sycl_is_kernel(*sndrk_free_func1);
7272
// expected-error@+1 {{constexpr variable 'b14' must be initialized by a constant expression}}
73-
constexpr bool b14 = __builtin_sycl_is_kernel(&sndrk_free_func);
73+
constexpr bool b14 = __builtin_sycl_is_kernel(&sndrk_free_func1);
7474

7575
// Test with function templates.
7676
// expected-error@+1 {{1st argument must be a function pointer (was '<overloaded function type>')}}
77-
constexpr bool b15 = __builtin_sycl_is_kernel(&sndrk_free_func_tmpl<int>);
77+
constexpr bool b15 = __builtin_sycl_is_kernel(&sndrk_free_func_tmpl1<int>);
7878
// expected-error@+1 {{1st argument must be a function pointer (was '<overloaded function type>')}}
79-
constexpr bool b16 = __builtin_sycl_is_kernel(sndrk_free_func_tmpl<int>);
80-
constexpr bool b17 = __builtin_sycl_is_kernel((void(*)(int *))sndrk_free_func_tmpl<int>); // Okay
79+
constexpr bool b16 = __builtin_sycl_is_kernel(sndrk_free_func_tmpl1<int>);
80+
constexpr bool b17 = __builtin_sycl_is_kernel((void(*)(int *))sndrk_free_func_tmpl1<int>); // Okay
8181

8282

8383
// Test with overloaded functions.
8484
// expected-error@+1 {{1st argument must be a function pointer (was '<overloaded function type>')}}
85-
constexpr bool b18 = __builtin_sycl_is_kernel(ovl_free_func);
86-
constexpr bool b19 = __builtin_sycl_is_kernel((void(*)(int *))ovl_free_func); // Okay
87-
constexpr bool b20 = __builtin_sycl_is_kernel((void(*)(int *, int))ovl_free_func); // Okay
85+
constexpr bool b18 = __builtin_sycl_is_kernel(ovl_free_func1);
86+
constexpr bool b19 = __builtin_sycl_is_kernel((void(*)(int *))ovl_free_func1); // Okay
87+
constexpr bool b20 = __builtin_sycl_is_kernel((void(*)(int *, int))ovl_free_func1); // Okay
8888
}
8989

9090
void laterdef();

clang/test/SemaSYCL/builtin_sycl_nd_range_kernel.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,35 @@
66

77
__attribute__((sycl_device))
88
[[__sycl_detail__::add_ir_attributes_function("sycl-nd-range-kernel", 4)]]
9-
void sndrk_free_func(int *ptr, int start, int end) {
9+
void sndrk_free_func1(int *ptr, int start, int end) {
1010
for (int i = start; i <= end; i++)
1111
ptr[i] = start;
1212
}
1313

1414
__attribute__((sycl_device))
1515
[[__sycl_detail__::add_ir_attributes_function("sycl-single-task-kernel", "")]]
16-
void sstk_free_func(int *ptr, int start, int end) {
16+
void sstk_free_func1(int *ptr, int start, int end) {
1717
for (int i = start; i <= end; i++)
1818
ptr[i] = start;
1919
}
2020

2121
template <typename T>
2222
__attribute__((sycl_device))
2323
[[__sycl_detail__::add_ir_attributes_function("sycl-nd-range-kernel", 4)]]
24-
void sndrk_free_func_tmpl(T *ptr) {
24+
void sndrk_free_func_tmpl1(T *ptr) {
2525
for (int i = 0; i <= 7; i++)
2626
ptr[i] = i + 11;
2727
}
2828

2929
__attribute__((sycl_device))
3030
[[__sycl_detail__::add_ir_attributes_function("sycl-nd-range-kernel", 1)]]
31-
void ovl_free_func(int *ptr) {
31+
void ovl_free_func1(int *ptr) {
3232
for (int i = 0; i <= 7; i++)
3333
ptr[i] = i;
3434
}
3535

3636
[[__sycl_detail__::add_ir_attributes_function("sycl-single-task-kernel", 1)]]
37-
void ovl_free_func(int *ptr, int val) {
37+
void ovl_free_func1(int *ptr, int val) {
3838
for (int i = 0; i <= 7; i++)
3939
ptr[i] = i + val;
4040
}
@@ -46,12 +46,12 @@ void foo() {
4646
// expected-error@+1 {{builtin requires exactly 2 arguments}}
4747
bool b1 = __builtin_sycl_is_nd_range_kernel();
4848
// expected-error@+1 {{builtin requires exactly 2 arguments}}
49-
bool b2 = __builtin_sycl_is_nd_range_kernel(sndrk_free_func);
49+
bool b2 = __builtin_sycl_is_nd_range_kernel(sndrk_free_func1);
5050

5151
// The following four are okay.
52-
bool b3 = __builtin_sycl_is_nd_range_kernel(sndrk_free_func, 4); // Okay
53-
bool b4 = __builtin_sycl_is_nd_range_kernel(*sndrk_free_func, 4); // Okay
54-
bool b5 = __builtin_sycl_is_nd_range_kernel(&sndrk_free_func, 4); // Okay
52+
bool b3 = __builtin_sycl_is_nd_range_kernel(sndrk_free_func1, 4); // Okay
53+
bool b4 = __builtin_sycl_is_nd_range_kernel(*sndrk_free_func1, 4); // Okay
54+
bool b5 = __builtin_sycl_is_nd_range_kernel(&sndrk_free_func1, 4); // Okay
5555
bool b6 = __builtin_sycl_is_nd_range_kernel(func, 8); // Okay
5656

5757
// But the next two are not.
@@ -61,35 +61,35 @@ void foo() {
6161
bool b8 = __builtin_sycl_is_nd_range_kernel(laterdef);
6262

6363
// Constexpr forms of the valid cases.
64-
constexpr bool b9 = __builtin_sycl_is_nd_range_kernel(sndrk_free_func, 4); // Okay and true.
64+
constexpr bool b9 = __builtin_sycl_is_nd_range_kernel(sndrk_free_func1, 4); // Okay and true.
6565
constexpr bool b10 = __builtin_sycl_is_nd_range_kernel(func, 4); // Okay, but false.
66-
constexpr bool b11 = __builtin_sycl_is_nd_range_kernel(sstk_free_func, 4); // Okay, but false.
67-
constexpr bool b12 = __builtin_sycl_is_nd_range_kernel(sndrk_free_func, 8); // Okay, but false.
66+
constexpr bool b11 = __builtin_sycl_is_nd_range_kernel(sstk_free_func1, 4); // Okay, but false.
67+
constexpr bool b12 = __builtin_sycl_is_nd_range_kernel(sndrk_free_func1, 8); // Okay, but false.
6868

6969
// expected-error@+1 {{constexpr variable 'b13' must be initialized by a constant expression}}
70-
constexpr bool b13 = __builtin_sycl_is_nd_range_kernel(*sndrk_free_func, 4); // Okay
70+
constexpr bool b13 = __builtin_sycl_is_nd_range_kernel(*sndrk_free_func1, 4); // Okay
7171
// expected-error@+1 {{constexpr variable 'b14' must be initialized by a constant expression}}
72-
constexpr bool b14 = __builtin_sycl_is_nd_range_kernel(&sndrk_free_func, 4); // Okay
72+
constexpr bool b14 = __builtin_sycl_is_nd_range_kernel(&sndrk_free_func1, 4); // Okay
7373

7474
// Test with function templates.
7575
// expected-error@+1 {{1st argument must be a function pointer (was '<overloaded function type>')}}
76-
constexpr bool b15 = __builtin_sycl_is_nd_range_kernel(&sndrk_free_func_tmpl<int>, 6);
76+
constexpr bool b15 = __builtin_sycl_is_nd_range_kernel(&sndrk_free_func_tmpl1<int>, 6);
7777
// expected-error@+1 {{1st argument must be a function pointer (was '<overloaded function type>')}}
78-
constexpr bool b16 = __builtin_sycl_is_nd_range_kernel(sndrk_free_func_tmpl<int>, 8);
79-
constexpr bool b17 = __builtin_sycl_is_nd_range_kernel((void(*)(int *))sndrk_free_func_tmpl<int>, 12); // Okay
78+
constexpr bool b16 = __builtin_sycl_is_nd_range_kernel(sndrk_free_func_tmpl1<int>, 8);
79+
constexpr bool b17 = __builtin_sycl_is_nd_range_kernel((void(*)(int *))sndrk_free_func_tmpl1<int>, 12); // Okay
8080

8181

8282
// Test with overloaded functions.
8383
// expected-error@+1 {{1st argument must be a function pointer (was '<overloaded function type>')}}
84-
constexpr bool b18 = __builtin_sycl_is_nd_range_kernel(ovl_free_func, 4);
85-
constexpr bool b19 = __builtin_sycl_is_nd_range_kernel((void(*)(int *))ovl_free_func, 2); // Okay
86-
constexpr bool b20 = __builtin_sycl_is_nd_range_kernel((void(*)(int *, int))ovl_free_func, 2); // Okay
84+
constexpr bool b18 = __builtin_sycl_is_nd_range_kernel(ovl_free_func1, 4);
85+
constexpr bool b19 = __builtin_sycl_is_nd_range_kernel((void(*)(int *))ovl_free_func1, 2); // Okay
86+
constexpr bool b20 = __builtin_sycl_is_nd_range_kernel((void(*)(int *, int))ovl_free_func1, 2); // Okay
8787

8888
// Test with invalid dimensions.
8989
// expected-error@+1 {{2nd argument must be a strictly positive value (was -1)}}
90-
bool b21 = __builtin_sycl_is_nd_range_kernel(sndrk_free_func, -1);
90+
bool b21 = __builtin_sycl_is_nd_range_kernel(sndrk_free_func1, -1);
9191
// expected-error@+1 {{2nd argument must be a strictly positive value (was 0)}}
92-
bool b22 = __builtin_sycl_is_nd_range_kernel(sndrk_free_func, 0);
92+
bool b22 = __builtin_sycl_is_nd_range_kernel(sndrk_free_func1, 0);
9393
}
9494

9595
void laterdef();

clang/test/SemaSYCL/builtin_sycl_single_task_kernel.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,36 @@
66

77
__attribute__((sycl_device))
88
[[__sycl_detail__::add_ir_attributes_function("sycl-single-task-kernel", 0)]]
9-
void sstk_free_func(int *ptr, int start, int end) {
9+
void sstk_free_func1(int *ptr, int start, int end) {
1010
for (int i = start; i <= end; i++)
1111
ptr[i] = start;
1212
}
1313

1414
__attribute__((sycl_device))
1515
[[__sycl_detail__::add_ir_attributes_function("sycl-nd-range-kernel", "")]]
16-
void sndrk_free_func(int *ptr, int start, int end) {
16+
void sndrk_free_func1(int *ptr, int start, int end) {
1717
for (int i = start; i <= end; i++)
1818
ptr[i] = start;
1919
}
2020

2121
template <typename T>
2222
__attribute__((sycl_device))
2323
[[__sycl_detail__::add_ir_attributes_function("sycl-single-task-kernel", 4)]]
24-
void sstk_free_func_tmpl(T *ptr) {
24+
void sstk_free_func_tmpl1(T *ptr) {
2525
for (int i = 0; i <= 7; i++)
2626
ptr[i] = i + 11;
2727
}
2828

2929
__attribute__((sycl_device))
3030
[[__sycl_detail__::add_ir_attributes_function("sycl-single-task-kernel", 1)]]
31-
void ovl_free_func(int *ptr) {
31+
void ovl_free_func1(int *ptr) {
3232
for (int i = 0; i <= 7; i++)
3333
ptr[i] = i;
3434
}
3535

3636
__attribute__((sycl_device))
3737
[[__sycl_detail__::add_ir_attributes_function("sycl-nd-range-kernel", 1)]]
38-
void ovl_free_func(int *ptr, int val) {
38+
void ovl_free_func1(int *ptr, int val) {
3939
for (int i = 0; i <= 7; i++)
4040
ptr[i] = i + val;
4141
}
@@ -47,13 +47,13 @@ void foo() {
4747
// expected-error@+1 {{builtin takes one argument}}
4848
bool b1 = __builtin_sycl_is_single_task_kernel();
4949
// expected-error@+1 {{builtin takes one argument}}
50-
bool b2 = __builtin_sycl_is_single_task_kernel(sstk_free_func, 4);
50+
bool b2 = __builtin_sycl_is_single_task_kernel(sstk_free_func1, 4);
5151

5252

5353
// The following four are okay.
54-
bool b3 = __builtin_sycl_is_single_task_kernel(sstk_free_func); // Okay
55-
bool b4 = __builtin_sycl_is_single_task_kernel(*sstk_free_func); // Okay
56-
bool b5 = __builtin_sycl_is_single_task_kernel(&sstk_free_func); // Okay
54+
bool b3 = __builtin_sycl_is_single_task_kernel(sstk_free_func1); // Okay
55+
bool b4 = __builtin_sycl_is_single_task_kernel(*sstk_free_func1); // Okay
56+
bool b5 = __builtin_sycl_is_single_task_kernel(&sstk_free_func1); // Okay
5757
bool b6 = __builtin_sycl_is_single_task_kernel(func); // Okay
5858

5959
// But the next two are not.
@@ -63,28 +63,28 @@ void foo() {
6363
bool b8 = __builtin_sycl_is_single_task_kernel(laterdef);
6464

6565
// Constexpr forms of the valid cases.
66-
constexpr bool b9 = __builtin_sycl_is_single_task_kernel(sstk_free_func); // Okay and true.
66+
constexpr bool b9 = __builtin_sycl_is_single_task_kernel(sstk_free_func1); // Okay and true.
6767
constexpr bool b10 = __builtin_sycl_is_single_task_kernel(func); // Okay, but false.
68-
constexpr bool b11 = __builtin_sycl_is_single_task_kernel(sndrk_free_func); // Okay, but false.
68+
constexpr bool b11 = __builtin_sycl_is_single_task_kernel(sndrk_free_func1); // Okay, but false.
6969

7070
// expected-error@+1 {{constexpr variable 'b12' must be initialized by a constant expression}}
71-
constexpr bool b12 = __builtin_sycl_is_single_task_kernel(*sstk_free_func); // Okay
71+
constexpr bool b12 = __builtin_sycl_is_single_task_kernel(*sstk_free_func1); // Okay
7272
// expected-error@+1 {{constexpr variable 'b13' must be initialized by a constant expression}}
73-
constexpr bool b13 = __builtin_sycl_is_single_task_kernel(&sstk_free_func); // Okay
73+
constexpr bool b13 = __builtin_sycl_is_single_task_kernel(&sstk_free_func1); // Okay
7474

7575
// Test with function templates.
7676
// expected-error@+1 {{1st argument must be a function pointer (was '<overloaded function type>')}}
77-
constexpr bool b14 = __builtin_sycl_is_single_task_kernel(&sstk_free_func_tmpl<int>);
77+
constexpr bool b14 = __builtin_sycl_is_single_task_kernel(&sstk_free_func_tmpl1<int>);
7878
// expected-error@+1 {{1st argument must be a function pointer (was '<overloaded function type>')}}
79-
constexpr bool b15 = __builtin_sycl_is_single_task_kernel(sstk_free_func_tmpl<int>);
80-
constexpr bool b16 = __builtin_sycl_is_single_task_kernel((void(*)(int *))sstk_free_func_tmpl<int>); // Okay
79+
constexpr bool b15 = __builtin_sycl_is_single_task_kernel(sstk_free_func_tmpl1<int>);
80+
constexpr bool b16 = __builtin_sycl_is_single_task_kernel((void(*)(int *))sstk_free_func_tmpl1<int>); // Okay
8181

8282

8383
// Test with overloaded functions.
8484
// expected-error@+1 {{1st argument must be a function pointer (was '<overloaded function type>')}}
85-
constexpr bool b17 = __builtin_sycl_is_single_task_kernel(ovl_free_func);
86-
constexpr bool b18 = __builtin_sycl_is_single_task_kernel((void(*)(int *))ovl_free_func); // Okay
87-
constexpr bool b19 = __builtin_sycl_is_single_task_kernel((void(*)(int *, int))ovl_free_func); // Okay
85+
constexpr bool b17 = __builtin_sycl_is_single_task_kernel(ovl_free_func1);
86+
constexpr bool b18 = __builtin_sycl_is_single_task_kernel((void(*)(int *))ovl_free_func1); // Okay
87+
constexpr bool b19 = __builtin_sycl_is_single_task_kernel((void(*)(int *, int))ovl_free_func1); // Okay
8888
}
8989

9090
void laterdef();

0 commit comments

Comments
 (0)