Skip to content

Commit aadb01e

Browse files
committed
more clang format
Signed-off-by: Chris Perkins <[email protected]>
1 parent 4fc329d commit aadb01e

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@ int calledFromKernel(int a) {
4242
#define int128Def __int128
4343
#define int128tDef __int128_t
4444
#define intDef int
45-
45+
4646
//typedefs (late )
4747
typedef const __uint128_t megeType;
4848
typedef const __float128 trickyFloatType;
4949
typedef const __int128 tricky128Type;
5050

5151
//templated type (late)
52-
template<typename T>
53-
T bar(){ return T(); };
52+
template <typename T>
53+
T bar() { return T(); };
5454

5555
//false positive. early incorrectly catches
56-
template<typename t>
56+
template <typename t>
5757
void foo(){};
5858

5959
// template used to specialize a function that contains a lambda that should
@@ -78,7 +78,7 @@ void setup_sycl_operation(const T VA[]) {
7878
// expected-error@+1 {{__float128 is not supported on this target}}
7979
trickyFloatType malFloatTrick = 41;
8080
// expected-error@+1 {{__float128 is not supported on this target}}
81-
floatDef malFloatDef = 44;
81+
floatDef malFloatDef = 44;
8282
// expected-error@+1 {{__float128 is not supported on this target}}
8383
auto whatFloat = malFloat;
8484
// expected-error@+1 {{__float128 is not supported on this target}}
@@ -93,11 +93,11 @@ void setup_sycl_operation(const T VA[]) {
9393

9494
// ======= __int128 Not Allowed in Kernel ==========
9595
// expected-error@+1 {{__int128 is not supported on this target}}
96-
__int128 malIntent = 2;
96+
__int128 malIntent = 2;
9797
// expected-error@+1 {{__int128 is not supported on this target}}
9898
tricky128Type mal128Trick = 2;
9999
// expected-error@+1 {{__int128 is not supported on this target}}
100-
int128Def malIntDef = 9;
100+
int128Def malIntDef = 9;
101101
// expected-error@+1 {{__int128 is not supported on this target}}
102102
auto whatInt128 = malIntent;
103103
// expected-error@+1 {{__int128 is not supported on this target}}
@@ -108,13 +108,13 @@ void setup_sycl_operation(const T VA[]) {
108108
decltype(malIntent) malDeclInt = 2;
109109

110110
// expected-error@+1 {{__int128 is not supported on this target}}
111-
__int128_t malInt128 = 2;
111+
__int128_t malInt128 = 2;
112112
// expected-error@+1 {{unsigned __int128 is not supported on this target}}
113113
__uint128_t malUInt128 = 3;
114114
// expected-error@+1 {{unsigned __int128 is not supported on this target}}
115-
megeType malTypeDefTrick = 4;
115+
megeType malTypeDefTrick = 4;
116116
// expected-error@+1 {{__int128 is not supported on this target}}
117-
int128tDef malInt2Def = 6;
117+
int128tDef malInt2Def = 6;
118118
// expected-error@+1 {{unsigned __int128 is not supported on this target}}
119119
auto whatUInt = malUInt128;
120120
// expected-error@+1 {{__int128 is not supported on this target}}

clang/test/SemaSYCL/sycl-restrict.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ bool isa_B(A *a) {
7070
Check_VLA_Restriction::restriction(7);
7171
int *ip = new int; // expected-error 2{{SYCL kernel cannot allocate storage}}
7272
int i;
73-
int *p3 = new (&i) int; // no error on placement new
73+
int *p3 = new (&i) int; // no error on placement new
7474
OverloadedNewDelete *x = new (struct OverloadedNewDelete); // expected-note 2{{called by 'isa_B'}}
7575
auto y = new struct OverloadedNewDelete[5];
76-
(void)typeid(int); // expected-error {{SYCL kernel cannot use rtti}}
76+
(void)typeid(int); // expected-error {{SYCL kernel cannot use rtti}}
7777
return dynamic_cast<B *>(a) != 0; // expected-error {{SYCL kernel cannot use rtti}}
7878
}
7979

@@ -106,18 +106,18 @@ using myFuncDef = int(int, int);
106106
#define int128Def __int128
107107
#define int128tDef __int128_t
108108
#define intDef int
109-
109+
110110
//typedefs (late )
111111
typedef const __uint128_t megeType;
112112
typedef const __float128 trickyFloatType;
113113
typedef const __int128 tricky128Type;
114114

115115
//templated type (late)
116-
template<typename T>
117-
T bar(){ return T(); };
116+
template <typename T>
117+
T bar() { return T(); };
118118

119119
//false positive. early incorrectly catches
120-
template<typename t>
120+
template <typename t>
121121
void foo(){};
122122

123123
void eh_ok(void) {
@@ -152,8 +152,9 @@ void usage(myFuncDef functionPtr) {
152152
b.f(); // expected-error {{SYCL kernel cannot call a virtual function}}
153153

154154
Check_RTTI_Restriction::kernel1<class kernel_name>([]() { // expected-note 3{{called by 'usage'}}
155-
Check_RTTI_Restriction::A *a;
156-
Check_RTTI_Restriction::isa_B(a); }); // expected-note 6{{called by 'operator()'}}
155+
Check_RTTI_Restriction::A *a;
156+
Check_RTTI_Restriction::isa_B(a);
157+
}); // expected-note 6{{called by 'operator()'}}
157158

158159
// ======= Float128 Not Allowed in Kernel ==========
159160
// expected-error@+1 {{__float128 is not supported on this target}}
@@ -181,15 +182,15 @@ void usage(myFuncDef functionPtr) {
181182
intDef MalArrayDef[0];
182183
// ---- false positive tests. These should not generate any errors.
183184
foo<int[0]>();
184-
std::size_t arrSz = sizeof(int[0]);
185+
std::size_t arrSz = sizeof(int[0]);
185186

186187
// ======= __int128 Not Allowed in Kernel ==========
187188
// expected-error@+1 {{__int128 is not supported on this target}}
188-
__int128 malIntent = 2;
189+
__int128 malIntent = 2;
189190
// expected-error@+1 {{__int128 is not supported on this target}}
190191
tricky128Type mal128Trick = 2;
191192
// expected-error@+1 {{__int128 is not supported on this target}}
192-
int128Def malIntDef = 9;
193+
int128Def malIntDef = 9;
193194
// expected-error@+1 {{__int128 is not supported on this target}}
194195
auto whatInt128 = malIntent;
195196
// expected-error@+1 {{__int128 is not supported on this target}}
@@ -200,13 +201,13 @@ void usage(myFuncDef functionPtr) {
200201
decltype(malIntent) malDeclInt = 2;
201202

202203
// expected-error@+1 {{__int128 is not supported on this target}}
203-
__int128_t malInt128 = 2;
204+
__int128_t malInt128 = 2;
204205
// expected-error@+1 {{unsigned __int128 is not supported on this target}}
205206
__uint128_t malUInt128 = 3;
206207
// expected-error@+1 {{unsigned __int128 is not supported on this target}}
207-
megeType malTypeDefTrick = 4;
208+
megeType malTypeDefTrick = 4;
208209
// expected-error@+1 {{__int128 is not supported on this target}}
209-
int128tDef malInt2Def = 6;
210+
int128tDef malInt2Def = 6;
210211
// expected-error@+1 {{unsigned __int128 is not supported on this target}}
211212
auto whatUInt = malUInt128;
212213
// expected-error@+1 {{__int128 is not supported on this target}}
@@ -220,8 +221,7 @@ void usage(myFuncDef functionPtr) {
220221
std::size_t i128Sz = sizeof(__int128);
221222
foo<__int128>();
222223
std::size_t u128Sz = sizeof(__uint128_t);
223-
foo<__int128_t>();
224-
224+
foo<__int128_t>();
225225
}
226226

227227
namespace ns {
@@ -244,7 +244,7 @@ int use2(a_type ab, a_type *abp) {
244244
return 2;
245245
if (ab.const_stat_member)
246246
return 1;
247-
if (ab.stat_member) // expected-error {{SYCL kernel cannot use a non-const static data variable}}
247+
if (ab.stat_member) // expected-error {{SYCL kernel cannot use a non-const static data variable}}
248248
return 0;
249249
if (abp->stat_member) // expected-error {{SYCL kernel cannot use a non-const static data variable}}
250250
return 0;
@@ -253,7 +253,7 @@ int use2(a_type ab, a_type *abp) {
253253

254254
return another_global; // expected-error {{SYCL kernel cannot use a non-const global variable}}
255255

256-
return ns::glob + // expected-error {{SYCL kernel cannot use a non-const global variable}}
256+
return ns::glob + // expected-error {{SYCL kernel cannot use a non-const global variable}}
257257
AnotherNS::moar_globals; // expected-error {{SYCL kernel cannot use a non-const global variable}}
258258
}
259259

@@ -265,7 +265,7 @@ __attribute__((sycl_kernel)) void kernel_single_task(Func kernelFunc) {
265265
int main() {
266266
// Outside Kernel, these should not generate errors.
267267
a_type ab;
268-
268+
269269
int PassOver[0];
270270
__float128 okFloat = 40;
271271
__int128 fineInt = 20;

0 commit comments

Comments
 (0)