Skip to content

Commit 4a879fe

Browse files
committed
Fix tests after f8d5b49
1 parent c9f983e commit 4a879fe

File tree

4 files changed

+79
-9
lines changed

4 files changed

+79
-9
lines changed

clang/test/SemaSYCL/accessor-type-diagnostics.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
// RUN: %clang_cc1 -fsycl -triple spir64 -fsycl-is-device -verify -fsyntax-only -Wno-sycl-2017-compat %s
1+
// RUN: %clang_cc1 -fsycl -triple spir64 -fsycl-is-device -verify \
2+
// RUN: -aux-triple x86_64-unknown-linux-gnu -fsyntax-only \
3+
// RUN: -Wno-sycl-2017-compat %s
4+
// RUN: %clang_cc1 -fsycl -triple spir64 -fsycl-is-device -verify \
5+
// RUN: -aux-triple x86_64-pc-windows-msvc -fsyntax-only \
6+
// RUN: -Wno-sycl-2017-compat %s
27
//
38
// Ensure SYCL type restrictions are applied to accessors as well.
49

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
// RUN: %clang_cc1 -fsycl -triple spir64 -fsycl-is-device -Wno-sycl-2017-compat -verify -fsyntax-only %s
1+
// RUN: %clang_cc1 -fsycl -triple spir64 -fsycl-is-device \
2+
// RUN: -aux-triple x86_64-unknown-linux-gnu -Wno-sycl-2017-compat \
3+
// RUN: -verify -fsyntax-only %s
4+
// RUN: %clang_cc1 -fsycl -triple spir64 -fsycl-is-device \
5+
// RUN: -aux-triple x86_64-pc-windows-msvc -Wno-sycl-2017-compat \
6+
// RUN: -verify -fsyntax-only %s
27
//
38
// Ensure that the SYCL diagnostics that are typically deferred are correctly emitted.
49

@@ -49,6 +54,9 @@ typedef const __float128 trickyFloatType;
4954
typedef const __int128 tricky128Type;
5055

