authorgravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2026-06-09 21:23:50+03:30
committergravatar for alichraghi@noreply.codeberg.orgAli Cheraghi <alichraghi@noreply.codeberg.org> 2026-06-14 09:11:59+02:00
log9115f8838672021655f473ba44f33dcaf90b8371
treef9978ce08893a58cb61c3a15025b1166cb1a308f
parent88d2961df475806a73af0f2eb4e4076159dc7f61

test: skip failing/crashing behavior tests for spirv backend

tested with `-target spirv64-vulkan` and `-mcpu vulkan_v1_2+float16+variable_pointers+float64+int64`

47 files changed, 284 insertions(+), 2 deletions(-)

test/behavior/abs.zig+1
......@@ -54,6 +54,7 @@ test "@abs signed C ABI integers" {
5454 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
5555 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
5656 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO
57 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
5758
5859 const S = struct {
5960 fn doTheTest() !void {
test/behavior/align.zig+8
......@@ -7,6 +7,8 @@ const assert = std.debug.assert;
77var foo: u8 align(4) = 100;
88
99test "global variable alignment" {
10 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
11
1012 comptime assert(@typeInfo(@TypeOf(&foo)).pointer.attrs.@"align" == 4);
1113 comptime assert(@TypeOf(&foo) == *align(4) u8);
1214 {
......@@ -16,6 +18,8 @@ test "global variable alignment" {
1618}
1719
1820test "large abi alignment of global" {
21 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
22
1923 const S = struct {
2024 var global: @This() = undefined;
2125 x: u64 align(64),
......@@ -51,6 +55,8 @@ test "slicing array of length 1 can not assume runtime index is always zero" {
5155}
5256
5357test "implicitly-aligned pointer is coercible to equivalent explicitly-aligned pointer" {
58 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
59
5460 const A = *u32;
5561 const B = *align(@alignOf(u32)) u32;
5662
......@@ -83,6 +89,8 @@ test "implicitly-aligned pointer is coercible to equivalent explicitly-aligned p
8389}
8490
8591test "implicitly decreasing pointer alignment" {
92 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
93
8694 const a: u32 align(4) = 3;
8795 const b: u32 align(8) = 4;
8896 try expect(addUnaligned(&a, &b) == 7);
test/behavior/array.zig+12
......@@ -7,6 +7,7 @@ const expect = testing.expect;
77const expectEqual = testing.expectEqual;
88
99test "array to slice" {
10 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1011 const a: u32 align(4) = 3;
1112 const b: u32 align(8) = 4;
1213 const a_slice: []align(1) const u32 = @as(*const [1]u32, &a)[0..];
......@@ -21,6 +22,7 @@ test "array to slice" {
2122test "arrays" {
2223 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
2324 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
25 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2426
2527 var array: [5]u32 = undefined;
2628
......@@ -259,6 +261,7 @@ fn doSomeMangling(array: *[4]u8) void {
259261
260262test "implicit cast zero sized array ptr to slice" {
261263 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
264 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
262265
263266 {
264267 var b = "".*;
......@@ -969,6 +972,7 @@ test "runtime index of array of zero-bit values" {
969972}
970973
971974test "@splat array" {
975 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
972976 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
973977 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
974978
......@@ -1036,22 +1040,30 @@ test "@splat zero-length array" {
10361040}
10371041
10381042test "initialize slice with reference to empty array initializer" {
1043 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1044
10391045 const a: []const u8 = &.{};
10401046 comptime assert(a.len == 0);
10411047}
10421048
10431049test "initialize many-pointer with reference to empty array initializer" {
1050 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1051
10441052 const a: [*]const u8 = &.{};
10451053 _ = a; // nothing meaningful to test; points to zero bits
10461054}
10471055
10481056test "initialize sentinel-terminated slice with reference to empty array initializer" {
1057 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1058
10491059 const a: [:0]const u8 = &.{};
10501060 comptime assert(a.len == 0);
10511061 comptime assert(a[0] == 0);
10521062}
10531063
10541064test "initialize sentinel-terminated many-pointer with reference to empty array initializer" {
1065 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1066
10551067 const a: [*:0]const u8 = &.{};
10561068 comptime assert(a[0] == 0);
10571069}
test/behavior/basic.zig+7
......@@ -305,6 +305,7 @@ test "compile time global reinterpret" {
305305}
306306
307307test "cast undefined" {
308 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
308309 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
309310
310311 const array: [100]u8 = undefined;
......@@ -640,6 +641,7 @@ fn emptyFn() void {}
640641
641642const addr1 = @as(*const u8, @ptrCast(&emptyFn));
642643test "comptime cast fn to ptr" {
644 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
643645 const addr2 = @as(*const u8, @ptrCast(&emptyFn));
644646 comptime assert(addr1 == addr2);
645647}
......@@ -918,6 +920,7 @@ test "labeled block with runtime branch forwards its result location type to bre
918920
919921test "try in labeled block doesn't cast to wrong type" {
920922 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
923 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
921924
922925 const S = struct {
923926 a: u32,
......@@ -1278,6 +1281,7 @@ test "@Int returned from block" {
12781281}
12791282
12801283test "comptime variable initialized with addresses of literals" {
1284 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
12811285 comptime var st = .{
12821286 .foo = &1,
12831287 .bar = &2,
......@@ -1327,6 +1331,8 @@ test "proper value is returned from labeled block" {
13271331}
13281332
13291333test "const inferred array of slices" {
1334 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1335
13301336 const T = struct { v: bool };
13311337
13321338 const decls = [_][]const T{
......@@ -1339,6 +1345,7 @@ test "const inferred array of slices" {
13391345
13401346test "var inferred array of slices" {
13411347 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1348 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
13421349
13431350 const T = struct { v: bool };
13441351
test/behavior/bitcast.zig+4
......@@ -162,6 +162,7 @@ test "@bitCast packed structs at runtime and comptime" {
162162 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
163163 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
164164 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
165 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
165166
166167 const Full = packed struct {
167168 number: u16,
......@@ -222,6 +223,7 @@ test "bitcast packed struct to integer and back" {
222223 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
223224 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
224225 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
226 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
225227
226228 const LevelUpMove = packed struct {
227229 move_id: u9,
......@@ -555,6 +557,7 @@ test "@bitCast of extern struct containing pointer" {
555557
556558test "@bitCast of extern struct to float" {
557559 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
560 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
558561
559562 const S = struct {
560563 const S = extern struct {
......@@ -575,6 +578,7 @@ test "@bitCast of extern struct to float" {
575578
576579test "@bitCast of float to extern struct" {
577580 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
581 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
578582
579583 const S = struct {
580584 const S = extern struct {
test/behavior/call.zig+2
......@@ -408,6 +408,7 @@ test "recursive inline call with comptime known argument" {
408408
409409test "inline while with @call" {
410410 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
411 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
411412
412413 const S = struct {
413414 fn inc(a: *u32) void {
......@@ -735,6 +736,7 @@ test "tail call function pointer" {
735736test "tail call with potentially extended types" {
736737 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
737738 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
739 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
738740
739741 if (builtin.zig_backend == .stage2_llvm or builtin.zig_backend == .stage2_c) {
740742 if (builtin.cpu.arch.isMIPS() or builtin.cpu.arch.isPowerPC() or builtin.cpu.arch.isWasm()) {
test/behavior/cast.zig+25
......@@ -103,6 +103,7 @@ test "comptime_int @floatFromInt" {
103103}
104104
105105test "@floatFromInt" {
106 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
106107 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
107108 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
108109 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
......@@ -131,6 +132,7 @@ fn testIntFromFloat(comptime F: type, f: F, comptime I: type, i: I) !void {
131132}
132133
133134test "@intFromFloat > 128 bits" {
135 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
134136 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
135137 if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
136138 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
......@@ -156,6 +158,7 @@ fn testFloatFromInt(comptime I: type, i: I, comptime F: type, expected: F) !void
156158}
157159
158160test "@floatFromInt > 128 bits" {
161 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
159162 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
160163 if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
161164 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
......@@ -216,6 +219,8 @@ test "@floatFromInt(f80)" {
216219}
217220
218221test "type coercion from int to float" {
222 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
223
219224 const check = struct {
220225 // Check that an integer value can be coerced to a float type and
221226 // then converted back to the original value without rounding issues.
......@@ -539,6 +544,8 @@ test "return u8 coercing into ?u32 return type" {
539544}
540545
541546test "cast from ?[*]T to ??[*]T" {
547 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
548
542549 const a: ??[*]u8 = @as(?[*]u8, null);
543550 try expect(a != null and a.? == null);
544551}
......@@ -597,6 +604,7 @@ fn testPeerResolveArrayConstSlice(b: bool) !void {
597604}
598605
599606test "implicitly cast from T to anyerror!?T" {
607 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
600608 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
601609 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
602610
......@@ -622,6 +630,7 @@ fn castToOptionalTypeError(z: i32) !void {
622630}
623631
624632test "implicitly cast from [0]T to anyerror![]T" {
633 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
625634 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
626635
627636 try testCastZeroArrayToErrSliceMut();
......@@ -1420,6 +1429,7 @@ test "comptime float casts" {
14201429}
14211430
14221431test "pointer reinterpret const float to int" {
1432 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
14231433 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
14241434
14251435 // The hex representation is 0x3fe3333333333303.
......@@ -1613,6 +1623,7 @@ fn incrementVoidPtrValue(value: ?*anyopaque) void {
16131623}
16141624
16151625test "implicit cast *[0]T to E![]const u8" {
1626 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
16161627 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
16171628
16181629 var x = @as(anyerror![]const u8, &[0]u8{});
......@@ -1807,6 +1818,7 @@ test "cast compatible optional types" {
18071818}
18081819
18091820test "coerce undefined single-item pointer of array to error union of slice" {
1821 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
18101822 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
18111823
18121824 const a = @as([*]u8, undefined)[0..0];
......@@ -1817,6 +1829,7 @@ test "coerce undefined single-item pointer of array to error union of slice" {
18171829}
18181830
18191831test "pointer to empty struct literal to mutable slice" {
1832 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
18201833 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
18211834
18221835 var x: []i32 = &.{};
......@@ -1970,6 +1983,7 @@ test "peer type resolution forms error union" {
19701983}
19711984
19721985test "@constCast without a result location" {
1986 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
19731987 const x: i32 = 1234;
19741988 const y = @constCast(&x);
19751989 try expect(@TypeOf(y) == *i32);
......@@ -1977,6 +1991,7 @@ test "@constCast without a result location" {
19771991}
19781992
19791993test "@constCast optional" {
1994 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
19801995 const x: u8 = 10;
19811996 const m: ?*const u8 = &x;
19821997 const p = @constCast(m);
......@@ -2053,6 +2068,7 @@ test "peer type resolution: float and comptime-known fixed-width integer" {
20532068}
20542069
20552070test "peer type resolution: float and runtime-known fixed-width integer" {
2071 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
20562072 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
20572073 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
20582074
......@@ -2163,6 +2179,7 @@ test "peer type resolution: array and vector with same child type" {
21632179}
21642180
21652181test "peer type resolution: array with smaller child type and vector with larger child type" {
2182 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
21662183 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
21672184 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
21682185 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
......@@ -2343,6 +2360,7 @@ test "peer type resolution: array and tuple" {
23432360}
23442361
23452362test "peer type resolution: vector and tuple" {
2363 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
23462364 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
23472365 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
23482366 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
......@@ -2734,6 +2752,7 @@ test "cast builtins can wrap result in optional" {
27342752}
27352753
27362754test "cast builtins can wrap result in error union" {
2755 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
27372756 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
27382757 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
27392758
......@@ -2809,6 +2828,7 @@ test "cast builtins can wrap result in error union and optional" {
28092828}
28102829
28112830test "@floatCast on vector" {
2831 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
28122832 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
28132833 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
28142834 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
......@@ -2897,6 +2917,7 @@ test "@intFromPtr on vector" {
28972917}
28982918
28992919test "@floatFromInt on vector" {
2920 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
29002921 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
29012922 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
29022923 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
......@@ -2916,6 +2937,7 @@ test "@floatFromInt on vector" {
29162937}
29172938
29182939test "@intFromFloat on vector" {
2940 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
29192941 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
29202942 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
29212943 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
......@@ -2935,6 +2957,7 @@ test "@intFromFloat on vector" {
29352957}
29362958
29372959test "@intFromBool on vector" {
2960 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
29382961 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
29392962 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
29402963 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
......@@ -3061,6 +3084,7 @@ test "peer type resolution: slice of sentinel-terminated array" {
30613084}
30623085
30633086test "@intFromFloat boundary cases" {
3087 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
30643088 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
30653089
30663090 const S = struct {
......@@ -3092,6 +3116,7 @@ test "@intFromFloat boundary cases" {
30923116}
30933117
30943118test "@intFromFloat vector boundary cases" {
3119 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
30953120 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
30963121 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
30973122
test/behavior/cast_int.zig+4
......@@ -19,6 +19,7 @@ test "@intCast i32 to u7" {
1919}
2020
2121test "coerce i8 to i32 and @intCast back" {
22 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2223 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
2324 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
2425
......@@ -34,6 +35,7 @@ test "coerce i8 to i32 and @intCast back" {
3435}
3536
3637test "coerce non byte-sized integers accross 32bits boundary" {
38 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
3739 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO
3840
3941 {
......@@ -144,6 +146,7 @@ fn testIntCast(comptime S: type, a: S, comptime D: type, expected: D) !void {
144146
145147test "@intCast <= 64 bits" {
146148 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
149 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
147150
148151 try testIntCast(i32, minInt(i32), i64, minInt(i32));
149152 try testIntCast(i32, maxInt(i32), i64, maxInt(i32));
......@@ -170,6 +173,7 @@ test "@intCast <= 64 bits" {
170173test "@intCast > 128 bits" {
171174 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
172175 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
176 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
173177
174178 try testIntCast(u8, 123, u140, 123);
175179 try testIntCast(u64, 1 << 63, u140, 1 << 63);
test/behavior/comptime_memory.zig+4
......@@ -431,6 +431,8 @@ test "type pun @ptrFromInt" {
431431}
432432
433433test "type pun null pointer-like optional" {
434 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
435
434436 const p: ?*u8 = null;
435437 // note that expectEqual hides the bug
436438 try testing.expect(@as(*const ?*i8, @ptrCast(&p)).* == null);
......@@ -553,6 +555,8 @@ test "comptime store of packed struct with void field into array" {
553555}
554556
555557test "comptime store of reinterpreted zero-bit type" {
558 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
559
556560 const S = struct {
557561 fn doTheTest(comptime T: type) void {
558562 comptime var buf: T = undefined;
test/behavior/decl_literals.zig+2
......@@ -49,6 +49,8 @@ test "call decl literal with optional" {
4949}
5050
5151test "call decl literal with pointer" {
52 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
53
5254 const S = struct {
5355 x: u32,
5456 fn init() *const @This() {
test/behavior/defer.zig+2
......@@ -5,6 +5,8 @@ const expectEqual = std.testing.expectEqual;
55const expectError = std.testing.expectError;
66
77test "break and continue inside loop inside defer expression" {
8 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
9
810 testBreakContInDefer(10);
911 comptime testBreakContInDefer(10);
1012}
test/behavior/enum.zig+4
......@@ -26,6 +26,7 @@ const EnumFromIntNumber = enum { Zero, One, Two, Three, Four };
2626
2727test "int to enum" {
2828 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
29 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2930
3031 try testEnumFromIntEval(3);
3132}
......@@ -1059,6 +1060,7 @@ test "tag name with signed enum values" {
10591060test "tag name with large enum values" {
10601061 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
10611062 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1063 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
10621064
10631065 const Kdf = enum(u128) {
10641066 aes_kdf = 0xea4f8ac1080d74bf60448a629af3d9c9,
......@@ -1078,6 +1080,7 @@ test "tag name with large enum values" {
10781080test "@tagName with exotic integer enum types" {
10791081 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
10801082 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1083 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
10811084
10821085 const S = struct {
10831086 fn testEnumSigned(comptime T: type) !void {
......@@ -1280,6 +1283,7 @@ test "tag name functions are unique" {
12801283
12811284test "size of enum with only one tag which has explicit integer tag type" {
12821285 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1286 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
12831287
12841288 const E = enum(u8) { nope = 10 };
12851289 const S0 = struct { e: E };
test/behavior/error.zig+5
......@@ -145,6 +145,8 @@ test "implicit cast to optional to error union to return result loc" {
145145}
146146
147147test "fn returning empty error set can be passed as fn returning any error" {
148 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
149
148150 entry();
149151 comptime entry();
150152}
......@@ -526,6 +528,7 @@ test "function pointer with return type that is error union with payload which i
526528}
527529
528530test "return result loc as peer result loc in inferred error set function" {
531 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
529532 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
530533 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
531534 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
......@@ -557,6 +560,7 @@ test "return result loc as peer result loc in inferred error set function" {
557560}
558561
559562test "error payload type is correctly resolved" {
563 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
560564 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
561565 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
562566
......@@ -1111,6 +1115,7 @@ test "'if' ignores error via local while 'else' ignores error directly" {
11111115}
11121116
11131117test "@errorCast into own inferred error set" {
1118 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
11141119 const static = struct {
11151120 fn foo(b: bool) !void {
11161121 if (b) {
test/behavior/eval.zig+5
......@@ -883,6 +883,8 @@ test "debug variable type resolved through indirect zero-bit types" {
883883}
884884
885885test "const local with comptime init through array init" {
886 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
887
886888 const E1 = enum {
887889 A,
888890 pub fn a() void {}
......@@ -902,6 +904,7 @@ test "const local with comptime init through array init" {
902904}
903905
904906test "closure capture type of runtime-known parameter" {
907 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
905908 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
906909
907910 const S = struct {
......@@ -1158,6 +1161,8 @@ test "repeated value is correctly expanded" {
11581161}
11591162
11601163test "value in if block is comptime-known" {
1164 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1165
11611166 const first = blk: {
11621167 const s = if (false) "a" else "b";
11631168 break :blk "foo" ++ s;
test/behavior/floatop.zig+1
......@@ -1546,6 +1546,7 @@ fn testNeg(comptime T: type) !void {
15461546
15471547test "negate f80" {
15481548 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
1549 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
15491550
15501551 var f: f80 = 0.0;
15511552 const a: u80 = @bitCast(f);
test/behavior/fn.zig+5
......@@ -292,6 +292,7 @@ fn voidFun(a: i32, b: void, c: i32, d: void) !void {
292292
293293test "call function with empty string" {
294294 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
295 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
295296
296297 acceptsString("");
297298}
......@@ -405,6 +406,7 @@ test "function with inferred error set but returning no error" {
405406
406407test "import passed byref to function in return type" {
407408 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
409 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
408410
409411 const S = struct {
410412 fn get() @import("std").ArrayList(i32) {
......@@ -440,6 +442,7 @@ test "implicit cast function to function ptr" {
440442test "method call with optional and error union first param" {
441443 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
442444 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
445 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
443446
444447 const S = struct {
445448 x: i32 = 1234,
......@@ -744,6 +747,8 @@ test "coerce generic function making generic parameter concrete" {
744747}
745748
746749test "return undefined pointer from function, directly and by expired local" {
750 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
751
747752 const S = struct {
748753 var global: i32 = 1;
749754
test/behavior/for.zig+2
......@@ -521,6 +521,8 @@ test "return from inline for" {
521521}
522522
523523test "for loop 0 length range" {
524 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
525
524526 const map: []const u8 = &.{};
525527 for (map, 0..map.len) |i, j| {
526528 _ = i;
test/behavior/generics.zig+3
......@@ -439,6 +439,8 @@ test "return type of generic function is function pointer" {
439439}
440440
441441test "coerced function body has inequal value with its uncoerced body" {
442 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
443
442444 const S = struct {
443445 const A = B(i32, c);
444446 fn c() !i32 {
......@@ -521,6 +523,7 @@ test "call generic function with from function called by the generic function" {
521523 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
522524 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
523525 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
526 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
524527
525528 const GET = struct {
526529 key: []const u8,
test/behavior/globals.zig+1
......@@ -42,6 +42,7 @@ test "slices pointing at the same address as global array." {
4242}
4343
4444test "global loads can affect liveness" {
45 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
4546 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest;
4647 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
4748
test/behavior/incomplete_struct_param_tld.zig+1
......@@ -23,6 +23,7 @@ fn foo(a: A) i32 {
2323
2424test "incomplete struct param top level declaration" {
2525 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
26 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2627
2728 const a = A{
2829 .b = B{
test/behavior/inline_switch.zig+3
......@@ -45,6 +45,7 @@ const U = union(E) { a: void, b: u2, c: u3, d: u4 };
4545test "inline switch unions" {
4646 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
4747 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
48 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
4849
4950 var x: U = .a;
5051 _ = &x;
......@@ -138,6 +139,8 @@ test "inline else int all values" {
138139}
139140
140141test "inline switch capture is set when switch operand is comptime known" {
142 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
143
141144 const U2 = union(enum) {
142145 a: u32,
143146 };
test/behavior/math.zig+22
......@@ -1114,6 +1114,7 @@ test "@mulWithOverflow bitsize 128 bits" {
11141114test "@mulWithOverflow > 128 bits" {
11151115 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
11161116 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1117 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
11171118
11181119 try testMulWithOverflow(u140, 0, maxInt(u140), 0, 0);
11191120 try testMulWithOverflow(u140, 1, maxInt(u140), maxInt(u140), 0);
......@@ -1340,6 +1341,7 @@ test "@shlWithOverflow > 64 bits" {
13401341test "@shlWithOverflow > 128 bits" {
13411342 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
13421343 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1344 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
13431345
13441346 try testShlWithOverflow(u140, 1 << 100, 20, 1 << 120, 0);
13451347 try testShlWithOverflow(u140, 1 << 100, 40, 0, 1);
......@@ -1369,6 +1371,7 @@ fn testAnd(comptime T: type, a: T, b: T, expected: T) !void {
13691371test "and > 128 bits" {
13701372 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
13711373 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1374 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
13721375
13731376 try testAnd(u140, (1 << 139) | (1 << 70) | 0xaa, (1 << 139) | (1 << 69) | 0xcc, (1 << 139) | 0x88);
13741377 try testAnd(u140, maxInt(u140), 1 << 100, 1 << 100);
......@@ -1398,6 +1401,7 @@ fn testOr(comptime T: type, a: T, b: T, expected: T) !void {
13981401test "or > 128 bits" {
13991402 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
14001403 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1404 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
14011405
14021406 try testOr(u140, 0, 1 << 139, 1 << 139);
14031407 try testOr(u140, (1 << 70) | 0xa, (1 << 69) | 0x5, (1 << 70) | (1 << 69) | 0xf);
......@@ -1427,6 +1431,7 @@ fn testXor(comptime T: type, a: T, b: T, expected: T) !void {
14271431test "xor > 128 bits" {
14281432 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
14291433 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1434 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
14301435
14311436 try testXor(u140, 0, maxInt(u140), maxInt(u140));
14321437 try testXor(u140, 1 << 139, 1 << 139, 0);
......@@ -1456,6 +1461,7 @@ fn testNot(comptime T: type, a: T, expected: T) !void {
14561461test "not > 128 bits" {
14571462 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
14581463 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1464 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
14591465
14601466 try testNot(u140, 0, maxInt(u140));
14611467 try testNot(u140, maxInt(u140), 0);
......@@ -1485,6 +1491,7 @@ fn testShl(comptime T: type, a: T, b: std.math.Log2Int(T), expected: T) !void {
14851491test "shl > 128 bits" {
14861492 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
14871493 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1494 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
14881495
14891496 try testShl(u140, 1 << 5, 10, 1 << 15);
14901497 try testShl(u140, 3, 138, (1 << 139) | (1 << 138));
......@@ -1514,6 +1521,7 @@ fn testShr(comptime T: type, a: T, b: std.math.Log2Int(T), expected: T) !void {
15141521test "shr > 128 bits" {
15151522 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
15161523 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1524 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
15171525
15181526 try testShr(u140, 1 << 139, 39, 1 << 100);
15191527 try testShr(u140, (1 << 70) | 8, 3, (1 << 67) | 1);
......@@ -1543,6 +1551,7 @@ fn testClz(comptime T: type, a: T, expected: u16) !void {
15431551test "@clz > 128 bits" {
15441552 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
15451553 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1554 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
15461555
15471556 try testClz(u140, 0, 140);
15481557 try testClz(u140, 1 << 139, 0);
......@@ -1572,6 +1581,7 @@ fn testCtz(comptime T: type, a: T, expected: u16) !void {
15721581test "@ctz > 128 bits" {
15731582 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
15741583 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1584 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
15751585
15761586 try testCtz(u140, 0, 140);
15771587 try testCtz(u140, 1 << 139, 139);
......@@ -1601,6 +1611,7 @@ fn testPopCount(comptime T: type, a: T, expected: u16) !void {
16011611test "@popCount > 128 bits" {
16021612 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
16031613 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1614 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
16041615
16051616 try testPopCount(u140, 0, 0);
16061617 try testPopCount(u140, maxInt(u140), 140);
......@@ -1630,6 +1641,7 @@ fn testBitReverse(comptime T: type, a: T, expected: T) !void {
16301641test "@bitReverse > 128 bits" {
16311642 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
16321643 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1644 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
16331645
16341646 try testBitReverse(u140, 1 << 139, 1);
16351647 try testBitReverse(u140, 1 << 70, 1 << 69);
......@@ -1659,6 +1671,7 @@ fn testByteSwap(comptime T: type, a: T, expected: T) !void {
16591671test "@byteSwap > 128 bits" {
16601672 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
16611673 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1674 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
16621675
16631676 try testByteSwap(u144, 1 << 136, 1);
16641677 try testByteSwap(u144, 1, 1 << 136);
......@@ -1688,6 +1701,7 @@ fn testMax(comptime T: type, a: T, b: T, expected: T) !void {
16881701test "@max > 128 bits" {
16891702 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
16901703 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1704 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
16911705
16921706 try testMax(u140, 0, maxInt(u140), maxInt(u140));
16931707 try testMax(u140, 1 << 139, 1 << 138, 1 << 139);
......@@ -1717,6 +1731,7 @@ fn testMin(comptime T: type, a: T, b: T, expected: T) !void {
17171731test "@min > 128 bits" {
17181732 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
17191733 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1734 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
17201735
17211736 try testMin(u140, 0, maxInt(u140), 0);
17221737 try testMin(u140, 1 << 139, 1 << 138, 1 << 138);
......@@ -1746,6 +1761,7 @@ fn testAbs(comptime T: type, a: T, expected: anytype) !void {
17461761test "@abs > 128 bits" {
17471762 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
17481763 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1764 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
17491765
17501766 try testAbs(u140, 0, 0);
17511767 try testAbs(u140, 1 << 139, 1 << 139);
......@@ -1770,6 +1786,7 @@ fn testRem(comptime T: type, numerator: T, denominator: T, expected: T) !void {
17701786test "@rem > 128 bits" {
17711787 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
17721788 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1789 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
17731790
17741791 try testRem(u140, 0, maxInt(u140), 0);
17751792 try testRem(u140, maxInt(u140), maxInt(u140), 0);
......@@ -1797,6 +1814,7 @@ fn testMod(comptime T: type, numerator: T, denominator: T, expected: T) !void {
17971814test "@mod > 128 bits" {
17981815 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
17991816 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1817 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
18001818
18011819 try testMod(u140, 0, maxInt(u140), 0);
18021820 try testMod(u140, maxInt(u140), maxInt(u140), 0);
......@@ -1824,6 +1842,7 @@ fn testDivFloor(comptime T: type, numerator: T, denominator: T, expected: T) !vo
18241842test "@divFloor > 128 bits" {
18251843 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
18261844 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1845 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
18271846
18281847 try testDivFloor(u140, 0, maxInt(u140), 0);
18291848 try testDivFloor(u140, maxInt(u140), maxInt(u140), 1);
......@@ -1852,6 +1871,7 @@ fn testDivTrunc(comptime T: type, numerator: T, denominator: T, expected: T) !vo
18521871test "@divTrunc > 128 bits" {
18531872 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
18541873 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1874 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
18551875
18561876 try testDivTrunc(u140, 0, maxInt(u140), 0);
18571877 try testDivTrunc(u140, maxInt(u140), maxInt(u140), 1);
......@@ -2598,6 +2618,8 @@ test "comptime float vector multiplication of zero by nan is nan" {
25982618}
25992619
26002620test "i96 operations" {
2621 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2622
26012623 // This is coverage for some stuff used by std.Io timestamps, to catch
26022624 // issues earlier than bootstrapping.
26032625 const Op_i96 = union(enum) {
test/behavior/maximum_minimum.zig+4
......@@ -160,6 +160,7 @@ test "@min/@max more than two arguments" {
160160}
161161
162162test "@min/@max more than two vector arguments" {
163 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
163164 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
164165 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
165166 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
......@@ -189,6 +190,7 @@ test "@min/@max notices bounds" {
189190}
190191
191192test "@min/@max notices vector bounds" {
193 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
192194 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
193195 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
194196 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
......@@ -239,6 +241,7 @@ test "@min/@max notices bounds from types" {
239241}
240242
241243test "@min/@max notices bounds from vector types" {
244 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
242245 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
243246 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
244247 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
......@@ -348,6 +351,7 @@ test "@min/@max with runtime signed and unsigned integers of same size" {
348351}
349352
350353test "@min/@max with runtime vectors of signed and unsigned integers of same size" {
354 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
351355 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
352356 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
353357 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
test/behavior/memset.zig+4
......@@ -179,6 +179,8 @@ test "@memset with zero-length array" {
179179}
180180
181181test "@memset a global array" {
182 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
183
182184 const S = struct {
183185 var buf: [1]u32 = .{123};
184186 };
......@@ -190,6 +192,8 @@ test "@memset a global array" {
190192}
191193
192194test "@memset array of booleans" {
195 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
196
193197 const S = struct {
194198 var x: bool = false;
195199 var y: [1]bool = undefined;
test/behavior/merge_error_sets.zig+1
......@@ -13,6 +13,7 @@ fn foo() C!void {
1313
1414test "merge error sets" {
1515 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
16 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1617
1718 if (foo()) {
1819 @panic("unexpected");
test/behavior/multiple_externs_with_conflicting_types.zig+3-1
......@@ -5,7 +5,9 @@ const A = extern struct {
55extern fn issue529(?*A) void;
66
77comptime {
8 _ = @import("conflicting_externs/b.zig");
8 if (builtin.zig_backend != .stage2_spirv) {
9 _ = @import("conflicting_externs/b.zig");
10 }
911}
1012
1113const builtin = @import("builtin");
test/behavior/optional.zig+6
......@@ -338,6 +338,7 @@ test "coerce an anon struct literal to optional struct" {
338338test "0-bit child type coerced to optional return ptr result location" {
339339 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
340340 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
341 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
341342
342343 const S = struct {
343344 fn doTheTest() !void {
......@@ -428,6 +429,7 @@ test "optional pointer to zero bit optional payload" {
428429 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
429430 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
430431 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
432 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
431433
432434 const B = struct {
433435 fn foo(_: *@This()) void {}
......@@ -512,6 +514,8 @@ test "mutable optional of noreturn" {
512514}
513515
514516test "orelse on C pointer" {
517 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
518
515519 // TODO https://github.com/ziglang/zig/issues/6597
516520 const foo: [*c]const u8 = "hey";
517521 const d = foo orelse @compileError("bad");
......@@ -655,6 +659,8 @@ test "result location initialization of optional with OPV payload" {
655659}
656660
657661test "global comptime only optional" {
662 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
663
658664 const S = struct {
659665 const @"null": ?*type = null;
660666 const @"void": ?*const type = &void;
test/behavior/packed-struct.zig+3
......@@ -248,6 +248,7 @@ test "nested packed struct unaligned" {
248248 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
249249 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
250250 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
251 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
251252
252253 const S1 = packed struct {
253254 a: u4,
......@@ -816,6 +817,7 @@ test "packed struct passed to callconv(.c) function" {
816817 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
817818 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
818819 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
820 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
819821
820822 const S = struct {
821823 const Packed = packed struct(u64) {
......@@ -893,6 +895,7 @@ test "store undefined to packed result location" {
893895 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
894896 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
895897 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
898 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
896899
897900 var x: u4 = 0;
898901 _ = &x;
test/behavior/packed-union.zig+2
......@@ -201,6 +201,8 @@ test "packed union with explicit backing integer" {
201201}
202202
203203test "packed union equality" {
204 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
205
204206 const Foo = packed union {
205207 a: u4,
206208 b: i4,
test/behavior/pointers.zig+10
......@@ -136,6 +136,8 @@ test "implicit cast single item pointer to C pointer and back" {
136136}
137137
138138test "initialize const optional C pointer to null" {
139 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
140
139141 const a: ?[*c]i32 = null;
140142 try expect(a == null);
141143 comptime assert(a == null);
......@@ -643,6 +645,8 @@ test "result type preserved through multiple references" {
643645}
644646
645647test "result type found through optional pointer" {
648 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
649
646650 const ptr1: ?*const u32 = &@intCast(123);
647651 const ptr2: ?[]const u8 = &.{ @intCast(123), @truncate(0xABCD) };
648652 try expect(ptr1.?.* == 123);
......@@ -720,6 +724,8 @@ test "cast pointers with zero sized elements" {
720724}
721725
722726test "comptime pointer equality through distinct fields with well-defined layout" {
727 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
728
723729 const A = extern struct {
724730 x: u32,
725731 z: u16,
......@@ -744,6 +750,8 @@ test "comptime pointer equality through distinct fields with well-defined layout
744750}
745751
746752test "comptime pointer equality through distinct elements with well-defined layout" {
753 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
754
747755 const buf: [2]u32 = .{ 123, 456 };
748756
749757 const ptr: *const [2]u32 = &buf;
......@@ -780,6 +788,8 @@ test "pointers to elements of many-ptr to zero-bit type" {
780788}
781789
782790test "comptime C pointer to optional pointer" {
791 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
792
783793 const opt: ?*u8 = @ptrFromInt(0x1000);
784794 const outer_ptr: [*c]const ?*u8 = &opt;
785795 const inner_ptr = &outer_ptr.*.?;
test/behavior/ptrcast.zig+11
......@@ -193,6 +193,7 @@ const Bytes = struct {
193193
194194test "ptrcast of const integer has the correct object size" {
195195 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
196 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
196197
197198 const is_value = ~@as(isize, @intCast(std.math.minInt(isize)));
198199 const is_bytes = @as([*]const u8, @ptrCast(&is_value))[0..@sizeOf(isize)];
......@@ -279,6 +280,8 @@ test "@ptrCast undefined value at comptime" {
279280}
280281
281282test "comptime @ptrCast with packed struct leaves value unmodified" {
283 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
284
282285 const S = packed struct { three: u3 };
283286 const st: S = .{ .three = 6 };
284287 try expect(st.three == 6);
......@@ -288,6 +291,8 @@ test "comptime @ptrCast with packed struct leaves value unmodified" {
288291}
289292
290293test "@ptrCast restructures comptime-only array" {
294 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
295
291296 {
292297 const a3a2: [3][2]comptime_int = .{
293298 .{ 1, 2 },
......@@ -330,6 +335,8 @@ test "@ptrCast restructures comptime-only array" {
330335}
331336
332337test "@ptrCast restructures sliced comptime-only array" {
338 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
339
333340 const a3a2: [4][2]comptime_int = .{
334341 .{ 1, 2 },
335342 .{ 3, 4 },
......@@ -552,6 +559,8 @@ test "@ptrCast single-item pointer to slice of bytes" {
552559}
553560
554561test "@ptrCast array pointer removing sentinel" {
562 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
563
555564 const in: *const [4:0]u8 = &.{ 1, 2, 3, 4 };
556565 const out: []const i8 = @ptrCast(in);
557566 comptime assert(out.len == 4);
......@@ -562,6 +571,8 @@ test "@ptrCast array pointer removing sentinel" {
562571}
563572
564573test "@ptrcast larger type to smaller one" {
574 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
575
565576 const T = packed struct { x: u17 };
566577 const a: u32 = 0;
567578 const b: *const T = @ptrCast(&a);
test/behavior/saturating_arithmetic.zig+4
......@@ -362,6 +362,7 @@ test "saturating shl uses the LHS type" {
362362test "sat add > 128 bits" {
363363 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
364364 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
365 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
365366
366367 try testSatAdd(u140, 0, 0, 0);
367368 try testSatAdd(u140, maxInt(u140), 1, maxInt(u140));
......@@ -377,6 +378,7 @@ test "sat add > 128 bits" {
377378test "sat sub > 128 bits" {
378379 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
379380 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
381 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
380382
381383 try testSatSub(u140, 0, 1, 0);
382384 try testSatSub(u140, maxInt(u140), maxInt(u140), 0);
......@@ -392,6 +394,7 @@ test "sat sub > 128 bits" {
392394test "sat mul > 128 bits" {
393395 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
394396 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
397 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
395398
396399 try testSatMul(u140, 0, maxInt(u140), 0);
397400 try testSatMul(u140, 1 << 70, 1 << 69, 1 << 139);
......@@ -407,6 +410,7 @@ test "sat mul > 128 bits" {
407410test "sat shl > 128 bits" {
408411 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
409412 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
413 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
410414
411415 try testSatShl(u140, 0, u8, 17, 0);
412416 try testSatShl(u140, 1 << 100, u8, 20, 1 << 120);
test/behavior/sizeof_and_typeof.zig+1-1
......@@ -340,7 +340,7 @@ const exp = struct {
340340 }
341341};
342342comptime {
343 _ = exp;
343 if (builtin.zig_backend != .stage2_spirv) _ = exp;
344344}
345345
346346test "Extern function calls in @TypeOf" {
test/behavior/slice.zig+14
......@@ -67,6 +67,7 @@ test "comptime slice of undefined pointer of length 0" {
6767
6868test "implicitly cast array of size 0 to slice" {
6969 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
70 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
7071
7172 var msg = [_]u8{};
7273 try assertLenIsZero(&msg);
......@@ -172,6 +173,7 @@ test "pass a slice of types to a function" {
172173
173174test "generic malloc free" {
174175 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
176 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
175177
176178 const a = memAlloc(u8, 10) catch unreachable;
177179 memFree(u8, a);
......@@ -210,6 +212,8 @@ test "comptime slice of pointer preserves comptime var" {
210212}
211213
212214test "comptime pointer cast array and then slice" {
215 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
216
213217 const array = [_]u8{ 1, 2, 3, 4, 5, 6, 7, 8 };
214218
215219 const ptrA: [*]const u8 = @as([*]const u8, @ptrCast(&array));
......@@ -276,6 +280,7 @@ test "slice string literal has correct type" {
276280
277281test "result location zero sized array inside struct field implicit cast to slice" {
278282 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
283 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
279284
280285 const E = struct {
281286 entries: []u32,
......@@ -382,6 +387,8 @@ test "obtaining a null terminated slice" {
382387}
383388
384389test "empty array to slice" {
390 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
391
385392 const S = struct {
386393 fn doTheTest() !void {
387394 const empty: []align(16) u8 = &[_]u8{};
......@@ -786,6 +793,8 @@ test "slice bounds in comptime concatenation" {
786793}
787794
788795test "slice sentinel access at comptime" {
796 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
797
789798 {
790799 const str0 = &[_:0]u8{ '1', '2', '3' };
791800 const slice0: [:0]const u8 = str0;
......@@ -852,6 +861,8 @@ test "slice len modification at comptime" {
852861}
853862
854863test "slice field ptr const" {
864 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
865
855866 const const_slice: []const u8 = "string";
856867
857868 const const_ptr_const_slice = &const_slice;
......@@ -865,6 +876,7 @@ test "slice field ptr const" {
865876
866877test "slice field ptr var" {
867878 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
879 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
868880
869881 var var_slice: []const u8 = "string";
870882
......@@ -1050,6 +1062,8 @@ test "peer slices keep abi alignment with empty struct" {
10501062}
10511063
10521064test "sentinel expression in slice operation has result type" {
1065 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1066
10531067 const sentinel = std.math.maxInt(u16);
10541068
10551069 const arr: [3]u16 = .{ 1, 2, sentinel };
test/behavior/string_literals.zig+2
......@@ -84,6 +84,8 @@ test "string literal pointer sentinel" {
8484}
8585
8686test "sentinel slice of string literal" {
87 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
88
8789 const string = "Hello!\x00World!";
8890 try std.testing.expect(@TypeOf(string) == *const [13:0]u8);
8991
test/behavior/struct.zig+12
......@@ -342,6 +342,7 @@ test "self-referencing struct via array member" {
342342}
343343
344344test "empty struct method call" {
345 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
345346 const es = EmptyStruct{};
346347 try expect(es.method() == 1234);
347348}
......@@ -991,6 +992,7 @@ test "struct with 0-length union array field" {
991992}
992993
993994test "packed struct with undefined initializers" {
995 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
994996 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
995997 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
996998 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
......@@ -1645,6 +1647,8 @@ test "struct init with no result pointer sets field result types" {
16451647}
16461648
16471649test "runtime side-effects in comptime-known struct init" {
1650 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1651
16481652 var side_effects: u4 = 0;
16491653 const S = struct { a: u4, b: u4, c: u4, d: u4 };
16501654 const init = S{
......@@ -1772,6 +1776,7 @@ test "circular dependency through pointer field of a struct" {
17721776}
17731777
17741778test "field calls do not force struct field init resolution" {
1779 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
17751780 const S = struct {
17761781 x: u32 = blk: {
17771782 _ = @TypeOf(make().dummyFn()); // runtime field call - S not fully resolved - dummyFn call should not force field init resolution
......@@ -1921,6 +1926,7 @@ test "runtime value in nested initializer passed as pointer to function" {
19211926}
19221927
19231928test "struct field default value is a call" {
1929 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
19241930 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
19251931 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
19261932
......@@ -2182,6 +2188,7 @@ test "pass a pointer to a comptime-only struct field to a function" {
21822188}
21832189
21842190test "overaligned extern struct fields" {
2191 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
21852192 const A = struct {
21862193 a: *anyopaque,
21872194 b: u64,
......@@ -2231,6 +2238,7 @@ test "overaligned extern struct fields" {
22312238}
22322239
22332240test "runtime-known slice of comptime-only struct" {
2241 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
22342242 const Mixed = struct { index: u32, T: type };
22352243
22362244 const static = struct {
......@@ -2252,6 +2260,7 @@ test "runtime-known slice of comptime-only struct" {
22522260}
22532261
22542262test "struct contains aligned pointer to itself through type decl" {
2263 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
22552264 const Slab = struct {
22562265 const Ptr = *align(64) const @This();
22572266 next: Ptr,
......@@ -2269,6 +2278,7 @@ test "struct contains aligned pointer to itself through type decl" {
22692278}
22702279
22712280test "struct contains underaligned field with overaligned pointer to itself" {
2281 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
22722282 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
22732283 const S = struct {
22742284 ptr: *align(8) @This() align(1),
......@@ -2281,6 +2291,7 @@ test "struct contains underaligned field with overaligned pointer to itself" {
22812291}
22822292
22832293test "struct contains pointer to function accepting that struct" {
2294 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
22842295 const S = struct {
22852296 const FnPtr = ?*const fn (@This()) void;
22862297 fn_ptr: FnPtr,
......@@ -2303,6 +2314,7 @@ test "struct queries typeinfo of struct containing pointer back to first struct"
23032314}
23042315
23052316test "pointer to runtime field of struct containing struct containing comptime-only optional" {
2317 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
23062318 const Foo = struct {
23072319 padding: struct { a: u8, b: ?comptime_int },
23082320 number: u8,
test/behavior/switch.zig+23
......@@ -276,6 +276,7 @@ test "switch prong with variable" {
276276 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
277277 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
278278 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
279 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
279280
280281 try switchProngWithVarFn(SwitchProngWithVarEnum{ .One = 13 });
281282 try switchProngWithVarFn(SwitchProngWithVarEnum{ .Two = 13.0 });
......@@ -299,6 +300,7 @@ fn switchProngWithVarFn(a: SwitchProngWithVarEnum) !void {
299300test "switch on enum using pointer capture" {
300301 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
301302 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
303 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
302304
303305 try testSwitchEnumPtrCapture();
304306 try comptime testSwitchEnumPtrCapture();
......@@ -359,6 +361,7 @@ fn testSwitchHandleAllCasesRange(x: u8) u8 {
359361test "switch on union with some prongs capturing" {
360362 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
361363 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
364 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
362365
363366 const X = union(enum) {
364367 a,
......@@ -395,6 +398,7 @@ test "switch on const enum with var" {
395398
396399test "anon enum literal used in switch on union enum" {
397400 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
401 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
398402
399403 const Foo = union(enum) {
400404 a: i32,
......@@ -576,6 +580,7 @@ test "switch with null and T peer types and inferred result location type" {
576580test "switch prongs with cases with identical payload types" {
577581 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
578582 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
583 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
579584
580585 const Union = union(enum) {
581586 A: usize,
......@@ -617,6 +622,8 @@ test "switch prongs with cases with identical payload types" {
617622}
618623
619624test "switch prong pointer capture alignment" {
625 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
626
620627 const U = union(enum) {
621628 a: u8 align(8),
622629 b: u8 align(4),
......@@ -840,6 +847,7 @@ test "switch capture peer type resolution" {
840847
841848test "switch capture peer type resolution for in-memory coercible payloads" {
842849 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
850 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
843851
844852 const T1 = c_int;
845853 const t1_info = @typeInfo(T1).int;
......@@ -863,6 +871,7 @@ test "switch capture peer type resolution for in-memory coercible payloads" {
863871
864872test "switch pointer capture peer type resolution" {
865873 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
874 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
866875
867876 const T1 = c_int;
868877 const t1_info = @typeInfo(T1).int;
......@@ -968,6 +977,8 @@ test "switch prong captures range" {
968977}
969978
970979test "prong with inline call to unreachable" {
980 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
981
971982 const U = union(enum) {
972983 void: void,
973984 bool: bool,
......@@ -1174,6 +1185,8 @@ test "switch with uninstantiable union fields" {
11741185}
11751186
11761187test "switch with tag capture" {
1188 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1189
11771190 const U = union(enum) {
11781191 a,
11791192 b: i32,
......@@ -1307,6 +1320,8 @@ test "single-item prong in switch on enum has comptime-known capture" {
13071320}
13081321
13091322test "single range switch prong capture" {
1323 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1324
13101325 const S = struct {
13111326 fn doTheTest(x: u8) !void {
13121327 switch (x) {
......@@ -1328,6 +1343,8 @@ test "single range switch prong capture" {
13281343}
13291344
13301345test "switch on packed struct" {
1346 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1347
13311348 const P = packed struct {
13321349 a: u1,
13331350 b: u1,
......@@ -1358,6 +1375,8 @@ test "switch on packed struct" {
13581375}
13591376
13601377test "switch on packed union" {
1378 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1379
13611380 const P = packed union(u2) {
13621381 a: u2,
13631382 b: i2,
......@@ -1405,6 +1424,8 @@ test "switch on packed union" {
14051424}
14061425
14071426test "switch on nested packed containers" {
1427 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1428
14081429 const P = packed struct {
14091430 iu: u17,
14101431 is: i31,
......@@ -1458,6 +1479,8 @@ test "switch on nested packed containers" {
14581479}
14591480
14601481test "switch on large types" {
1482 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1483
14611484 const S = struct {
14621485 fn doTheTest(a: u128, b: i500) !void {
14631486 switch (a) {
test/behavior/switch_loop.zig+10
......@@ -397,6 +397,8 @@ test "switch loop on type with opv" {
397397}
398398
399399test "switch loop with tag capture" {
400 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
401
400402 const U = union(enum) {
401403 a,
402404 b: i32,
......@@ -467,6 +469,8 @@ test "switch loop with tag capture" {
467469}
468470
469471test "switch loop for error handling" {
472 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
473
470474 const Error = error{ MyError, MyOtherError };
471475 const S = struct {
472476 fn doTheTest() !void {
......@@ -511,6 +515,8 @@ test "switch loop for error handling" {
511515}
512516
513517test "switch loop with packed structs" {
518 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
519
514520 const P = packed struct {
515521 a: u7,
516522 b: u20,
......@@ -528,6 +534,8 @@ test "switch loop with packed structs" {
528534}
529535
530536test "switch loop with packed unions" {
537 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
538
531539 const P = packed union {
532540 a: u7,
533541 b: i7,
......@@ -566,6 +574,8 @@ test "switch loop with packed unions with OPV" {
566574}
567575
568576test "switch loop on large types" {
577 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
578
569579 const S = struct {
570580 fn doTheTest(a: u128, b: i500) !void {
571581 label: switch (a) {
test/behavior/switch_prong_err_enum.zig+1
......@@ -24,6 +24,7 @@ test "switch prong returns error enum" {
2424 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
2525 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
2626 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
27 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2728
2829 switch (doThing(17) catch unreachable) {
2930 FormValue.Address => |payload| {
test/behavior/switch_prong_implicit_cast.zig+1
......@@ -18,6 +18,7 @@ test "switch prong implicit cast" {
1818 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1919 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
2020 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
21 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2122
2223 const result = switch (foo(2) catch unreachable) {
2324 FormValue.One => false,
test/behavior/truncate.zig+1
......@@ -50,6 +50,7 @@ fn testTruncate(comptime S: type, a: S, comptime D: type, expected: D) !void {
5050test "@truncate > 128 bits" {
5151 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
5252 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
53 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
5354
5455 try testTruncate(u140, 0, u128, 0);
5556 try testTruncate(u140, maxInt(u140), u128, maxInt(u128));
test/behavior/tuple.zig+2
......@@ -559,6 +559,8 @@ test "OPV tuple fields aren't comptime" {
559559}
560560
561561test "array of tuples that end with a zero-bit field followed by padding" {
562 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
563
562564 const S = struct {
563565 var foo: [2]struct { u32, u8, void } = .{ .{ 1, 2, {} }, .{ 3, 4, {} } };
564566 };
test/behavior/type.zig+1
......@@ -277,6 +277,7 @@ test "Type.Union from empty Type.Enum" {
277277
278278test "Type.Fn" {
279279 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
280 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
280281
281282 const some_opaque = opaque {};
282283 const some_ptr = *some_opaque;
test/behavior/type_info.zig+4
......@@ -310,6 +310,8 @@ const TestStruct = struct {
310310};
311311
312312test "type info: packed struct info" {
313 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
314
313315 try testPackedStruct();
314316 try comptime testPackedStruct();
315317}
......@@ -594,6 +596,8 @@ test "value from struct @typeInfo default_value_ptr can be loaded at comptime" {
594596}
595597
596598test "type info of tuple of string literal default value" {
599 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
600
597601 const struct_info = @typeInfo(@TypeOf(.{"hi"})).@"struct";
598602 const struct_field_attrs = struct_info.field_attrs[0];
599603 const struct_field_type = struct_info.field_types[0];
test/behavior/union.zig+27
......@@ -31,6 +31,7 @@ test "init union with runtime value - floats" {
3131 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
3232 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
3333 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
34 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
3435
3536 var foo: FooWithFloats = undefined;
3637
......@@ -407,6 +408,7 @@ test "tagged union with no payloads" {
407408
408409test "union with only 1 field casted to its enum type" {
409410 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
411 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
410412
411413 const Literal = union(enum) {
412414 Number: f64,
......@@ -443,6 +445,7 @@ var glbl: Foo1 = undefined;
443445test "global union with single field is correctly initialized" {
444446 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
445447 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
448 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
446449
447450 glbl = Foo1{
448451 .f = @typeInfo(Foo1).@"union".field_types[0]{ .x = 123 },
......@@ -485,6 +488,7 @@ test "update the tag value for zero-sized unions" {
485488test "union initializer generates padding only if needed" {
486489 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
487490 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
491 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
488492
489493 const U = union(enum) {
490494 A: u24,
......@@ -550,6 +554,7 @@ const Baz = enum { A, B, C, D };
550554
551555test "tagged union type" {
552556 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
557 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
553558
554559 const foo1 = TaggedFoo{ .One = 13 };
555560 const foo2 = TaggedFoo{
......@@ -654,6 +659,7 @@ fn testEnumWithSpecifiedAndUnspecifiedTagValues(x: MultipleChoice2) !void {
654659test "switch on union with only 1 field" {
655660 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
656661 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
662 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
657663
658664 var r: PartialInst = undefined;
659665 r = PartialInst.Compiled;
......@@ -682,6 +688,7 @@ const PartialInstWithPayload = union(enum) {
682688
683689test "union with only 1 field casted to its enum type which has enum value specified" {
684690 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
691 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
685692
686693 const Literal = union(enum) {
687694 number: f64,
......@@ -706,6 +713,7 @@ test "union with only 1 field casted to its enum type which has enum value speci
706713test "@intFromEnum works on unions" {
707714 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
708715 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
716 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
709717
710718 const Bar = union(enum) {
711719 A: bool,
......@@ -765,6 +773,7 @@ test "return union init with void payload" {
765773 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
766774 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
767775 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
776 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
768777
769778 const S = struct {
770779 fn entry() !void {
......@@ -789,6 +798,7 @@ test "@unionInit stored to a const" {
789798 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
790799 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
791800 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
801 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
792802
793803 const S = struct {
794804 const U = union(enum) {
......@@ -818,6 +828,7 @@ test "@unionInit stored to a const" {
818828test "@unionInit can modify a union type" {
819829 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
820830 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
831 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
821832
822833 const UnionInitEnum = union(enum) {
823834 Boolean: bool,
......@@ -840,6 +851,7 @@ test "@unionInit can modify a union type" {
840851test "@unionInit can modify a pointer value" {
841852 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
842853 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
854 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
843855
844856 const UnionInitEnum = union(enum) {
845857 Boolean: bool,
......@@ -914,6 +926,7 @@ test "function call result coerces from tagged union to the tag" {
914926 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
915927 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
916928 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
929 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
917930
918931 const S = struct {
919932 const Arch = union(enum) {
......@@ -948,6 +961,7 @@ test "function call result coerces from tagged union to the tag" {
948961test "switching on non exhaustive union" {
949962 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
950963 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
964 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
951965
952966 const S = struct {
953967 const E = enum(u8) {
......@@ -1004,6 +1018,7 @@ test "containers with single-field enums" {
10041018test "@unionInit on union with u8 tag but no fields" {
10051019 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
10061020 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1021 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
10071022
10081023 const S = struct {
10091024 const Type = enum(u8) { no_op = 105 };
......@@ -1108,6 +1123,8 @@ test "union with a large struct field" {
11081123}
11091124
11101125test "comptime equality of extern unions with same tag" {
1126 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1127
11111128 const S = struct {
11121129 const U = extern union {
11131130 a: i32,
......@@ -1126,6 +1143,7 @@ test "union tag is set when initiated as a temporary value at runtime" {
11261143 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
11271144 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
11281145 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1146 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
11291147
11301148 const U = union(enum) {
11311149 a,
......@@ -1165,6 +1183,7 @@ test "return an extern union from C calling convention" {
11651183 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
11661184 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
11671185 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1186 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
11681187
11691188 const namespace = struct {
11701189 const S = extern struct {
......@@ -1246,6 +1265,7 @@ test "@unionInit uses tag value instead of field index" {
12461265 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
12471266 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
12481267 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1268 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
12491269
12501270 const E = enum(u8) {
12511271 b = 255,
......@@ -1303,6 +1323,7 @@ test "packed union in packed struct" {
13031323 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
13041324 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
13051325 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1326 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
13061327
13071328 const S = packed struct {
13081329 nested: packed union {
......@@ -1374,6 +1395,7 @@ test "no dependency loop when function pointer in union returns the union" {
13741395test "union reassignment can use previous value" {
13751396 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
13761397 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1398 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
13771399
13781400 const U = union {
13791401 a: u32,
......@@ -1386,6 +1408,7 @@ test "union reassignment can use previous value" {
13861408
13871409test "reinterpreting enum value inside packed union" {
13881410 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1411 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
13891412
13901413 const U = packed union {
13911414 tag: enum(u8) { a, b },
......@@ -1864,6 +1887,7 @@ test "extern union initialized via reintepreted struct field initializer" {
18641887
18651888test "packed union initialized via reintepreted struct field initializer" {
18661889 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1890 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
18671891
18681892 const bytes = [_]u8{ 0xaa, 0xbb, 0xcc, 0xdd };
18691893
......@@ -1909,6 +1933,7 @@ test "store of comptime reinterpreted memory to extern union" {
19091933
19101934test "store of comptime reinterpreted memory to packed union" {
19111935 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1936 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
19121937
19131938 const bytes = [_]u8{ 0xaa, 0xbb, 0xcc, 0xdd };
19141939
......@@ -2256,6 +2281,8 @@ test "assign global tagged union" {
22562281}
22572282
22582283test "set mutable union by switching on same union" {
2284 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2285
22592286 const U = union(enum) {
22602287 foo,
22612288 bar: usize,
test/behavior/vector.zig+12
......@@ -8,6 +8,7 @@ const expectEqual = std.testing.expectEqual;
88
99test "implicit cast vector to array - bool" {
1010 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
11 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1112
1213 const S = struct {
1314 fn doTheTest() !void {
......@@ -30,6 +31,7 @@ test "implicit cast vector to array - bool" {
3031}
3132
3233test "implicit cast array to vector - bool" {
34 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
3335 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
3436
3537 const S = struct {
......@@ -311,6 +313,7 @@ test "peer type resolution with coercible element types" {
311313}
312314
313315test "tuple to vector" {
316 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
314317 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
315318 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
316319 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
......@@ -413,6 +416,7 @@ test "vector @splat" {
413416}
414417
415418test "load vector elements via comptime index" {
419 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
416420 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
417421 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
418422
......@@ -433,6 +437,7 @@ test "load vector elements via comptime index" {
433437}
434438
435439test "store vector elements via comptime index" {
440 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
436441 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
437442 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
438443
......@@ -1223,6 +1228,7 @@ test "@subWithOverflow" {
12231228}
12241229
12251230test "@mulWithOverflow" {
1231 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
12261232 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
12271233 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
12281234 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
......@@ -1243,6 +1249,7 @@ test "@mulWithOverflow" {
12431249}
12441250
12451251test "@shlWithOverflow" {
1252 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
12461253 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
12471254 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
12481255 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
......@@ -1371,6 +1378,7 @@ test "zero multiplicand" {
13711378 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
13721379 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO
13731380 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1381 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
13741382
13751383 const zeros = @Vector(2, u32){ 0.0, 0.0 };
13761384 var ones = @Vector(2, u32){ 1.0, 1.0 };
......@@ -1413,6 +1421,7 @@ test "modRem with zero divisor" {
14131421}
14141422
14151423test "array operands to shuffle are coerced to vectors" {
1424 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
14161425 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
14171426 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
14181427 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
......@@ -1438,6 +1447,7 @@ test "load packed vector element" {
14381447}
14391448
14401449test "store packed vector element" {
1450 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
14411451 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
14421452 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
14431453 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
......@@ -1500,6 +1510,7 @@ test "store vector with memset" {
15001510}
15011511
15021512test "addition of vectors represented as strings" {
1513 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
15031514 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
15041515 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
15051516
......@@ -1510,6 +1521,7 @@ test "addition of vectors represented as strings" {
15101521}
15111522
15121523test "compare vectors with different element types" {
1524 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
15131525 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
15141526 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
15151527 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
test/behavior/while.zig+2
......@@ -401,6 +401,8 @@ test "breaking from a loop in an if statement" {
401401}
402402
403403test "labeled break from else" {
404 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
405
404406 const S = struct {
405407 fn doTheTest(x: u32) !void {
406408 const arr: []const u32 = &.{ 1, 3, 10 };