authorgravatar for justus@klausecker.deJustus Klausecker <justus@klausecker.de> 2025-08-08 20:25:29+02:00
committergravatar for justus@klausecker.deJustus Klausecker <justus@klausecker.de> 2025-08-12 16:33:58+02:00
log4ec421372f1d8dba8a2221d2ea9c774cdbefbe9d
tree542ba6cae0bc0b099c879a00a3c5f9539d1eaca1
parentf0ffe30f2f155616e894c9890c0b22f7a6cfbaab

add remaining undef value tests ; fix `@truncate` undef retval type


2 files changed, 543 insertions(+), 3 deletions(-)

src/Sema/arith.zig+2-2
......@@ -1193,7 +1193,7 @@ pub fn truncate(
11931193) CompileError!Value {
11941194 const pt = sema.pt;
11951195 const zcu = pt.zcu;
1196 if (val.isUndef(zcu)) return val;
1196 if (val.isUndef(zcu)) return pt.undefValue(dest_ty);
11971197 switch (ty.zigTypeTag(zcu)) {
11981198 .int, .comptime_int => return intTruncate(sema, val, dest_ty, dest_signedness, dest_bits),
11991199 .vector => {
......@@ -1204,7 +1204,7 @@ pub fn truncate(
12041204 for (elem_vals, 0..) |*result_elem, elem_idx| {
12051205 const elem_val = try val.elemValue(pt, elem_idx);
12061206 result_elem.* = if (elem_val.isUndef(zcu))
1207 elem_val.toIntern()
1207 (try pt.undefValue(dest_elem_ty)).toIntern()
12081208 else
12091209 (try intTruncate(
12101210 sema,
test/cases/compile_errors/undef_arith_returns_undef.zig+541-1
......@@ -178,6 +178,104 @@ inline fn testIntWithValue(comptime Int: type, x: Int) void {
178178 @compileLog(V{ x, u } *| V{ u, u }); // undef
179179 @compileLog(V{ u, x } *| V{ u, u }); // undef
180180 @compileLog(V{ u, u } *| V{ u, u }); // undef
181
182 // Saturating shift
183
184 if (@typeInfo(Int).int.signedness == .unsigned) {
185 @compileLog(x <<| u); // undef
186 @compileLog(u <<| x); // undef
187
188 @compileLog(V{ x, u } <<| V{ x, x }); // { 24, undef }
189 @compileLog(V{ u, x } <<| V{ x, x }); // { undef, 24 }
190 @compileLog(V{ u, u } <<| V{ x, x }); // undef
191
192 @compileLog(V{ x, x } <<| V{ x, u }); // { 24, undef }
193 @compileLog(V{ x, u } <<| V{ x, u }); // { 24, undef }
194 @compileLog(V{ u, x } <<| V{ x, u }); // undef
195 @compileLog(V{ u, u } <<| V{ x, u }); // undef
196
197 @compileLog(V{ x, x } <<| V{ u, x }); // { undef, 24 }
198 @compileLog(V{ x, u } <<| V{ u, x }); // undef
199 @compileLog(V{ u, x } <<| V{ u, x }); // { undef, 24 }
200 @compileLog(V{ u, u } <<| V{ u, x }); // undef
201
202 @compileLog(V{ x, x } <<| V{ u, u }); // undef
203 @compileLog(V{ x, u } <<| V{ u, u }); // undef
204 @compileLog(V{ u, x } <<| V{ u, u }); // undef
205 @compileLog(V{ u, u } <<| V{ u, u }); // undef
206 }
207
208 // Bitwise XOR
209
210 @compileLog(x ^ u); // undef
211 @compileLog(u ^ x); // undef
212
213 @compileLog(V{ x, u } ^ V{ x, x }); // { 0, undef }
214 @compileLog(V{ u, x } ^ V{ x, x }); // { undef, 0 }
215 @compileLog(V{ u, u } ^ V{ x, x }); // undef
216
217 @compileLog(V{ x, x } ^ V{ x, u }); // { 0, undef }
218 @compileLog(V{ x, u } ^ V{ x, u }); // { 0, undef }
219 @compileLog(V{ u, x } ^ V{ x, u }); // undef
220 @compileLog(V{ u, u } ^ V{ x, u }); // undef
221
222 @compileLog(V{ x, x } ^ V{ u, x }); // { undef, 0 }
223 @compileLog(V{ x, u } ^ V{ u, x }); // undef
224 @compileLog(V{ u, x } ^ V{ u, x }); // { undef, 0 }
225 @compileLog(V{ u, u } ^ V{ u, x }); // undef
226
227 @compileLog(V{ x, x } ^ V{ u, u }); // undef
228 @compileLog(V{ x, u } ^ V{ u, u }); // undef
229 @compileLog(V{ u, x } ^ V{ u, u }); // undef
230 @compileLog(V{ u, u } ^ V{ u, u }); // undef
231
232 // Bitwise NOT
233
234 @compileLog(~u); // undef
235 @compileLog(~V{ u, u }); // undef
236
237 if (Int == u8) { // Result depends on integer type
238 @compileLog(~V{ x, u }); // { 252, undef }
239 @compileLog(~V{ u, x }); // { undef, 252 }
240 }
241
242 // Other binary bitwise operations
243
244 @compileLog(u & u); // undef
245 @compileLog(u | u); // undef
246
247 @compileLog(V{ u, u } & V{ u, u }); // undef
248 @compileLog(V{ u, u } | V{ u, u }); // undef
249
250 // Truncate
251
252 if (@typeInfo(Int).int.signedness == .unsigned) {
253 const W = @Vector(2, u1);
254 @compileLog(@as(u1, @truncate(u))); // undef
255 @compileLog(@as(W, @truncate(V{ x, u }))); // { 1, undef }
256 @compileLog(@as(W, @truncate(V{ u, x }))); // { undef, 1 }
257 @compileLog(@as(W, @truncate(V{ u, u }))); // undef
258 }
259
260 // Bit reverse
261
262 @compileLog(@bitReverse(u)); // undef
263 @compileLog(@bitReverse(V{ u, u })); // undef
264
265 if (Int == u8) { // Result depends on integer type
266 @compileLog(@bitReverse(V{ x, u })); // { 192, undef }
267 @compileLog(@bitReverse(V{ u, x })); // { undef, 192 }
268 }
269
270 // Byte swap
271
272 if (Int == u8) { // Result depends on integer type and is illegal for some
273 @compileLog(@byteSwap(u)); // undef
274 @compileLog(@byteSwap(V{ u, u })); // undef
275
276 @compileLog(@byteSwap(V{ x, u })); // { 3, undef }
277 @compileLog(@byteSwap(V{ u, x })); // { undef, 3 }
278 }
181279}
182280
183281inline fn testFloatWithValue(comptime Float: type, x: Float) void {
......@@ -268,7 +366,7 @@ inline fn testFloatWithValue(comptime Float: type, x: Float) void {
268366//
269367// :40:5: error: found compile log statement
270368// :40:5: note: also here (5 times)
271// :189:5: note: also here (5 times)
369// :287:5: note: also here (5 times)
272370//
273371// Compile Log Output:
274372// @as(u8, undefined)
......@@ -375,6 +473,60 @@ inline fn testFloatWithValue(comptime Float: type, x: Float) void {
375473// @as(@Vector(2, u8), undefined)
376474// @as(u8, undefined)
377475// @as(u8, undefined)
476// @as(@Vector(2, u8), .{ 24, undefined })
477// @as(@Vector(2, u8), .{ undefined, 24 })
478// @as(@Vector(2, u8), undefined)
479// @as(@Vector(2, u8), .{ 24, undefined })
480// @as(@Vector(2, u8), .{ 24, undefined })
481// @as(@Vector(2, u8), undefined)
482// @as(@Vector(2, u8), undefined)
483// @as(@Vector(2, u8), .{ undefined, 24 })
484// @as(@Vector(2, u8), undefined)
485// @as(@Vector(2, u8), .{ undefined, 24 })
486// @as(@Vector(2, u8), undefined)
487// @as(@Vector(2, u8), undefined)
488// @as(@Vector(2, u8), undefined)
489// @as(@Vector(2, u8), undefined)
490// @as(@Vector(2, u8), undefined)
491// @as(u8, undefined)
492// @as(u8, undefined)
493// @as(@Vector(2, u8), .{ 0, undefined })
494// @as(@Vector(2, u8), .{ undefined, 0 })
495// @as(@Vector(2, u8), undefined)
496// @as(@Vector(2, u8), .{ 0, undefined })
497// @as(@Vector(2, u8), .{ 0, undefined })
498// @as(@Vector(2, u8), undefined)
499// @as(@Vector(2, u8), undefined)
500// @as(@Vector(2, u8), .{ undefined, 0 })
501// @as(@Vector(2, u8), undefined)
502// @as(@Vector(2, u8), .{ undefined, 0 })
503// @as(@Vector(2, u8), undefined)
504// @as(@Vector(2, u8), undefined)
505// @as(@Vector(2, u8), undefined)
506// @as(@Vector(2, u8), undefined)
507// @as(@Vector(2, u8), undefined)
508// @as(u8, undefined)
509// @as(@Vector(2, u8), undefined)
510// @as(@Vector(2, u8), .{ 252, undefined })
511// @as(@Vector(2, u8), .{ undefined, 252 })
512// @as(u8, undefined)
513// @as(u8, undefined)
514// @as(@Vector(2, u8), undefined)
515// @as(@Vector(2, u8), undefined)
516// @as(u1, undefined)
517// @as(@Vector(2, u1), .{ 1, undefined })
518// @as(@Vector(2, u1), .{ undefined, 1 })
519// @as(@Vector(2, u1), undefined)
520// @as(u8, undefined)
521// @as(@Vector(2, u8), undefined)
522// @as(@Vector(2, u8), .{ 192, undefined })
523// @as(@Vector(2, u8), .{ undefined, 192 })
524// @as(u8, undefined)
525// @as(@Vector(2, u8), undefined)
526// @as(@Vector(2, u8), .{ 3, undefined })
527// @as(@Vector(2, u8), .{ undefined, 3 })
528// @as(u8, undefined)
529// @as(u8, undefined)
378530// @as(@Vector(2, u8), [runtime value])
379531// @as(@Vector(2, u8), [runtime value])
380532// @as(@Vector(2, u8), undefined)
......@@ -475,6 +627,60 @@ inline fn testFloatWithValue(comptime Float: type, x: Float) void {
475627// @as(@Vector(2, u8), undefined)
476628// @as(@Vector(2, u8), undefined)
477629// @as(@Vector(2, u8), undefined)
630// @as(u8, undefined)
631// @as(u8, undefined)
632// @as(@Vector(2, u8), [runtime value])
633// @as(@Vector(2, u8), [runtime value])
634// @as(@Vector(2, u8), undefined)
635// @as(@Vector(2, u8), [runtime value])
636// @as(@Vector(2, u8), [runtime value])
637// @as(@Vector(2, u8), [runtime value])
638// @as(@Vector(2, u8), undefined)
639// @as(@Vector(2, u8), [runtime value])
640// @as(@Vector(2, u8), [runtime value])
641// @as(@Vector(2, u8), [runtime value])
642// @as(@Vector(2, u8), undefined)
643// @as(@Vector(2, u8), undefined)
644// @as(@Vector(2, u8), undefined)
645// @as(@Vector(2, u8), undefined)
646// @as(@Vector(2, u8), undefined)
647// @as(u8, [runtime value])
648// @as(u8, [runtime value])
649// @as(@Vector(2, u8), [runtime value])
650// @as(@Vector(2, u8), [runtime value])
651// @as(@Vector(2, u8), [runtime value])
652// @as(@Vector(2, u8), [runtime value])
653// @as(@Vector(2, u8), [runtime value])
654// @as(@Vector(2, u8), [runtime value])
655// @as(@Vector(2, u8), [runtime value])
656// @as(@Vector(2, u8), [runtime value])
657// @as(@Vector(2, u8), [runtime value])
658// @as(@Vector(2, u8), [runtime value])
659// @as(@Vector(2, u8), [runtime value])
660// @as(@Vector(2, u8), [runtime value])
661// @as(@Vector(2, u8), [runtime value])
662// @as(@Vector(2, u8), [runtime value])
663// @as(@Vector(2, u8), undefined)
664// @as(u8, undefined)
665// @as(@Vector(2, u8), undefined)
666// @as(@Vector(2, u8), [runtime value])
667// @as(@Vector(2, u8), [runtime value])
668// @as(u8, undefined)
669// @as(u8, undefined)
670// @as(@Vector(2, u8), undefined)
671// @as(@Vector(2, u8), undefined)
672// @as(u1, undefined)
673// @as(@Vector(2, u1), [runtime value])
674// @as(@Vector(2, u1), [runtime value])
675// @as(@Vector(2, u1), undefined)
676// @as(u8, undefined)
677// @as(@Vector(2, u8), undefined)
678// @as(@Vector(2, u8), [runtime value])
679// @as(@Vector(2, u8), [runtime value])
680// @as(u8, undefined)
681// @as(@Vector(2, u8), undefined)
682// @as(@Vector(2, u8), [runtime value])
683// @as(@Vector(2, u8), [runtime value])
478684// @as(i8, undefined)
479685// @as(i8, undefined)
480686// @as(@Vector(2, i8), .{ 6, undefined })
......@@ -579,6 +785,31 @@ inline fn testFloatWithValue(comptime Float: type, x: Float) void {
579785// @as(@Vector(2, i8), undefined)
580786// @as(i8, undefined)
581787// @as(i8, undefined)
788// @as(@Vector(2, i8), .{ 0, undefined })
789// @as(@Vector(2, i8), .{ undefined, 0 })
790// @as(@Vector(2, i8), undefined)
791// @as(@Vector(2, i8), .{ 0, undefined })
792// @as(@Vector(2, i8), .{ 0, undefined })
793// @as(@Vector(2, i8), undefined)
794// @as(@Vector(2, i8), undefined)
795// @as(@Vector(2, i8), .{ undefined, 0 })
796// @as(@Vector(2, i8), undefined)
797// @as(@Vector(2, i8), .{ undefined, 0 })
798// @as(@Vector(2, i8), undefined)
799// @as(@Vector(2, i8), undefined)
800// @as(@Vector(2, i8), undefined)
801// @as(@Vector(2, i8), undefined)
802// @as(@Vector(2, i8), undefined)
803// @as(i8, undefined)
804// @as(@Vector(2, i8), undefined)
805// @as(i8, undefined)
806// @as(i8, undefined)
807// @as(@Vector(2, i8), undefined)
808// @as(@Vector(2, i8), undefined)
809// @as(i8, undefined)
810// @as(@Vector(2, i8), undefined)
811// @as(i8, undefined)
812// @as(i8, undefined)
582813// @as(@Vector(2, i8), [runtime value])
583814// @as(@Vector(2, i8), [runtime value])
584815// @as(@Vector(2, i8), undefined)
......@@ -679,6 +910,31 @@ inline fn testFloatWithValue(comptime Float: type, x: Float) void {
679910// @as(@Vector(2, i8), undefined)
680911// @as(@Vector(2, i8), undefined)
681912// @as(@Vector(2, i8), undefined)
913// @as(i8, [runtime value])
914// @as(i8, [runtime value])
915// @as(@Vector(2, i8), [runtime value])
916// @as(@Vector(2, i8), [runtime value])
917// @as(@Vector(2, i8), [runtime value])
918// @as(@Vector(2, i8), [runtime value])
919// @as(@Vector(2, i8), [runtime value])
920// @as(@Vector(2, i8), [runtime value])
921// @as(@Vector(2, i8), [runtime value])
922// @as(@Vector(2, i8), [runtime value])
923// @as(@Vector(2, i8), [runtime value])
924// @as(@Vector(2, i8), [runtime value])
925// @as(@Vector(2, i8), [runtime value])
926// @as(@Vector(2, i8), [runtime value])
927// @as(@Vector(2, i8), [runtime value])
928// @as(@Vector(2, i8), [runtime value])
929// @as(@Vector(2, i8), undefined)
930// @as(i8, undefined)
931// @as(@Vector(2, i8), undefined)
932// @as(i8, undefined)
933// @as(i8, undefined)
934// @as(@Vector(2, i8), undefined)
935// @as(@Vector(2, i8), undefined)
936// @as(i8, undefined)
937// @as(@Vector(2, i8), undefined)
682938// @as(u32, undefined)
683939// @as(u32, undefined)
684940// @as(@Vector(2, u32), .{ 6, undefined })
......@@ -783,6 +1039,69 @@ inline fn testFloatWithValue(comptime Float: type, x: Float) void {
7831039// @as(@Vector(2, u32), undefined)
7841040// @as(u32, undefined)
7851041// @as(u32, undefined)
1042// @as(@Vector(2, u32), .{ 24, undefined })
1043// @as(@Vector(2, u32), .{ undefined, 24 })
1044// @as(@Vector(2, u32), undefined)
1045// @as(@Vector(2, u32), .{ 24, undefined })
1046// @as(@Vector(2, u32), .{ 24, undefined })
1047// @as(@Vector(2, u32), undefined)
1048// @as(@Vector(2, u32), undefined)
1049// @as(@Vector(2, u32), .{ undefined, 24 })
1050// @as(@Vector(2, u32), undefined)
1051// @as(@Vector(2, u32), .{ undefined, 24 })
1052// @as(@Vector(2, u32), undefined)
1053// @as(@Vector(2, u32), undefined)
1054// @as(@Vector(2, u32), undefined)
1055// @as(@Vector(2, u32), undefined)
1056// @as(@Vector(2, u32), undefined)
1057// @as(u32, undefined)
1058// @as(u32, undefined)
1059// @as(@Vector(2, u32), .{ 0, undefined })
1060// @as(@Vector(2, u32), .{ undefined, 0 })
1061// @as(@Vector(2, u32), undefined)
1062// @as(@Vector(2, u32), .{ 0, undefined })
1063// @as(@Vector(2, u32), .{ 0, undefined })
1064// @as(@Vector(2, u32), undefined)
1065// @as(@Vector(2, u32), undefined)
1066// @as(@Vector(2, u32), .{ undefined, 0 })
1067// @as(@Vector(2, u32), undefined)
1068// @as(@Vector(2, u32), .{ undefined, 0 })
1069// @as(@Vector(2, u32), undefined)
1070// @as(@Vector(2, u32), undefined)
1071// @as(@Vector(2, u32), undefined)
1072// @as(@Vector(2, u32), undefined)
1073// @as(@Vector(2, u32), undefined)
1074// @as(u32, undefined)
1075// @as(@Vector(2, u32), undefined)
1076// @as(u32, undefined)
1077// @as(u32, undefined)
1078// @as(@Vector(2, u32), undefined)
1079// @as(@Vector(2, u32), undefined)
1080// @as(u1, undefined)
1081// @as(@Vector(2, u1), .{ 1, undefined })
1082// @as(@Vector(2, u1), .{ undefined, 1 })
1083// @as(@Vector(2, u1), undefined)
1084// @as(u32, undefined)
1085// @as(@Vector(2, u32), undefined)
1086// @as(u32, undefined)
1087// @as(u32, undefined)
1088// @as(@Vector(2, u32), [runtime value])
1089// @as(@Vector(2, u32), [runtime value])
1090// @as(@Vector(2, u32), undefined)
1091// @as(@Vector(2, u32), [runtime value])
1092// @as(@Vector(2, u32), [runtime value])
1093// @as(@Vector(2, u32), [runtime value])
1094// @as(@Vector(2, u32), undefined)
1095// @as(@Vector(2, u32), [runtime value])
1096// @as(@Vector(2, u32), [runtime value])
1097// @as(@Vector(2, u32), [runtime value])
1098// @as(@Vector(2, u32), undefined)
1099// @as(@Vector(2, u32), undefined)
1100// @as(@Vector(2, u32), undefined)
1101// @as(@Vector(2, u32), undefined)
1102// @as(@Vector(2, u32), undefined)
1103// @as(u32, undefined)
1104// @as(u32, undefined)
7861105// @as(@Vector(2, u32), [runtime value])
7871106// @as(@Vector(2, u32), [runtime value])
7881107// @as(@Vector(2, u32), undefined)
......@@ -883,6 +1202,35 @@ inline fn testFloatWithValue(comptime Float: type, x: Float) void {
8831202// @as(@Vector(2, u32), undefined)
8841203// @as(@Vector(2, u32), undefined)
8851204// @as(@Vector(2, u32), undefined)
1205// @as(u32, [runtime value])
1206// @as(u32, [runtime value])
1207// @as(@Vector(2, u32), [runtime value])
1208// @as(@Vector(2, u32), [runtime value])
1209// @as(@Vector(2, u32), [runtime value])
1210// @as(@Vector(2, u32), [runtime value])
1211// @as(@Vector(2, u32), [runtime value])
1212// @as(@Vector(2, u32), [runtime value])
1213// @as(@Vector(2, u32), [runtime value])
1214// @as(@Vector(2, u32), [runtime value])
1215// @as(@Vector(2, u32), [runtime value])
1216// @as(@Vector(2, u32), [runtime value])
1217// @as(@Vector(2, u32), [runtime value])
1218// @as(@Vector(2, u32), [runtime value])
1219// @as(@Vector(2, u32), [runtime value])
1220// @as(@Vector(2, u32), [runtime value])
1221// @as(@Vector(2, u32), undefined)
1222// @as(u32, undefined)
1223// @as(@Vector(2, u32), undefined)
1224// @as(u32, undefined)
1225// @as(u32, undefined)
1226// @as(@Vector(2, u32), undefined)
1227// @as(@Vector(2, u32), undefined)
1228// @as(u1, undefined)
1229// @as(@Vector(2, u1), [runtime value])
1230// @as(@Vector(2, u1), [runtime value])
1231// @as(@Vector(2, u1), undefined)
1232// @as(u32, undefined)
1233// @as(@Vector(2, u32), undefined)
8861234// @as(i32, undefined)
8871235// @as(i32, undefined)
8881236// @as(@Vector(2, i32), .{ 6, undefined })
......@@ -987,6 +1335,31 @@ inline fn testFloatWithValue(comptime Float: type, x: Float) void {
9871335// @as(@Vector(2, i32), undefined)
9881336// @as(i32, undefined)
9891337// @as(i32, undefined)
1338// @as(@Vector(2, i32), .{ 0, undefined })
1339// @as(@Vector(2, i32), .{ undefined, 0 })
1340// @as(@Vector(2, i32), undefined)
1341// @as(@Vector(2, i32), .{ 0, undefined })
1342// @as(@Vector(2, i32), .{ 0, undefined })
1343// @as(@Vector(2, i32), undefined)
1344// @as(@Vector(2, i32), undefined)
1345// @as(@Vector(2, i32), .{ undefined, 0 })
1346// @as(@Vector(2, i32), undefined)
1347// @as(@Vector(2, i32), .{ undefined, 0 })
1348// @as(@Vector(2, i32), undefined)
1349// @as(@Vector(2, i32), undefined)
1350// @as(@Vector(2, i32), undefined)
1351// @as(@Vector(2, i32), undefined)
1352// @as(@Vector(2, i32), undefined)
1353// @as(i32, undefined)
1354// @as(@Vector(2, i32), undefined)
1355// @as(i32, undefined)
1356// @as(i32, undefined)
1357// @as(@Vector(2, i32), undefined)
1358// @as(@Vector(2, i32), undefined)
1359// @as(i32, undefined)
1360// @as(@Vector(2, i32), undefined)
1361// @as(i32, undefined)
1362// @as(i32, undefined)
9901363// @as(@Vector(2, i32), [runtime value])
9911364// @as(@Vector(2, i32), [runtime value])
9921365// @as(@Vector(2, i32), undefined)
......@@ -1087,6 +1460,31 @@ inline fn testFloatWithValue(comptime Float: type, x: Float) void {
10871460// @as(@Vector(2, i32), undefined)
10881461// @as(@Vector(2, i32), undefined)
10891462// @as(@Vector(2, i32), undefined)
1463// @as(i32, [runtime value])
1464// @as(i32, [runtime value])
1465// @as(@Vector(2, i32), [runtime value])
1466// @as(@Vector(2, i32), [runtime value])
1467// @as(@Vector(2, i32), [runtime value])
1468// @as(@Vector(2, i32), [runtime value])
1469// @as(@Vector(2, i32), [runtime value])
1470// @as(@Vector(2, i32), [runtime value])
1471// @as(@Vector(2, i32), [runtime value])
1472// @as(@Vector(2, i32), [runtime value])
1473// @as(@Vector(2, i32), [runtime value])
1474// @as(@Vector(2, i32), [runtime value])
1475// @as(@Vector(2, i32), [runtime value])
1476// @as(@Vector(2, i32), [runtime value])
1477// @as(@Vector(2, i32), [runtime value])
1478// @as(@Vector(2, i32), [runtime value])
1479// @as(@Vector(2, i32), undefined)
1480// @as(i32, undefined)
1481// @as(@Vector(2, i32), undefined)
1482// @as(i32, undefined)
1483// @as(i32, undefined)
1484// @as(@Vector(2, i32), undefined)
1485// @as(@Vector(2, i32), undefined)
1486// @as(i32, undefined)
1487// @as(@Vector(2, i32), undefined)
10901488// @as(u500, undefined)
10911489// @as(u500, undefined)
10921490// @as(@Vector(2, u500), .{ 6, undefined })
......@@ -1191,6 +1589,52 @@ inline fn testFloatWithValue(comptime Float: type, x: Float) void {
11911589// @as(@Vector(2, u500), undefined)
11921590// @as(u500, undefined)
11931591// @as(u500, undefined)
1592// @as(@Vector(2, u500), .{ 24, undefined })
1593// @as(@Vector(2, u500), .{ undefined, 24 })
1594// @as(@Vector(2, u500), undefined)
1595// @as(@Vector(2, u500), .{ 24, undefined })
1596// @as(@Vector(2, u500), .{ 24, undefined })
1597// @as(@Vector(2, u500), undefined)
1598// @as(@Vector(2, u500), undefined)
1599// @as(@Vector(2, u500), .{ undefined, 24 })
1600// @as(@Vector(2, u500), undefined)
1601// @as(@Vector(2, u500), .{ undefined, 24 })
1602// @as(@Vector(2, u500), undefined)
1603// @as(@Vector(2, u500), undefined)
1604// @as(@Vector(2, u500), undefined)
1605// @as(@Vector(2, u500), undefined)
1606// @as(@Vector(2, u500), undefined)
1607// @as(u500, undefined)
1608// @as(u500, undefined)
1609// @as(@Vector(2, u500), .{ 0, undefined })
1610// @as(@Vector(2, u500), .{ undefined, 0 })
1611// @as(@Vector(2, u500), undefined)
1612// @as(@Vector(2, u500), .{ 0, undefined })
1613// @as(@Vector(2, u500), .{ 0, undefined })
1614// @as(@Vector(2, u500), undefined)
1615// @as(@Vector(2, u500), undefined)
1616// @as(@Vector(2, u500), .{ undefined, 0 })
1617// @as(@Vector(2, u500), undefined)
1618// @as(@Vector(2, u500), .{ undefined, 0 })
1619// @as(@Vector(2, u500), undefined)
1620// @as(@Vector(2, u500), undefined)
1621// @as(@Vector(2, u500), undefined)
1622// @as(@Vector(2, u500), undefined)
1623// @as(@Vector(2, u500), undefined)
1624// @as(u500, undefined)
1625// @as(@Vector(2, u500), undefined)
1626// @as(u500, undefined)
1627// @as(u500, undefined)
1628// @as(@Vector(2, u500), undefined)
1629// @as(@Vector(2, u500), undefined)
1630// @as(u1, undefined)
1631// @as(@Vector(2, u1), .{ 1, undefined })
1632// @as(@Vector(2, u1), .{ undefined, 1 })
1633// @as(@Vector(2, u1), undefined)
1634// @as(u500, undefined)
1635// @as(@Vector(2, u500), undefined)
1636// @as(u500, undefined)
1637// @as(u500, undefined)
11941638// @as(@Vector(2, u500), [runtime value])
11951639// @as(@Vector(2, u500), [runtime value])
11961640// @as(@Vector(2, u500), undefined)
......@@ -1291,6 +1735,52 @@ inline fn testFloatWithValue(comptime Float: type, x: Float) void {
12911735// @as(@Vector(2, u500), undefined)
12921736// @as(@Vector(2, u500), undefined)
12931737// @as(@Vector(2, u500), undefined)
1738// @as(u500, undefined)
1739// @as(u500, undefined)
1740// @as(@Vector(2, u500), [runtime value])
1741// @as(@Vector(2, u500), [runtime value])
1742// @as(@Vector(2, u500), undefined)
1743// @as(@Vector(2, u500), [runtime value])
1744// @as(@Vector(2, u500), [runtime value])
1745// @as(@Vector(2, u500), [runtime value])
1746// @as(@Vector(2, u500), undefined)
1747// @as(@Vector(2, u500), [runtime value])
1748// @as(@Vector(2, u500), [runtime value])
1749// @as(@Vector(2, u500), [runtime value])
1750// @as(@Vector(2, u500), undefined)
1751// @as(@Vector(2, u500), undefined)
1752// @as(@Vector(2, u500), undefined)
1753// @as(@Vector(2, u500), undefined)
1754// @as(@Vector(2, u500), undefined)
1755// @as(u500, [runtime value])
1756// @as(u500, [runtime value])
1757// @as(@Vector(2, u500), [runtime value])
1758// @as(@Vector(2, u500), [runtime value])
1759// @as(@Vector(2, u500), [runtime value])
1760// @as(@Vector(2, u500), [runtime value])
1761// @as(@Vector(2, u500), [runtime value])
1762// @as(@Vector(2, u500), [runtime value])
1763// @as(@Vector(2, u500), [runtime value])
1764// @as(@Vector(2, u500), [runtime value])
1765// @as(@Vector(2, u500), [runtime value])
1766// @as(@Vector(2, u500), [runtime value])
1767// @as(@Vector(2, u500), [runtime value])
1768// @as(@Vector(2, u500), [runtime value])
1769// @as(@Vector(2, u500), [runtime value])
1770// @as(@Vector(2, u500), [runtime value])
1771// @as(@Vector(2, u500), undefined)
1772// @as(u500, undefined)
1773// @as(@Vector(2, u500), undefined)
1774// @as(u500, undefined)
1775// @as(u500, undefined)
1776// @as(@Vector(2, u500), undefined)
1777// @as(@Vector(2, u500), undefined)
1778// @as(u1, undefined)
1779// @as(@Vector(2, u1), [runtime value])
1780// @as(@Vector(2, u1), [runtime value])
1781// @as(@Vector(2, u1), undefined)
1782// @as(u500, undefined)
1783// @as(@Vector(2, u500), undefined)
12941784// @as(i500, undefined)
12951785// @as(i500, undefined)
12961786// @as(@Vector(2, i500), .{ 6, undefined })
......@@ -1395,6 +1885,31 @@ inline fn testFloatWithValue(comptime Float: type, x: Float) void {
13951885// @as(@Vector(2, i500), undefined)
13961886// @as(i500, undefined)
13971887// @as(i500, undefined)
1888// @as(@Vector(2, i500), .{ 0, undefined })
1889// @as(@Vector(2, i500), .{ undefined, 0 })
1890// @as(@Vector(2, i500), undefined)
1891// @as(@Vector(2, i500), .{ 0, undefined })
1892// @as(@Vector(2, i500), .{ 0, undefined })
1893// @as(@Vector(2, i500), undefined)
1894// @as(@Vector(2, i500), undefined)
1895// @as(@Vector(2, i500), .{ undefined, 0 })
1896// @as(@Vector(2, i500), undefined)
1897// @as(@Vector(2, i500), .{ undefined, 0 })
1898// @as(@Vector(2, i500), undefined)
1899// @as(@Vector(2, i500), undefined)
1900// @as(@Vector(2, i500), undefined)
1901// @as(@Vector(2, i500), undefined)
1902// @as(@Vector(2, i500), undefined)
1903// @as(i500, undefined)
1904// @as(@Vector(2, i500), undefined)
1905// @as(i500, undefined)
1906// @as(i500, undefined)
1907// @as(@Vector(2, i500), undefined)
1908// @as(@Vector(2, i500), undefined)
1909// @as(i500, undefined)
1910// @as(@Vector(2, i500), undefined)
1911// @as(i500, undefined)
1912// @as(i500, undefined)
13981913// @as(@Vector(2, i500), [runtime value])
13991914// @as(@Vector(2, i500), [runtime value])
14001915// @as(@Vector(2, i500), undefined)
......@@ -1495,6 +2010,31 @@ inline fn testFloatWithValue(comptime Float: type, x: Float) void {
14952010// @as(@Vector(2, i500), undefined)
14962011// @as(@Vector(2, i500), undefined)
14972012// @as(@Vector(2, i500), undefined)
2013// @as(i500, [runtime value])
2014// @as(i500, [runtime value])
2015// @as(@Vector(2, i500), [runtime value])
2016// @as(@Vector(2, i500), [runtime value])
2017// @as(@Vector(2, i500), [runtime value])
2018// @as(@Vector(2, i500), [runtime value])
2019// @as(@Vector(2, i500), [runtime value])
2020// @as(@Vector(2, i500), [runtime value])
2021// @as(@Vector(2, i500), [runtime value])
2022// @as(@Vector(2, i500), [runtime value])
2023// @as(@Vector(2, i500), [runtime value])
2024// @as(@Vector(2, i500), [runtime value])
2025// @as(@Vector(2, i500), [runtime value])
2026// @as(@Vector(2, i500), [runtime value])
2027// @as(@Vector(2, i500), [runtime value])
2028// @as(@Vector(2, i500), [runtime value])
2029// @as(@Vector(2, i500), undefined)
2030// @as(i500, undefined)
2031// @as(@Vector(2, i500), undefined)
2032// @as(i500, undefined)
2033// @as(i500, undefined)
2034// @as(@Vector(2, i500), undefined)
2035// @as(@Vector(2, i500), undefined)
2036// @as(i500, undefined)
2037// @as(@Vector(2, i500), undefined)
14982038// @as(f16, undefined)
14992039// @as(f16, undefined)
15002040// @as(@Vector(2, f16), .{ 6, undefined })