@@ -112,6 +112,7 @@ using myFuncDef = int(int, int);
112
112
113
113
// defines (early and late)
114
114
#define floatDef __float128
115
+ #define longdoubleDef long double
115
116
#define int128Def __int128
116
117
#define int128tDef __int128_t
117
118
#define intDef int
@@ -120,6 +121,7 @@ using myFuncDef = int(int, int);
120
121
typedef __uint128_t megeType;
121
122
typedef __float128 trickyFloatType;
122
123
typedef __int128 tricky128Type;
124
+ typedef long double trickyLDType;
123
125
124
126
// templated return type
125
127
template <typename T>
@@ -137,6 +139,10 @@ using floatalias_t = __float128;
137
139
template <typename ...>
138
140
using int128alias_t = __int128;
139
141
142
+ // alias template
143
+ template <typename ...>
144
+ using ldalias_t = long double ;
145
+
140
146
// false positive. early incorrectly catches
141
147
template <typename t>
142
148
void foo (){};
@@ -152,6 +158,8 @@ struct frankenStruct {
152
158
__float128 scaryQuad;
153
159
// expected-error@+1 {{'__int128' is not supported on this target}}
154
160
__int128 frightenInt;
161
+ // expected-error@+1 {{'long double' is not supported on this target}}
162
+ long double terrorLD;
155
163
};
156
164
157
165
// struct
@@ -160,6 +168,8 @@ struct trickyStruct {
160
168
trickyFloatType trickySructQuad;
161
169
// expected-error@+1 {{'__int128' is not supported on this target}}
162
170
tricky128Type trickyStructInt;
171
+ // expected-error@+1 {{'long double' is not supported on this target}}
172
+ trickyLDType trickyStructLD;
163
173
};
164
174
165
175
// function return type and argument both unsupported
@@ -229,6 +239,32 @@ void usage(myFuncDef functionPtr) {
229
239
foo<__float128>();
230
240
safealias_t <__float128> notAFloat = 3 ;
231
241
242
+ // ======= long double Not Allowed in Kernel ==========
243
+ // expected-error@+1 {{'long double' is not supported on this target}}
244
+ long double malLD = 50 ;
245
+ // expected-error@+1 {{'long double' is not supported on this target}}
246
+ trickyLDType malLDTrick = 51 ;
247
+ // expected-error@+1 {{'long double' is not supported on this target}}
248
+ longdoubleDef malLDDef = 52 ;
249
+ // expected-error@+1 {{'long double' is not supported on this target}}
250
+ auto whatLD = malLD;
251
+ // expected-error@+1 {{'long double' is not supported on this target}}
252
+ auto malAutoLD = bar<long double >();
253
+ // expected-error@+1 {{'long double' is not supported on this target}}
254
+ auto malAutoLD2 = bar<trickyLDType>();
255
+ // expected-error@+1 {{'long double' is not supported on this target}}
256
+ decltype (malLD) malDeclLD = 53 ;
257
+ // expected-error@+1 {{'long double' is not supported on this target}}
258
+ auto malLDTemplateVar = solutionToEverything<long double >;
259
+ // expected-error@+1 {{'long double' is not supported on this target}}
260
+ auto malTrifectaLD = solutionToEverything<trickyLDType>;
261
+ // expected-error@+1 {{'long double' is not supported on this target}}
262
+ ldalias_t <void > aliasedLongDouble = 54 ;
263
+ // ---- false positive tests
264
+ std::size_t someLDSz = sizeof (long double );
265
+ foo<long double >();
266
+ safealias_t <long double > notALD = 55 ;
267
+
232
268
// ======= Zero Length Arrays Not Allowed in Kernel ==========
233
269
// expected-error@+1 {{zero-length arrays are not permitted in C++}}
234
270
int MalArray[0 ];
@@ -282,8 +318,8 @@ void usage(myFuncDef functionPtr) {
282
318
auto malTrifectaInt128T = solutionToEverything<megeType>;
283
319
284
320
// ======= Struct Members Checked =======
285
- frankenStruct strikesFear; // expected-note 3 {{used here}}
286
- trickyStruct incitesPanic; // expected-note 2 {{used here}}
321
+ frankenStruct strikesFear; // expected-note 4 {{used here}}
322
+ trickyStruct incitesPanic; // expected-note 3 {{used here}}
287
323
288
324
// ======= Function Prototype Checked =======
289
325
// expected-error@+1 2{{'__int128' is not supported on this target}}
0 commit comments