5156
//templated type (late)
57+
// expected-note@+6 {{'bar<const unsigned __int128>' defined here}}
58+
// expected-note@+5 {{'bar<const __int128>' defined here}}
59+
// expected-note@+4 2{{'bar<__int128>' defined here}}
5260
// expected-note@+3 {{'bar<const __float128>' defined here}}
5361
// expected-note@+2 {{'bar<__float128>' defined here}}
5462
template <typename T>
@@ -98,33 +106,41 @@ void setup_sycl_operation(const T VA[]) {
98106
foo<__float128>();
99107

100108
// ======= __int128 Not Allowed in Kernel ==========
109+
// expected-note@+2 {{'malIntent' defined here}}
101110
// expected-error@+1 {{'__int128' is not supported on this target}}
102111
__int128 malIntent = 2;
103112
// expected-error@+1 {{'__int128' is not supported on this target}}
104113
tricky128Type mal128Trick = 2;
105114
// expected-error@+1 {{'__int128' is not supported on this target}}
106115
int128Def malIntDef = 9;
116+
// expected-error@+2 {{'malIntent' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
107117
// expected-error@+1 {{'__int128' is not supported on this target}}
108118
auto whatInt128 = malIntent;
119+
// expected-error@+2 {{'bar<__int128>' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
109120
// expected-error@+1 {{'__int128' is not supported on this target}}
110121
auto malAutoTemp = bar<__int128>();
122+
// expected-error@+2 {{'bar<const __int128>' requires 128 bit size 'const __int128' type support, but device 'spir64' does not support it}}
111123
// expected-error@+1 {{'__int128' is not supported on this target}}
112124
auto malAutoTemp2 = bar<tricky128Type>();
113125
// expected-error@+1 {{'__int128' is not supported on this target}}
114126
decltype(malIntent) malDeclInt = 2;
115127

116128
// expected-error@+1 {{'__int128' is not supported on this target}}
117129
__int128_t malInt128 = 2;
130+
// expected-note@+2 {{'malUInt128' defined here}}
118131
// expected-error@+1 {{'unsigned __int128' is not supported on this target}}
119132
__uint128_t malUInt128 = 3;
120133
// expected-error@+1 {{'unsigned __int128' is not supported on this target}}
121134
megeType malTypeDefTrick = 4;
122135
// expected-error@+1 {{'__int128' is not supported on this target}}
123136
int128tDef malInt2Def = 6;
137+
// expected-error@+2 {{'malUInt128' requires 128 bit size '__uint128_t' (aka 'unsigned __int128') type support, but device 'spir64' does not support it}}
124138
// expected-error@+1 {{'unsigned __int128' is not supported on this target}}
125139
auto whatUInt = malUInt128;
140+
// expected-error@+2 {{'bar<__int128>' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
126141
// expected-error@+1 {{'__int128' is not supported on this target}}
127142
auto malAutoTemp3 = bar<__int128_t>();
143+
// expected-error@+2 {{'bar<const unsigned __int128>' requires 128 bit size 'const unsigned __int128' type support, but device 'spir64' does not support it}}
128144
// expected-error@+1 {{'unsigned __int128' is not supported on this target}}
129145
auto malAutoTemp4 = bar<megeType>();
130146
// expected-error@+1 {{'__int128' is not supported on this target}}

clang/test/SemaSYCL/int128.cpp

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ typedef __uint128_t BIGTY;
66
template <class T>
77
class Z {
88
public:
9+
// expected-error@+2 3{{'__int128' is not supported on this target}}
910
// expected-note@+1 {{'field' defined here}}
1011
T field;
12+
// expected-error@+2 3{{'__int128' is not supported on this target}}
1113
// expected-note@+1 2{{'field1' defined here}}
1214
__int128 field1;
1315
using BIGTYPE = __int128;
16+
// expected-error@+2 3{{'__int128' is not supported on this target}}
1417
// expected-note@+1 {{'bigfield' defined here}}
1518
BIGTYPE bigfield;
1619
};
@@ -23,18 +26,23 @@ void host_ok(void) {
2326
}
2427

2528
void usage() {
29+
// expected-error@+2 {{'__int128' is not supported on this target}}
2630
// expected-note@+1 3{{'A' defined here}}
2731
__int128 A;
32+
// expected-note@+1 3{{used here}}
2833
Z<__int128> C;
2934
// expected-error@+2 {{'A' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
3035
// expected-error@+1 {{'field1' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
3136
C.field1 = A;
3237
// expected-error@+1 {{'bigfield' requires 128 bit size 'Z::BIGTYPE' (aka '__int128') type support, but device 'spir64' does not support it}}
3338
C.bigfield += 1.0;
3439

40+
// expected-note@+2 1{{used here}}
3541
// expected-error@+1 {{'A' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
3642
auto foo1 = [=]() {
43+
// expected-error@+1 {{'__int128' is not supported on this target}}
3744
__int128 AA;
45+
// expected-error@+3 2{{'__int128' is not supported on this target}}
3846
// expected-note@+2 {{'BB' defined here}}
3947
// expected-error@+1 {{'A' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
4048
auto BB = A;
@@ -54,17 +62,18 @@ void foo2(){};
5462
// expected-note@+1 2{{'foo' defined here}}
5563
__int128 foo(__int128 P) { return P; }
5664

57-
void foobar() {
65+
int foobar() {
5866
// expected-note@+1 {{'operator __int128' defined here}}
59-
struct X { operator __int128() const; } x;
67+
struct X { operator __int128() const{return 0;}; } x;
6068
bool a = false;
6169
// expected-error@+1 {{'operator __int128' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
6270
a = x == __int128(0);
71+
return a;
6372
}
6473

6574
template <typename Name, typename Func>
6675
__attribute__((sycl_kernel)) void kernel(Func kernelFunc) {
67-
// expected-note@+1 6{{called by 'kernel}}
76+
// expected-note@+1 7{{called by 'kernel}}
6877
kernelFunc();
6978
}
7079

@@ -73,9 +82,12 @@ int main() {
7382
__int128 CapturedToDevice = 1;
7483
host_ok();
7584
kernel<class variables>([=]() {
85+
// expected-error@+1 {{'__int128' is not supported on this target}}
7686
decltype(CapturedToDevice) D;
87+
// expected-error@+2 {{'__int128' is not supported on this target}}
7788
// expected-error@+1 {{'CapturedToDevice' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
7889
auto C = CapturedToDevice;
90+
// expected-note@+1 3{{used here}}
7991
Z<__int128> S;
8092
// expected-error@+1 {{'field1' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
8193
S.field1 += 1;
@@ -86,17 +98,20 @@ int main() {
8698
kernel<class functions>([=]() {
8799
// expected-note@+1 2{{called by 'operator()'}}
88100
usage();
101+
// expected-error@+2 {{'unsigned __int128' is not supported on this target}}
89102
// expected-note@+1 {{'BBBB' defined here}}
90103
BIGTY BBBB;
104+
// expected-error@+4 {{'__int128' is not supported on this target}}
91105
// expected-error@+3 {{'BBBB' requires 128 bit size 'BIGTY' (aka 'unsigned __int128') type support, but device 'spir64' does not support it}}
92106
// expected-error@+2 2{{'foo' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
93107
// expected-note@+1 1{{called by 'operator()'}}
94108
auto A = foo(BBBB);
95109
// expected-note@+1 {{called by 'operator()'}}
96-
foobar();
110+
auto i = foobar();
97111
});
98112

99113
kernel<class ok>([=]() {
114+
// expected-note@+1 3{{used here}}
100115
Z<__int128> S;
101116
foo2<__int128>();
102117
auto A = sizeof(CapturedToDevice);

clang/test/SemaSYCL/sycl-restrict.cpp

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1-
// RUN: %clang_cc1 -fsycl -fsycl-is-device -fcxx-exceptions -triple spir64 -Wno-return-type -verify -Wno-sycl-2017-compat -fsyntax-only -std=c++17 %s
2-
// RUN: %clang_cc1 -fsycl -fsycl-is-device -fcxx-exceptions -triple spir64 -fno-sycl-allow-func-ptr -Wno-return-type -verify -Wno-sycl-2017-compat -fsyntax-only -std=c++17 %s
3-
// RUN: %clang_cc1 -fsycl -fsycl-is-device -fcxx-exceptions -triple spir64 -DALLOW_FP=1 -fsycl-allow-func-ptr -Wno-return-type -verify -Wno-sycl-2017-compat -fsyntax-only -std=c++17 %s
1+
// RUN: %clang_cc1 -fsycl -fsycl-is-device -fcxx-exceptions -triple spir64 \
2+
// RUN: -aux-triple x86_64-unknown-linux-gnu -Wno-return-type -verify \
3+
// RUN: -Wno-sycl-2017-compat -fsyntax-only -std=c++17 %s
4+
// RUN: %clang_cc1 -fsycl -fsycl-is-device -fcxx-exceptions -triple spir64 \
5+
// RUN: -aux-triple x86_64-unknown-linux-gnu -fno-sycl-allow-func-ptr \
6+
// RUN: -Wno-return-type -verify -Wno-sycl-2017-compat -fsyntax-only \
7+
// RUN: -std=c++17 %s
8+
// RUN: %clang_cc1 -fsycl -fsycl-is-device -fcxx-exceptions -triple spir64 \
9+
// RUN: -aux-triple x86_64-unknown-linux-gnu -DALLOW_FP=1 \
10+
// RUN: -fsycl-allow-func-ptr -Wno-return-type -verify \
11+
// RUN: -Wno-sycl-2017-compat -fsyntax-only -std=c++17 %s
412

513
namespace std {
614
class type_info;
@@ -123,11 +131,17 @@ typedef __int128 tricky128Type;
123131
typedef long double trickyLDType;
124132

125133
//templated return type
134+
// expected-note@+5 2{{'bar<long double>' defined here}}
135+
// expected-note@+4 {{'bar<unsigned __int128>' defined here}}
136+
// expected-note@+3 3{{'bar<__int128>' defined here}}
126137
// expected-note@+2 2{{'bar<__float128>' defined here}}
127138
template <typename T>
128139
T bar() { return T(); };
129140

130141
//variable template
142+
// expected-note@+5 2{{'solutionToEverything<long double>' defined here}}
143+
// expected-note@+4 {{solutionToEverything<unsigned __int128>' defined here}}
144+
// expected-note@+3 3{{solutionToEverything<__int128>' defined here}}
131145
// expected-note@+2 2{{solutionToEverything<__float128>' defined here}}
132146
template <class T>
133147
constexpr T solutionToEverything = T(42);
@@ -174,6 +188,7 @@ struct trickyStruct {
174188
};
175189

176190
// function return type and argument both unsupported
191+
// expected-note@+1 2{{'commitInfraction' defined here}}
177192
__int128 commitInfraction(__int128 a) {
178193
return 0;
179194
}
@@ -247,22 +262,28 @@ void usage(myFuncDef functionPtr) {
247262
safealias_t<__float128> notAFloat = 3;
248263

249264
// ======= long double Not Allowed in Kernel ==========
265+
// expected-note@+2 {{'malLD' defined here}}
250266
// expected-error@+1 {{'long double' is not supported on this target}}
251267
long double malLD = 50;
252268
// expected-error@+1 {{'long double' is not supported on this target}}
253269
trickyLDType malLDTrick = 51;
254270
// expected-error@+1 {{'long double' is not supported on this target}}
255271
longdoubleDef malLDDef = 52;
272+
// expected-error@+2 {{'malLD' requires 128 bit size 'long double' type support, but device 'spir64' does not support it}}
256273
// expected-error@+1 {{'long double' is not supported on this target}}
257274
auto whatLD = malLD;
275+
// expected-error@+2 {{'bar<long double>' requires 128 bit size 'long double' type support, but device 'spir64' does not support it}}
258276
// expected-error@+1 {{'long double' is not supported on this target}}
259277
auto malAutoLD = bar<long double>();
278+
// expected-error@+2{{'bar<long double>' requires 128 bit size 'long double' type support, but device 'spir64' does not support it}}
260279
// expected-error@+1 {{'long double' is not supported on this target}}
261280
auto malAutoLD2 = bar<trickyLDType>();
262281
// expected-error@+1 {{'long double' is not supported on this target}}
263282
decltype(malLD) malDeclLD = 53;
283+
// expected-error@+2 {{'solutionToEverything<long double>' requires 128 bit size 'const long double' type support, but device 'spir64' does not support it}}
264284
// expected-error@+1 {{'long double' is not supported on this target}}
265285
auto malLDTemplateVar = solutionToEverything<long double>;
286+
// expected-error@+2 {{'solutionToEverything<long double>' requires 128 bit size 'const long double' type support, but device 'spir64' does not support it}}
266287
// expected-error@+1 {{'long double' is not supported on this target}}
267288
auto malTrifectaLD = solutionToEverything<trickyLDType>;
268289
// expected-error@+1 {{'long double' is not supported on this target}}
@@ -282,45 +303,57 @@ void usage(myFuncDef functionPtr) {
282303
std::size_t arrSz = sizeof(int[0]);
283304

284305
// ======= __int128 Not Allowed in Kernel ==========
306+
// expected-note@+2 {{'malIntent' defined here}}
285307
// expected-error@+1 {{'__int128' is not supported on this target}}
286308
__int128 malIntent = 2;
287309
// expected-error@+1 {{'__int128' is not supported on this target}}
288310
tricky128Type mal128Trick = 2;
289311
// expected-error@+1 {{'__int128' is not supported on this target}}
290312
int128Def malIntDef = 9;
313+
// expected-error@+2 {{'malIntent' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
291314
// expected-error@+1 {{'__int128' is not supported on this target}}
292315
auto whatInt128 = malIntent;
316+
// expected-error@+2 {{'bar<__int128>' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
293317
// expected-error@+1 {{'__int128' is not supported on this target}}
294318
auto malAutoTemp = bar<__int128>();
319+
// expected-error@+2 {{'bar<__int128>' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
295320
// expected-error@+1 {{'__int128' is not supported on this target}}
296321
auto malAutoTemp2 = bar<tricky128Type>();
297322
// expected-error@+1 {{'__int128' is not supported on this target}}
298323
decltype(malIntent) malDeclInt = 2;
324+
// expected-error@+2 {{'solutionToEverything<__int128>' requires 128 bit size 'const __int128' type support, but device 'spir64' does not support it}}
299325
// expected-error@+1 {{'__int128' is not supported on this target}}
300326
auto mal128TemplateVar = solutionToEverything<__int128>;
327+
// expected-error@+2 {{'solutionToEverything<__int128>' requires 128 bit size 'const __int128' type support, but device 'spir64' does not support it}}
301328
// expected-error@+1 {{'__int128' is not supported on this target}}
302329
auto malTrifecta128 = solutionToEverything<tricky128Type>;
303330
// expected-error@+1 {{'__int128' is not supported on this target}}
304331
int128alias_t<void> aliasedInt128 = 79;
305332

306333
// expected-error@+1 {{'__int128' is not supported on this target}}
307334
__int128_t malInt128 = 2;
335+
// expected-note@+2 {{'malUInt128' defined here}}
308336
// expected-error@+1 {{'unsigned __int128' is not supported on this target}}
309337
__uint128_t malUInt128 = 3;
310338
// expected-error@+1 {{'unsigned __int128' is not supported on this target}}
311339
megeType malTypeDefTrick = 4;
312340
// expected-error@+1 {{'__int128' is not supported on this target}}
313341
int128tDef malInt2Def = 6;
342+
// expected-error@+2 {{'malUInt128' requires 128 bit size '__uint128_t' (aka 'unsigned __int128') type support, but device 'spir64' does not support it}}
314343
// expected-error@+1 {{'unsigned __int128' is not supported on this target}}
315344
auto whatUInt = malUInt128;
345+
// expected-error@+2 {{'bar<__int128>' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
316346
// expected-error@+1 {{'__int128' is not supported on this target}}
317347
auto malAutoTemp3 = bar<__int128_t>();
348+
// expected-error@+2 {{'bar<unsigned __int128>' requires 128 bit size 'unsigned __int128' type support, but device 'spir64' does not support it}}
318349
// expected-error@+1 {{'unsigned __int128' is not supported on this target}}
319350
auto malAutoTemp4 = bar<megeType>();
320351
// expected-error@+1 {{'__int128' is not supported on this target}}
321352
decltype(malInt128) malDeclInt128 = 5;
353+
// expected-error@+2 {{'solutionToEverything<__int128>' requires 128 bit size 'const __int128' type support, but device 'spir64' does not support it}}
322354
// expected-error@+1 {{'__int128' is not supported on this target}}
323355
auto mal128TIntTemplateVar = solutionToEverything<__int128_t>;
356+
// expected-error@+2 {{'solutionToEverything<unsigned __int128>' requires 128 bit size 'const unsigned __int128' type support, but device 'spir64' does not support it}}
324357
// expected-error@+1 {{'unsigned __int128' is not supported on this target}}
325358
auto malTrifectaInt128T = solutionToEverything<megeType>;
326359

@@ -329,6 +362,7 @@ void usage(myFuncDef functionPtr) {
329362
trickyStruct incitesPanic; // expected-note 3{{used here}}
330363

331364
// ======= Function Prototype Checked =======
365+
// expected-error@+2 2{{'commitInfraction' requires 128 bit size '__int128' type support, but device 'spir64' does not support it}}
332366
// expected-error@+1 2{{'__int128' is not supported on this target}}
333367
auto notAllowed = &commitInfraction;
334368

0 commit comments

Comments
 (0)