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" {...@@ -54,6 +54,7 @@ test "@abs signed C ABI integers" {
54 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO54 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
55 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO55 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
56 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO56 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO
57 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
5758
58 const S = struct {59 const S = struct {
59 fn doTheTest() !void {60 fn doTheTest() !void {
test/behavior/align.zig+8
...@@ -7,6 +7,8 @@ const assert = std.debug.assert;...@@ -7,6 +7,8 @@ const assert = std.debug.assert;
7var foo: u8 align(4) = 100;7var foo: u8 align(4) = 100;
88
9test "global variable alignment" {9test "global variable alignment" {
10 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
11
10 comptime assert(@typeInfo(@TypeOf(&foo)).pointer.attrs.@"align" == 4);12 comptime assert(@typeInfo(@TypeOf(&foo)).pointer.attrs.@"align" == 4);
11 comptime assert(@TypeOf(&foo) == *align(4) u8);13 comptime assert(@TypeOf(&foo) == *align(4) u8);
12 {14 {
...@@ -16,6 +18,8 @@ test "global variable alignment" {...@@ -16,6 +18,8 @@ test "global variable alignment" {
16}18}
1719
18test "large abi alignment of global" {20test "large abi alignment of global" {
21 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
22
19 const S = struct {23 const S = struct {
20 var global: @This() = undefined;24 var global: @This() = undefined;
21 x: u64 align(64),25 x: u64 align(64),
...@@ -51,6 +55,8 @@ test "slicing array of length 1 can not assume runtime index is always zero" {...@@ -51,6 +55,8 @@ test "slicing array of length 1 can not assume runtime index is always zero" {
51}55}
5256
53test "implicitly-aligned pointer is coercible to equivalent explicitly-aligned pointer" {57test "implicitly-aligned pointer is coercible to equivalent explicitly-aligned pointer" {
58 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
59
54 const A = *u32;60 const A = *u32;
55 const B = *align(@alignOf(u32)) u32;61 const B = *align(@alignOf(u32)) u32;
5662
...@@ -83,6 +89,8 @@ test "implicitly-aligned pointer is coercible to equivalent explicitly-aligned p...@@ -83,6 +89,8 @@ test "implicitly-aligned pointer is coercible to equivalent explicitly-aligned p
83}89}
8490
85test "implicitly decreasing pointer alignment" {91test "implicitly decreasing pointer alignment" {
92 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
93
86 const a: u32 align(4) = 3;94 const a: u32 align(4) = 3;
87 const b: u32 align(8) = 4;95 const b: u32 align(8) = 4;
88 try expect(addUnaligned(&a, &b) == 7);96 try expect(addUnaligned(&a, &b) == 7);
test/behavior/array.zig+12
...@@ -7,6 +7,7 @@ const expect = testing.expect;...@@ -7,6 +7,7 @@ const expect = testing.expect;
7const expectEqual = testing.expectEqual;7const expectEqual = testing.expectEqual;
88
9test "array to slice" {9test "array to slice" {
10 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
10 const a: u32 align(4) = 3;11 const a: u32 align(4) = 3;
11 const b: u32 align(8) = 4;12 const b: u32 align(8) = 4;
12 const a_slice: []align(1) const u32 = @as(*const [1]u32, &a)[0..];13 const a_slice: []align(1) const u32 = @as(*const [1]u32, &a)[0..];
...@@ -21,6 +22,7 @@ test "array to slice" {...@@ -21,6 +22,7 @@ test "array to slice" {
21test "arrays" {22test "arrays" {
22 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;23 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
23 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO24 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
25 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2426
25 var array: [5]u32 = undefined;27 var array: [5]u32 = undefined;
2628
...@@ -259,6 +261,7 @@ fn doSomeMangling(array: *[4]u8) void {...@@ -259,6 +261,7 @@ fn doSomeMangling(array: *[4]u8) void {
259261
260test "implicit cast zero sized array ptr to slice" {262test "implicit cast zero sized array ptr to slice" {
261 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO263 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
264 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
262265
263 {266 {
264 var b = "".*;267 var b = "".*;
...@@ -969,6 +972,7 @@ test "runtime index of array of zero-bit values" {...@@ -969,6 +972,7 @@ test "runtime index of array of zero-bit values" {
969}972}
970973
971test "@splat array" {974test "@splat array" {
975 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
972 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;976 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
973 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO977 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
974978
...@@ -1036,22 +1040,30 @@ test "@splat zero-length array" {...@@ -1036,22 +1040,30 @@ test "@splat zero-length array" {
1036}1040}
10371041
1038test "initialize slice with reference to empty array initializer" {1042test "initialize slice with reference to empty array initializer" {
1043 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1044
1039 const a: []const u8 = &.{};1045 const a: []const u8 = &.{};
1040 comptime assert(a.len == 0);1046 comptime assert(a.len == 0);
1041}1047}
10421048
1043test "initialize many-pointer with reference to empty array initializer" {1049test "initialize many-pointer with reference to empty array initializer" {
1050 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1051
1044 const a: [*]const u8 = &.{};1052 const a: [*]const u8 = &.{};
1045 _ = a; // nothing meaningful to test; points to zero bits1053 _ = a; // nothing meaningful to test; points to zero bits
1046}1054}
10471055
1048test "initialize sentinel-terminated slice with reference to empty array initializer" {1056test "initialize sentinel-terminated slice with reference to empty array initializer" {
1057 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1058
1049 const a: [:0]const u8 = &.{};1059 const a: [:0]const u8 = &.{};
1050 comptime assert(a.len == 0);1060 comptime assert(a.len == 0);
1051 comptime assert(a[0] == 0);1061 comptime assert(a[0] == 0);
1052}1062}
10531063
1054test "initialize sentinel-terminated many-pointer with reference to empty array initializer" {1064test "initialize sentinel-terminated many-pointer with reference to empty array initializer" {
1065 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1066
1055 const a: [*:0]const u8 = &.{};1067 const a: [*:0]const u8 = &.{};
1056 comptime assert(a[0] == 0);1068 comptime assert(a[0] == 0);
1057}1069}
test/behavior/basic.zig+7
...@@ -305,6 +305,7 @@ test "compile time global reinterpret" {...@@ -305,6 +305,7 @@ test "compile time global reinterpret" {
305}305}
306306
307test "cast undefined" {307test "cast undefined" {
308 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
308 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO309 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
309310
310 const array: [100]u8 = undefined;311 const array: [100]u8 = undefined;
...@@ -640,6 +641,7 @@ fn emptyFn() void {}...@@ -640,6 +641,7 @@ fn emptyFn() void {}
640641
641const addr1 = @as(*const u8, @ptrCast(&emptyFn));642const addr1 = @as(*const u8, @ptrCast(&emptyFn));
642test "comptime cast fn to ptr" {643test "comptime cast fn to ptr" {
644 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
643 const addr2 = @as(*const u8, @ptrCast(&emptyFn));645 const addr2 = @as(*const u8, @ptrCast(&emptyFn));
644 comptime assert(addr1 == addr2);646 comptime assert(addr1 == addr2);
645}647}
...@@ -918,6 +920,7 @@ test "labeled block with runtime branch forwards its result location type to bre...@@ -918,6 +920,7 @@ test "labeled block with runtime branch forwards its result location type to bre
918920
919test "try in labeled block doesn't cast to wrong type" {921test "try in labeled block doesn't cast to wrong type" {
920 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO922 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
923 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
921924
922 const S = struct {925 const S = struct {
923 a: u32,926 a: u32,
...@@ -1278,6 +1281,7 @@ test "@Int returned from block" {...@@ -1278,6 +1281,7 @@ test "@Int returned from block" {
1278}1281}
12791282
1280test "comptime variable initialized with addresses of literals" {1283test "comptime variable initialized with addresses of literals" {
1284 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1281 comptime var st = .{1285 comptime var st = .{
1282 .foo = &1,1286 .foo = &1,
1283 .bar = &2,1287 .bar = &2,
...@@ -1327,6 +1331,8 @@ test "proper value is returned from labeled block" {...@@ -1327,6 +1331,8 @@ test "proper value is returned from labeled block" {
1327}1331}
13281332
1329test "const inferred array of slices" {1333test "const inferred array of slices" {
1334 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1335
1330 const T = struct { v: bool };1336 const T = struct { v: bool };
13311337
1332 const decls = [_][]const T{1338 const decls = [_][]const T{
...@@ -1339,6 +1345,7 @@ test "const inferred array of slices" {...@@ -1339,6 +1345,7 @@ test "const inferred array of slices" {
13391345
1340test "var inferred array of slices" {1346test "var inferred array of slices" {
1341 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1347 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1348 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
13421349
1343 const T = struct { v: bool };1350 const T = struct { v: bool };
13441351
test/behavior/bitcast.zig+4
...@@ -162,6 +162,7 @@ test "@bitCast packed structs at runtime and comptime" {...@@ -162,6 +162,7 @@ test "@bitCast packed structs at runtime and comptime" {
162 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;162 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
163 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;163 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
164 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO164 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
165 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
165166
166 const Full = packed struct {167 const Full = packed struct {
167 number: u16,168 number: u16,
...@@ -222,6 +223,7 @@ test "bitcast packed struct to integer and back" {...@@ -222,6 +223,7 @@ test "bitcast packed struct to integer and back" {
222 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;223 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
223 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;224 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
224 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO225 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
226 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
225227
226 const LevelUpMove = packed struct {228 const LevelUpMove = packed struct {
227 move_id: u9,229 move_id: u9,
...@@ -555,6 +557,7 @@ test "@bitCast of extern struct containing pointer" {...@@ -555,6 +557,7 @@ test "@bitCast of extern struct containing pointer" {
555557
556test "@bitCast of extern struct to float" {558test "@bitCast of extern struct to float" {
557 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;559 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
560 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
558561
559 const S = struct {562 const S = struct {
560 const S = extern struct {563 const S = extern struct {
...@@ -575,6 +578,7 @@ test "@bitCast of extern struct to float" {...@@ -575,6 +578,7 @@ test "@bitCast of extern struct to float" {
575578
576test "@bitCast of float to extern struct" {579test "@bitCast of float to extern struct" {
577 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;580 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
581 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
578582
579 const S = struct {583 const S = struct {
580 const S = extern struct {584 const S = extern struct {
test/behavior/call.zig+2
...@@ -408,6 +408,7 @@ test "recursive inline call with comptime known argument" {...@@ -408,6 +408,7 @@ test "recursive inline call with comptime known argument" {
408408
409test "inline while with @call" {409test "inline while with @call" {
410 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO410 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
411 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
411412
412 const S = struct {413 const S = struct {
413 fn inc(a: *u32) void {414 fn inc(a: *u32) void {
...@@ -735,6 +736,7 @@ test "tail call function pointer" {...@@ -735,6 +736,7 @@ test "tail call function pointer" {
735test "tail call with potentially extended types" {736test "tail call with potentially extended types" {
736 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO737 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
737 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO738 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
739 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
738740
739 if (builtin.zig_backend == .stage2_llvm or builtin.zig_backend == .stage2_c) {741 if (builtin.zig_backend == .stage2_llvm or builtin.zig_backend == .stage2_c) {
740 if (builtin.cpu.arch.isMIPS() or builtin.cpu.arch.isPowerPC() or builtin.cpu.arch.isWasm()) {742 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" {...@@ -103,6 +103,7 @@ test "comptime_int @floatFromInt" {
103}103}
104104
105test "@floatFromInt" {105test "@floatFromInt" {
106 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
106 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO107 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
107 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;108 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
108 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO109 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 {...@@ -131,6 +132,7 @@ fn testIntFromFloat(comptime F: type, f: F, comptime I: type, i: I) !void {
131}132}
132133
133test "@intFromFloat > 128 bits" {134test "@intFromFloat > 128 bits" {
135 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
134 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;136 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
135 if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;137 if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
136 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;138 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...@@ -156,6 +158,7 @@ fn testFloatFromInt(comptime I: type, i: I, comptime F: type, expected: F) !void
156}158}
157159
158test "@floatFromInt > 128 bits" {160test "@floatFromInt > 128 bits" {
161 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
159 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;162 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
160 if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;163 if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
161 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;164 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
...@@ -216,6 +219,8 @@ test "@floatFromInt(f80)" {...@@ -216,6 +219,8 @@ test "@floatFromInt(f80)" {
216}219}
217220
218test "type coercion from int to float" {221test "type coercion from int to float" {
222 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
223
219 const check = struct {224 const check = struct {
220 // Check that an integer value can be coerced to a float type and225 // Check that an integer value can be coerced to a float type and
221 // then converted back to the original value without rounding issues.226 // then converted back to the original value without rounding issues.
...@@ -539,6 +544,8 @@ test "return u8 coercing into ?u32 return type" {...@@ -539,6 +544,8 @@ test "return u8 coercing into ?u32 return type" {
539}544}
540545
541test "cast from ?[*]T to ??[*]T" {546test "cast from ?[*]T to ??[*]T" {
547 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
548
542 const a: ??[*]u8 = @as(?[*]u8, null);549 const a: ??[*]u8 = @as(?[*]u8, null);
543 try expect(a != null and a.? == null);550 try expect(a != null and a.? == null);
544}551}
...@@ -597,6 +604,7 @@ fn testPeerResolveArrayConstSlice(b: bool) !void {...@@ -597,6 +604,7 @@ fn testPeerResolveArrayConstSlice(b: bool) !void {
597}604}
598605
599test "implicitly cast from T to anyerror!?T" {606test "implicitly cast from T to anyerror!?T" {
607 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
600 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;608 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
601 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO609 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
602610
...@@ -622,6 +630,7 @@ fn castToOptionalTypeError(z: i32) !void {...@@ -622,6 +630,7 @@ fn castToOptionalTypeError(z: i32) !void {
622}630}
623631
624test "implicitly cast from [0]T to anyerror![]T" {632test "implicitly cast from [0]T to anyerror![]T" {
633 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
625 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO634 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
626635
627 try testCastZeroArrayToErrSliceMut();636 try testCastZeroArrayToErrSliceMut();
...@@ -1420,6 +1429,7 @@ test "comptime float casts" {...@@ -1420,6 +1429,7 @@ test "comptime float casts" {
1420}1429}
14211430
1422test "pointer reinterpret const float to int" {1431test "pointer reinterpret const float to int" {
1432 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1423 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1433 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
14241434
1425 // The hex representation is 0x3fe3333333333303.1435 // The hex representation is 0x3fe3333333333303.
...@@ -1613,6 +1623,7 @@ fn incrementVoidPtrValue(value: ?*anyopaque) void {...@@ -1613,6 +1623,7 @@ fn incrementVoidPtrValue(value: ?*anyopaque) void {
1613}1623}
16141624
1615test "implicit cast *[0]T to E![]const u8" {1625test "implicit cast *[0]T to E![]const u8" {
1626 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1616 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1627 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
16171628
1618 var x = @as(anyerror![]const u8, &[0]u8{});1629 var x = @as(anyerror![]const u8, &[0]u8{});
...@@ -1807,6 +1818,7 @@ test "cast compatible optional types" {...@@ -1807,6 +1818,7 @@ test "cast compatible optional types" {
1807}1818}
18081819
1809test "coerce undefined single-item pointer of array to error union of slice" {1820test "coerce undefined single-item pointer of array to error union of slice" {
1821 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1810 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1822 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
18111823
1812 const a = @as([*]u8, undefined)[0..0];1824 const a = @as([*]u8, undefined)[0..0];
...@@ -1817,6 +1829,7 @@ test "coerce undefined single-item pointer of array to error union of slice" {...@@ -1817,6 +1829,7 @@ test "coerce undefined single-item pointer of array to error union of slice" {
1817}1829}
18181830
1819test "pointer to empty struct literal to mutable slice" {1831test "pointer to empty struct literal to mutable slice" {
1832 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1820 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1833 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
18211834
1822 var x: []i32 = &.{};1835 var x: []i32 = &.{};
...@@ -1970,6 +1983,7 @@ test "peer type resolution forms error union" {...@@ -1970,6 +1983,7 @@ test "peer type resolution forms error union" {
1970}1983}
19711984
1972test "@constCast without a result location" {1985test "@constCast without a result location" {
1986 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1973 const x: i32 = 1234;1987 const x: i32 = 1234;
1974 const y = @constCast(&x);1988 const y = @constCast(&x);
1975 try expect(@TypeOf(y) == *i32);1989 try expect(@TypeOf(y) == *i32);
...@@ -1977,6 +1991,7 @@ test "@constCast without a result location" {...@@ -1977,6 +1991,7 @@ test "@constCast without a result location" {
1977}1991}
19781992
1979test "@constCast optional" {1993test "@constCast optional" {
1994 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1980 const x: u8 = 10;1995 const x: u8 = 10;
1981 const m: ?*const u8 = &x;1996 const m: ?*const u8 = &x;
1982 const p = @constCast(m);1997 const p = @constCast(m);
...@@ -2053,6 +2068,7 @@ test "peer type resolution: float and comptime-known fixed-width integer" {...@@ -2053,6 +2068,7 @@ test "peer type resolution: float and comptime-known fixed-width integer" {
2053}2068}
20542069
2055test "peer type resolution: float and runtime-known fixed-width integer" {2070test "peer type resolution: float and runtime-known fixed-width integer" {
2071 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2056 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO2072 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
2057 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO2073 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" {...@@ -2163,6 +2179,7 @@ test "peer type resolution: array and vector with same child type" {
2163}2179}
21642180
2165test "peer type resolution: array with smaller child type and vector with larger child type" {2181test "peer type resolution: array with smaller child type and vector with larger child type" {
2182 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2166 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;2183 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
2167 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO2184 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
2168 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO2185 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
...@@ -2343,6 +2360,7 @@ test "peer type resolution: array and tuple" {...@@ -2343,6 +2360,7 @@ test "peer type resolution: array and tuple" {
2343}2360}
23442361
2345test "peer type resolution: vector and tuple" {2362test "peer type resolution: vector and tuple" {
2363 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2346 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;2364 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
2347 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO2365 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
2348 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO2366 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
...@@ -2734,6 +2752,7 @@ test "cast builtins can wrap result in optional" {...@@ -2734,6 +2752,7 @@ test "cast builtins can wrap result in optional" {
2734}2752}
27352753
2736test "cast builtins can wrap result in error union" {2754test "cast builtins can wrap result in error union" {
2755 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2737 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO2756 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
2738 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO2757 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" {...@@ -2809,6 +2828,7 @@ test "cast builtins can wrap result in error union and optional" {
2809}2828}
28102829
2811test "@floatCast on vector" {2830test "@floatCast on vector" {
2831 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2812 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;2832 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
2813 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO2833 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
2814 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO2834 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
...@@ -2897,6 +2917,7 @@ test "@intFromPtr on vector" {...@@ -2897,6 +2917,7 @@ test "@intFromPtr on vector" {
2897}2917}
28982918
2899test "@floatFromInt on vector" {2919test "@floatFromInt on vector" {
2920 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2900 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;2921 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
2901 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO2922 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
2902 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO2923 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
...@@ -2916,6 +2937,7 @@ test "@floatFromInt on vector" {...@@ -2916,6 +2937,7 @@ test "@floatFromInt on vector" {
2916}2937}
29172938
2918test "@intFromFloat on vector" {2939test "@intFromFloat on vector" {
2940 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2919 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;2941 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
2920 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO2942 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
2921 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO2943 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
...@@ -2935,6 +2957,7 @@ test "@intFromFloat on vector" {...@@ -2935,6 +2957,7 @@ test "@intFromFloat on vector" {
2935}2957}
29362958
2937test "@intFromBool on vector" {2959test "@intFromBool on vector" {
2960 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2938 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;2961 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
2939 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO2962 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
2940 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO2963 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
...@@ -3061,6 +3084,7 @@ test "peer type resolution: slice of sentinel-terminated array" {...@@ -3061,6 +3084,7 @@ test "peer type resolution: slice of sentinel-terminated array" {
3061}3084}
30623085
3063test "@intFromFloat boundary cases" {3086test "@intFromFloat boundary cases" {
3087 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
3064 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;3088 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
30653089
3066 const S = struct {3090 const S = struct {
...@@ -3092,6 +3116,7 @@ test "@intFromFloat boundary cases" {...@@ -3092,6 +3116,7 @@ test "@intFromFloat boundary cases" {
3092}3116}
30933117
3094test "@intFromFloat vector boundary cases" {3118test "@intFromFloat vector boundary cases" {
3119 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
3095 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;3120 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
3096 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;3121 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" {...@@ -19,6 +19,7 @@ test "@intCast i32 to u7" {
19}19}
2020
21test "coerce i8 to i32 and @intCast back" {21test "coerce i8 to i32 and @intCast back" {
22 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
22 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO23 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
23 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO24 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
2425
...@@ -34,6 +35,7 @@ test "coerce i8 to i32 and @intCast back" {...@@ -34,6 +35,7 @@ test "coerce i8 to i32 and @intCast back" {
34}35}
3536
36test "coerce non byte-sized integers accross 32bits boundary" {37test "coerce non byte-sized integers accross 32bits boundary" {
38 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
37 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO39 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO
3840
39 {41 {
...@@ -144,6 +146,7 @@ fn testIntCast(comptime S: type, a: S, comptime D: type, expected: D) !void {...@@ -144,6 +146,7 @@ fn testIntCast(comptime S: type, a: S, comptime D: type, expected: D) !void {
144146
145test "@intCast <= 64 bits" {147test "@intCast <= 64 bits" {
146 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;148 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
149 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
147150
148 try testIntCast(i32, minInt(i32), i64, minInt(i32));151 try testIntCast(i32, minInt(i32), i64, minInt(i32));
149 try testIntCast(i32, maxInt(i32), i64, maxInt(i32));152 try testIntCast(i32, maxInt(i32), i64, maxInt(i32));
...@@ -170,6 +173,7 @@ test "@intCast <= 64 bits" {...@@ -170,6 +173,7 @@ test "@intCast <= 64 bits" {
170test "@intCast > 128 bits" {173test "@intCast > 128 bits" {
171 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;174 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
172 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;175 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
176 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
173177
174 try testIntCast(u8, 123, u140, 123);178 try testIntCast(u8, 123, u140, 123);
175 try testIntCast(u64, 1 << 63, u140, 1 << 63);179 try testIntCast(u64, 1 << 63, u140, 1 << 63);
test/behavior/comptime_memory.zig+4
...@@ -431,6 +431,8 @@ test "type pun @ptrFromInt" {...@@ -431,6 +431,8 @@ test "type pun @ptrFromInt" {
431}431}
432432
433test "type pun null pointer-like optional" {433test "type pun null pointer-like optional" {
434 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
435
434 const p: ?*u8 = null;436 const p: ?*u8 = null;
435 // note that expectEqual hides the bug437 // note that expectEqual hides the bug
436 try testing.expect(@as(*const ?*i8, @ptrCast(&p)).* == null);438 try testing.expect(@as(*const ?*i8, @ptrCast(&p)).* == null);
...@@ -553,6 +555,8 @@ test "comptime store of packed struct with void field into array" {...@@ -553,6 +555,8 @@ test "comptime store of packed struct with void field into array" {
553}555}
554556
555test "comptime store of reinterpreted zero-bit type" {557test "comptime store of reinterpreted zero-bit type" {
558 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
559
556 const S = struct {560 const S = struct {
557 fn doTheTest(comptime T: type) void {561 fn doTheTest(comptime T: type) void {
558 comptime var buf: T = undefined;562 comptime var buf: T = undefined;
test/behavior/decl_literals.zig+2
...@@ -49,6 +49,8 @@ test "call decl literal with optional" {...@@ -49,6 +49,8 @@ test "call decl literal with optional" {
49}49}
5050
51test "call decl literal with pointer" {51test "call decl literal with pointer" {
52 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
53
52 const S = struct {54 const S = struct {
53 x: u32,55 x: u32,
54 fn init() *const @This() {56 fn init() *const @This() {
test/behavior/defer.zig+2
...@@ -5,6 +5,8 @@ const expectEqual = std.testing.expectEqual;...@@ -5,6 +5,8 @@ const expectEqual = std.testing.expectEqual;
5const expectError = std.testing.expectError;5const expectError = std.testing.expectError;
66
7test "break and continue inside loop inside defer expression" {7test "break and continue inside loop inside defer expression" {
8 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
9
8 testBreakContInDefer(10);10 testBreakContInDefer(10);
9 comptime testBreakContInDefer(10);11 comptime testBreakContInDefer(10);
10}12}
test/behavior/enum.zig+4
...@@ -26,6 +26,7 @@ const EnumFromIntNumber = enum { Zero, One, Two, Three, Four };...@@ -26,6 +26,7 @@ const EnumFromIntNumber = enum { Zero, One, Two, Three, Four };
2626
27test "int to enum" {27test "int to enum" {
28 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO28 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
29 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2930
30 try testEnumFromIntEval(3);31 try testEnumFromIntEval(3);
31}32}
...@@ -1059,6 +1060,7 @@ test "tag name with signed enum values" {...@@ -1059,6 +1060,7 @@ test "tag name with signed enum values" {
1059test "tag name with large enum values" {1060test "tag name with large enum values" {
1060 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1061 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1061 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1062 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1063 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
10621064
1063 const Kdf = enum(u128) {1065 const Kdf = enum(u128) {
1064 aes_kdf = 0xea4f8ac1080d74bf60448a629af3d9c9,1066 aes_kdf = 0xea4f8ac1080d74bf60448a629af3d9c9,
...@@ -1078,6 +1080,7 @@ test "tag name with large enum values" {...@@ -1078,6 +1080,7 @@ test "tag name with large enum values" {
1078test "@tagName with exotic integer enum types" {1080test "@tagName with exotic integer enum types" {
1079 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1081 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1080 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1082 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1083 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
10811084
1082 const S = struct {1085 const S = struct {
1083 fn testEnumSigned(comptime T: type) !void {1086 fn testEnumSigned(comptime T: type) !void {
...@@ -1280,6 +1283,7 @@ test "tag name functions are unique" {...@@ -1280,6 +1283,7 @@ test "tag name functions are unique" {
12801283
1281test "size of enum with only one tag which has explicit integer tag type" {1284test "size of enum with only one tag which has explicit integer tag type" {
1282 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1285 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1286 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
12831287
1284 const E = enum(u8) { nope = 10 };1288 const E = enum(u8) { nope = 10 };
1285 const S0 = struct { e: E };1289 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" {...@@ -145,6 +145,8 @@ test "implicit cast to optional to error union to return result loc" {
145}145}
146146
147test "fn returning empty error set can be passed as fn returning any error" {147test "fn returning empty error set can be passed as fn returning any error" {
148 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
149
148 entry();150 entry();
149 comptime entry();151 comptime entry();
150}152}
...@@ -526,6 +528,7 @@ test "function pointer with return type that is error union with payload which i...@@ -526,6 +528,7 @@ test "function pointer with return type that is error union with payload which i
526}528}
527529
528test "return result loc as peer result loc in inferred error set function" {530test "return result loc as peer result loc in inferred error set function" {
531 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
529 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;532 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
530 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO533 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
531 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO534 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" {...@@ -557,6 +560,7 @@ test "return result loc as peer result loc in inferred error set function" {
557}560}
558561
559test "error payload type is correctly resolved" {562test "error payload type is correctly resolved" {
563 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
560 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO564 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
561 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO565 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" {...@@ -1111,6 +1115,7 @@ test "'if' ignores error via local while 'else' ignores error directly" {
1111}1115}
11121116
1113test "@errorCast into own inferred error set" {1117test "@errorCast into own inferred error set" {
1118 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1114 const static = struct {1119 const static = struct {
1115 fn foo(b: bool) !void {1120 fn foo(b: bool) !void {
1116 if (b) {1121 if (b) {
test/behavior/eval.zig+5
...@@ -883,6 +883,8 @@ test "debug variable type resolved through indirect zero-bit types" {...@@ -883,6 +883,8 @@ test "debug variable type resolved through indirect zero-bit types" {
883}883}
884884
885test "const local with comptime init through array init" {885test "const local with comptime init through array init" {
886 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
887
886 const E1 = enum {888 const E1 = enum {
887 A,889 A,
888 pub fn a() void {}890 pub fn a() void {}
...@@ -902,6 +904,7 @@ test "const local with comptime init through array init" {...@@ -902,6 +904,7 @@ test "const local with comptime init through array init" {
902}904}
903905
904test "closure capture type of runtime-known parameter" {906test "closure capture type of runtime-known parameter" {
907 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
905 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO908 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
906909
907 const S = struct {910 const S = struct {
...@@ -1158,6 +1161,8 @@ test "repeated value is correctly expanded" {...@@ -1158,6 +1161,8 @@ test "repeated value is correctly expanded" {
1158}1161}
11591162
1160test "value in if block is comptime-known" {1163test "value in if block is comptime-known" {
1164 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1165
1161 const first = blk: {1166 const first = blk: {
1162 const s = if (false) "a" else "b";1167 const s = if (false) "a" else "b";
1163 break :blk "foo" ++ s;1168 break :blk "foo" ++ s;
test/behavior/floatop.zig+1
...@@ -1546,6 +1546,7 @@ fn testNeg(comptime T: type) !void {...@@ -1546,6 +1546,7 @@ fn testNeg(comptime T: type) !void {
15461546
1547test "negate f80" {1547test "negate f80" {
1548 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;1548 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
1549 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
15491550
1550 var f: f80 = 0.0;1551 var f: f80 = 0.0;
1551 const a: u80 = @bitCast(f);1552 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 {...@@ -292,6 +292,7 @@ fn voidFun(a: i32, b: void, c: i32, d: void) !void {
292292
293test "call function with empty string" {293test "call function with empty string" {
294 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO294 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
295 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
295296
296 acceptsString("");297 acceptsString("");
297}298}
...@@ -405,6 +406,7 @@ test "function with inferred error set but returning no error" {...@@ -405,6 +406,7 @@ test "function with inferred error set but returning no error" {
405406
406test "import passed byref to function in return type" {407test "import passed byref to function in return type" {
407 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO408 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
409 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
408410
409 const S = struct {411 const S = struct {
410 fn get() @import("std").ArrayList(i32) {412 fn get() @import("std").ArrayList(i32) {
...@@ -440,6 +442,7 @@ test "implicit cast function to function ptr" {...@@ -440,6 +442,7 @@ test "implicit cast function to function ptr" {
440test "method call with optional and error union first param" {442test "method call with optional and error union first param" {
441 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO443 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
442 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO444 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
445 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
443446
444 const S = struct {447 const S = struct {
445 x: i32 = 1234,448 x: i32 = 1234,
...@@ -744,6 +747,8 @@ test "coerce generic function making generic parameter concrete" {...@@ -744,6 +747,8 @@ test "coerce generic function making generic parameter concrete" {
744}747}
745748
746test "return undefined pointer from function, directly and by expired local" {749test "return undefined pointer from function, directly and by expired local" {
750 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
751
747 const S = struct {752 const S = struct {
748 var global: i32 = 1;753 var global: i32 = 1;
749754
test/behavior/for.zig+2
...@@ -521,6 +521,8 @@ test "return from inline for" {...@@ -521,6 +521,8 @@ test "return from inline for" {
521}521}
522522
523test "for loop 0 length range" {523test "for loop 0 length range" {
524 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
525
524 const map: []const u8 = &.{};526 const map: []const u8 = &.{};
525 for (map, 0..map.len) |i, j| {527 for (map, 0..map.len) |i, j| {
526 _ = i;528 _ = i;
test/behavior/generics.zig+3
...@@ -439,6 +439,8 @@ test "return type of generic function is function pointer" {...@@ -439,6 +439,8 @@ test "return type of generic function is function pointer" {
439}439}
440440
441test "coerced function body has inequal value with its uncoerced body" {441test "coerced function body has inequal value with its uncoerced body" {
442 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
443
442 const S = struct {444 const S = struct {
443 const A = B(i32, c);445 const A = B(i32, c);
444 fn c() !i32 {446 fn c() !i32 {
...@@ -521,6 +523,7 @@ test "call generic function with from function called by the generic function" {...@@ -521,6 +523,7 @@ test "call generic function with from function called by the generic function" {
521 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;523 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
522 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;524 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
523 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO525 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
526 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
524527
525 const GET = struct {528 const GET = struct {
526 key: []const u8,529 key: []const u8,
test/behavior/globals.zig+1
...@@ -42,6 +42,7 @@ test "slices pointing at the same address as global array." {...@@ -42,6 +42,7 @@ test "slices pointing at the same address as global array." {
42}42}
4343
44test "global loads can affect liveness" {44test "global loads can affect liveness" {
45 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
45 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest;46 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest;
46 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;47 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 {...@@ -23,6 +23,7 @@ fn foo(a: A) i32 {
2323
24test "incomplete struct param top level declaration" {24test "incomplete struct param top level declaration" {
25 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO25 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
26 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2627
27 const a = A{28 const a = A{
28 .b = B{29 .b = B{
test/behavior/inline_switch.zig+3
...@@ -45,6 +45,7 @@ const U = union(E) { a: void, b: u2, c: u3, d: u4 };...@@ -45,6 +45,7 @@ const U = union(E) { a: void, b: u2, c: u3, d: u4 };
45test "inline switch unions" {45test "inline switch unions" {
46 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO46 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
47 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO47 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
48 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
4849
49 var x: U = .a;50 var x: U = .a;
50 _ = &x;51 _ = &x;
...@@ -138,6 +139,8 @@ test "inline else int all values" {...@@ -138,6 +139,8 @@ test "inline else int all values" {
138}139}
139140
140test "inline switch capture is set when switch operand is comptime known" {141test "inline switch capture is set when switch operand is comptime known" {
142 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
143
141 const U2 = union(enum) {144 const U2 = union(enum) {
142 a: u32,145 a: u32,
143 };146 };
test/behavior/math.zig+22
...@@ -1114,6 +1114,7 @@ test "@mulWithOverflow bitsize 128 bits" {...@@ -1114,6 +1114,7 @@ test "@mulWithOverflow bitsize 128 bits" {
1114test "@mulWithOverflow > 128 bits" {1114test "@mulWithOverflow > 128 bits" {
1115 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1115 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1116 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1116 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1117 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
11171118
1118 try testMulWithOverflow(u140, 0, maxInt(u140), 0, 0);1119 try testMulWithOverflow(u140, 0, maxInt(u140), 0, 0);
1119 try testMulWithOverflow(u140, 1, maxInt(u140), maxInt(u140), 0);1120 try testMulWithOverflow(u140, 1, maxInt(u140), maxInt(u140), 0);
...@@ -1340,6 +1341,7 @@ test "@shlWithOverflow > 64 bits" {...@@ -1340,6 +1341,7 @@ test "@shlWithOverflow > 64 bits" {
1340test "@shlWithOverflow > 128 bits" {1341test "@shlWithOverflow > 128 bits" {
1341 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1342 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1342 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1343 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1344 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
13431345
1344 try testShlWithOverflow(u140, 1 << 100, 20, 1 << 120, 0);1346 try testShlWithOverflow(u140, 1 << 100, 20, 1 << 120, 0);
1345 try testShlWithOverflow(u140, 1 << 100, 40, 0, 1);1347 try testShlWithOverflow(u140, 1 << 100, 40, 0, 1);
...@@ -1369,6 +1371,7 @@ fn testAnd(comptime T: type, a: T, b: T, expected: T) !void {...@@ -1369,6 +1371,7 @@ fn testAnd(comptime T: type, a: T, b: T, expected: T) !void {
1369test "and > 128 bits" {1371test "and > 128 bits" {
1370 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1372 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1371 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1373 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1374 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
13721375
1373 try testAnd(u140, (1 << 139) | (1 << 70) | 0xaa, (1 << 139) | (1 << 69) | 0xcc, (1 << 139) | 0x88);1376 try testAnd(u140, (1 << 139) | (1 << 70) | 0xaa, (1 << 139) | (1 << 69) | 0xcc, (1 << 139) | 0x88);
1374 try testAnd(u140, maxInt(u140), 1 << 100, 1 << 100);1377 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 {...@@ -1398,6 +1401,7 @@ fn testOr(comptime T: type, a: T, b: T, expected: T) !void {
1398test "or > 128 bits" {1401test "or > 128 bits" {
1399 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1402 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1400 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1403 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1404 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
14011405
1402 try testOr(u140, 0, 1 << 139, 1 << 139);1406 try testOr(u140, 0, 1 << 139, 1 << 139);
1403 try testOr(u140, (1 << 70) | 0xa, (1 << 69) | 0x5, (1 << 70) | (1 << 69) | 0xf);1407 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 {...@@ -1427,6 +1431,7 @@ fn testXor(comptime T: type, a: T, b: T, expected: T) !void {
1427test "xor > 128 bits" {1431test "xor > 128 bits" {
1428 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1432 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1429 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1433 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1434 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
14301435
1431 try testXor(u140, 0, maxInt(u140), maxInt(u140));1436 try testXor(u140, 0, maxInt(u140), maxInt(u140));
1432 try testXor(u140, 1 << 139, 1 << 139, 0);1437 try testXor(u140, 1 << 139, 1 << 139, 0);
...@@ -1456,6 +1461,7 @@ fn testNot(comptime T: type, a: T, expected: T) !void {...@@ -1456,6 +1461,7 @@ fn testNot(comptime T: type, a: T, expected: T) !void {
1456test "not > 128 bits" {1461test "not > 128 bits" {
1457 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1462 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1458 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1463 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1464 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
14591465
1460 try testNot(u140, 0, maxInt(u140));1466 try testNot(u140, 0, maxInt(u140));
1461 try testNot(u140, maxInt(u140), 0);1467 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 {...@@ -1485,6 +1491,7 @@ fn testShl(comptime T: type, a: T, b: std.math.Log2Int(T), expected: T) !void {
1485test "shl > 128 bits" {1491test "shl > 128 bits" {
1486 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1492 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1487 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1493 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1494 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
14881495
1489 try testShl(u140, 1 << 5, 10, 1 << 15);1496 try testShl(u140, 1 << 5, 10, 1 << 15);
1490 try testShl(u140, 3, 138, (1 << 139) | (1 << 138));1497 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 {...@@ -1514,6 +1521,7 @@ fn testShr(comptime T: type, a: T, b: std.math.Log2Int(T), expected: T) !void {
1514test "shr > 128 bits" {1521test "shr > 128 bits" {
1515 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1522 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1516 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1523 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1524 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
15171525
1518 try testShr(u140, 1 << 139, 39, 1 << 100);1526 try testShr(u140, 1 << 139, 39, 1 << 100);
1519 try testShr(u140, (1 << 70) | 8, 3, (1 << 67) | 1);1527 try testShr(u140, (1 << 70) | 8, 3, (1 << 67) | 1);
...@@ -1543,6 +1551,7 @@ fn testClz(comptime T: type, a: T, expected: u16) !void {...@@ -1543,6 +1551,7 @@ fn testClz(comptime T: type, a: T, expected: u16) !void {
1543test "@clz > 128 bits" {1551test "@clz > 128 bits" {
1544 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1552 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1545 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1553 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1554 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
15461555
1547 try testClz(u140, 0, 140);1556 try testClz(u140, 0, 140);
1548 try testClz(u140, 1 << 139, 0);1557 try testClz(u140, 1 << 139, 0);
...@@ -1572,6 +1581,7 @@ fn testCtz(comptime T: type, a: T, expected: u16) !void {...@@ -1572,6 +1581,7 @@ fn testCtz(comptime T: type, a: T, expected: u16) !void {
1572test "@ctz > 128 bits" {1581test "@ctz > 128 bits" {
1573 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1582 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1574 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1583 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1584 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
15751585
1576 try testCtz(u140, 0, 140);1586 try testCtz(u140, 0, 140);
1577 try testCtz(u140, 1 << 139, 139);1587 try testCtz(u140, 1 << 139, 139);
...@@ -1601,6 +1611,7 @@ fn testPopCount(comptime T: type, a: T, expected: u16) !void {...@@ -1601,6 +1611,7 @@ fn testPopCount(comptime T: type, a: T, expected: u16) !void {
1601test "@popCount > 128 bits" {1611test "@popCount > 128 bits" {
1602 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1612 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1603 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1613 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1614 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
16041615
1605 try testPopCount(u140, 0, 0);1616 try testPopCount(u140, 0, 0);
1606 try testPopCount(u140, maxInt(u140), 140);1617 try testPopCount(u140, maxInt(u140), 140);
...@@ -1630,6 +1641,7 @@ fn testBitReverse(comptime T: type, a: T, expected: T) !void {...@@ -1630,6 +1641,7 @@ fn testBitReverse(comptime T: type, a: T, expected: T) !void {
1630test "@bitReverse > 128 bits" {1641test "@bitReverse > 128 bits" {
1631 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1642 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1632 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1643 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1644 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
16331645
1634 try testBitReverse(u140, 1 << 139, 1);1646 try testBitReverse(u140, 1 << 139, 1);
1635 try testBitReverse(u140, 1 << 70, 1 << 69);1647 try testBitReverse(u140, 1 << 70, 1 << 69);
...@@ -1659,6 +1671,7 @@ fn testByteSwap(comptime T: type, a: T, expected: T) !void {...@@ -1659,6 +1671,7 @@ fn testByteSwap(comptime T: type, a: T, expected: T) !void {
1659test "@byteSwap > 128 bits" {1671test "@byteSwap > 128 bits" {
1660 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1672 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1661 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1673 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1674 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
16621675
1663 try testByteSwap(u144, 1 << 136, 1);1676 try testByteSwap(u144, 1 << 136, 1);
1664 try testByteSwap(u144, 1, 1 << 136);1677 try testByteSwap(u144, 1, 1 << 136);
...@@ -1688,6 +1701,7 @@ fn testMax(comptime T: type, a: T, b: T, expected: T) !void {...@@ -1688,6 +1701,7 @@ fn testMax(comptime T: type, a: T, b: T, expected: T) !void {
1688test "@max > 128 bits" {1701test "@max > 128 bits" {
1689 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1702 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1690 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1703 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1704 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
16911705
1692 try testMax(u140, 0, maxInt(u140), maxInt(u140));1706 try testMax(u140, 0, maxInt(u140), maxInt(u140));
1693 try testMax(u140, 1 << 139, 1 << 138, 1 << 139);1707 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 {...@@ -1717,6 +1731,7 @@ fn testMin(comptime T: type, a: T, b: T, expected: T) !void {
1717test "@min > 128 bits" {1731test "@min > 128 bits" {
1718 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1732 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1719 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1733 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1734 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
17201735
1721 try testMin(u140, 0, maxInt(u140), 0);1736 try testMin(u140, 0, maxInt(u140), 0);
1722 try testMin(u140, 1 << 139, 1 << 138, 1 << 138);1737 try testMin(u140, 1 << 139, 1 << 138, 1 << 138);
...@@ -1746,6 +1761,7 @@ fn testAbs(comptime T: type, a: T, expected: anytype) !void {...@@ -1746,6 +1761,7 @@ fn testAbs(comptime T: type, a: T, expected: anytype) !void {
1746test "@abs > 128 bits" {1761test "@abs > 128 bits" {
1747 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1762 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1748 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1763 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1764 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
17491765
1750 try testAbs(u140, 0, 0);1766 try testAbs(u140, 0, 0);
1751 try testAbs(u140, 1 << 139, 1 << 139);1767 try testAbs(u140, 1 << 139, 1 << 139);
...@@ -1770,6 +1786,7 @@ fn testRem(comptime T: type, numerator: T, denominator: T, expected: T) !void {...@@ -1770,6 +1786,7 @@ fn testRem(comptime T: type, numerator: T, denominator: T, expected: T) !void {
1770test "@rem > 128 bits" {1786test "@rem > 128 bits" {
1771 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1787 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1772 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1788 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1789 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
17731790
1774 try testRem(u140, 0, maxInt(u140), 0);1791 try testRem(u140, 0, maxInt(u140), 0);
1775 try testRem(u140, maxInt(u140), maxInt(u140), 0);1792 try testRem(u140, maxInt(u140), maxInt(u140), 0);
...@@ -1797,6 +1814,7 @@ fn testMod(comptime T: type, numerator: T, denominator: T, expected: T) !void {...@@ -1797,6 +1814,7 @@ fn testMod(comptime T: type, numerator: T, denominator: T, expected: T) !void {
1797test "@mod > 128 bits" {1814test "@mod > 128 bits" {
1798 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1815 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1799 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1816 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1817 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
18001818
1801 try testMod(u140, 0, maxInt(u140), 0);1819 try testMod(u140, 0, maxInt(u140), 0);
1802 try testMod(u140, maxInt(u140), maxInt(u140), 0);1820 try testMod(u140, maxInt(u140), maxInt(u140), 0);
...@@ -1824,6 +1842,7 @@ fn testDivFloor(comptime T: type, numerator: T, denominator: T, expected: T) !vo...@@ -1824,6 +1842,7 @@ fn testDivFloor(comptime T: type, numerator: T, denominator: T, expected: T) !vo
1824test "@divFloor > 128 bits" {1842test "@divFloor > 128 bits" {
1825 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1843 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1826 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1844 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1845 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
18271846
1828 try testDivFloor(u140, 0, maxInt(u140), 0);1847 try testDivFloor(u140, 0, maxInt(u140), 0);
1829 try testDivFloor(u140, maxInt(u140), maxInt(u140), 1);1848 try testDivFloor(u140, maxInt(u140), maxInt(u140), 1);
...@@ -1852,6 +1871,7 @@ fn testDivTrunc(comptime T: type, numerator: T, denominator: T, expected: T) !vo...@@ -1852,6 +1871,7 @@ fn testDivTrunc(comptime T: type, numerator: T, denominator: T, expected: T) !vo
1852test "@divTrunc > 128 bits" {1871test "@divTrunc > 128 bits" {
1853 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1872 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1854 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1873 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
1874 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
18551875
1856 try testDivTrunc(u140, 0, maxInt(u140), 0);1876 try testDivTrunc(u140, 0, maxInt(u140), 0);
1857 try testDivTrunc(u140, maxInt(u140), maxInt(u140), 1);1877 try testDivTrunc(u140, maxInt(u140), maxInt(u140), 1);
...@@ -2598,6 +2618,8 @@ test "comptime float vector multiplication of zero by nan is nan" {...@@ -2598,6 +2618,8 @@ test "comptime float vector multiplication of zero by nan is nan" {
2598}2618}
25992619
2600test "i96 operations" {2620test "i96 operations" {
2621 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2622
2601 // This is coverage for some stuff used by std.Io timestamps, to catch2623 // This is coverage for some stuff used by std.Io timestamps, to catch
2602 // issues earlier than bootstrapping.2624 // issues earlier than bootstrapping.
2603 const Op_i96 = union(enum) {2625 const Op_i96 = union(enum) {
test/behavior/maximum_minimum.zig+4
...@@ -160,6 +160,7 @@ test "@min/@max more than two arguments" {...@@ -160,6 +160,7 @@ test "@min/@max more than two arguments" {
160}160}
161161
162test "@min/@max more than two vector arguments" {162test "@min/@max more than two vector arguments" {
163 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
163 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;164 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
164 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO165 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
165 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO166 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
...@@ -189,6 +190,7 @@ test "@min/@max notices bounds" {...@@ -189,6 +190,7 @@ test "@min/@max notices bounds" {
189}190}
190191
191test "@min/@max notices vector bounds" {192test "@min/@max notices vector bounds" {
193 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
192 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;194 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
193 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO195 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
194 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO196 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
...@@ -239,6 +241,7 @@ test "@min/@max notices bounds from types" {...@@ -239,6 +241,7 @@ test "@min/@max notices bounds from types" {
239}241}
240242
241test "@min/@max notices bounds from vector types" {243test "@min/@max notices bounds from vector types" {
244 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
242 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;245 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
243 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO246 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
244 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO247 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" {...@@ -348,6 +351,7 @@ test "@min/@max with runtime signed and unsigned integers of same size" {
348}351}
349352
350test "@min/@max with runtime vectors of signed and unsigned integers of same size" {353test "@min/@max with runtime vectors of signed and unsigned integers of same size" {
354 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
351 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;355 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
352 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO356 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
353 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO357 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" {...@@ -179,6 +179,8 @@ test "@memset with zero-length array" {
179}179}
180180
181test "@memset a global array" {181test "@memset a global array" {
182 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
183
182 const S = struct {184 const S = struct {
183 var buf: [1]u32 = .{123};185 var buf: [1]u32 = .{123};
184 };186 };
...@@ -190,6 +192,8 @@ test "@memset a global array" {...@@ -190,6 +192,8 @@ test "@memset a global array" {
190}192}
191193
192test "@memset array of booleans" {194test "@memset array of booleans" {
195 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
196
193 const S = struct {197 const S = struct {
194 var x: bool = false;198 var x: bool = false;
195 var y: [1]bool = undefined;199 var y: [1]bool = undefined;
test/behavior/merge_error_sets.zig+1
...@@ -13,6 +13,7 @@ fn foo() C!void {...@@ -13,6 +13,7 @@ fn foo() C!void {
1313
14test "merge error sets" {14test "merge error sets" {
15 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO15 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
16 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1617
17 if (foo()) {18 if (foo()) {
18 @panic("unexpected");19 @panic("unexpected");
test/behavior/multiple_externs_with_conflicting_types.zig+3-1
...@@ -5,7 +5,9 @@ const A = extern struct {...@@ -5,7 +5,9 @@ const A = extern struct {
5extern fn issue529(?*A) void;5extern fn issue529(?*A) void;
66
7comptime {7comptime {
8 _ = @import("conflicting_externs/b.zig");8 if (builtin.zig_backend != .stage2_spirv) {
9 _ = @import("conflicting_externs/b.zig");
10 }
9}11}
1012
11const builtin = @import("builtin");13const builtin = @import("builtin");
test/behavior/optional.zig+6
...@@ -338,6 +338,7 @@ test "coerce an anon struct literal to optional struct" {...@@ -338,6 +338,7 @@ test "coerce an anon struct literal to optional struct" {
338test "0-bit child type coerced to optional return ptr result location" {338test "0-bit child type coerced to optional return ptr result location" {
339 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO339 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
340 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO340 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
341 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
341342
342 const S = struct {343 const S = struct {
343 fn doTheTest() !void {344 fn doTheTest() !void {
...@@ -428,6 +429,7 @@ test "optional pointer to zero bit optional payload" {...@@ -428,6 +429,7 @@ test "optional pointer to zero bit optional payload" {
428 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO429 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
429 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO430 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
430 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;431 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
432 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
431433
432 const B = struct {434 const B = struct {
433 fn foo(_: *@This()) void {}435 fn foo(_: *@This()) void {}
...@@ -512,6 +514,8 @@ test "mutable optional of noreturn" {...@@ -512,6 +514,8 @@ test "mutable optional of noreturn" {
512}514}
513515
514test "orelse on C pointer" {516test "orelse on C pointer" {
517 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
518
515 // TODO https://github.com/ziglang/zig/issues/6597519 // TODO https://github.com/ziglang/zig/issues/6597
516 const foo: [*c]const u8 = "hey";520 const foo: [*c]const u8 = "hey";
517 const d = foo orelse @compileError("bad");521 const d = foo orelse @compileError("bad");
...@@ -655,6 +659,8 @@ test "result location initialization of optional with OPV payload" {...@@ -655,6 +659,8 @@ test "result location initialization of optional with OPV payload" {
655}659}
656660
657test "global comptime only optional" {661test "global comptime only optional" {
662 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
663
658 const S = struct {664 const S = struct {
659 const @"null": ?*type = null;665 const @"null": ?*type = null;
660 const @"void": ?*const type = &void;666 const @"void": ?*const type = &void;
test/behavior/packed-struct.zig+3
...@@ -248,6 +248,7 @@ test "nested packed struct unaligned" {...@@ -248,6 +248,7 @@ test "nested packed struct unaligned" {
248 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;248 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
249 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;249 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
250 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO250 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
251 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
251252
252 const S1 = packed struct {253 const S1 = packed struct {
253 a: u4,254 a: u4,
...@@ -816,6 +817,7 @@ test "packed struct passed to callconv(.c) function" {...@@ -816,6 +817,7 @@ test "packed struct passed to callconv(.c) function" {
816 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;817 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
817 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO818 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
818 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;819 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
820 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
819821
820 const S = struct {822 const S = struct {
821 const Packed = packed struct(u64) {823 const Packed = packed struct(u64) {
...@@ -893,6 +895,7 @@ test "store undefined to packed result location" {...@@ -893,6 +895,7 @@ test "store undefined to packed result location" {
893 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;895 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
894 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;896 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
895 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;897 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
898 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
896899
897 var x: u4 = 0;900 var x: u4 = 0;
898 _ = &x;901 _ = &x;
test/behavior/packed-union.zig+2
...@@ -201,6 +201,8 @@ test "packed union with explicit backing integer" {...@@ -201,6 +201,8 @@ test "packed union with explicit backing integer" {
201}201}
202202
203test "packed union equality" {203test "packed union equality" {
204 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
205
204 const Foo = packed union {206 const Foo = packed union {
205 a: u4,207 a: u4,
206 b: i4,208 b: i4,
test/behavior/pointers.zig+10
...@@ -136,6 +136,8 @@ test "implicit cast single item pointer to C pointer and back" {...@@ -136,6 +136,8 @@ test "implicit cast single item pointer to C pointer and back" {
136}136}
137137
138test "initialize const optional C pointer to null" {138test "initialize const optional C pointer to null" {
139 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
140
139 const a: ?[*c]i32 = null;141 const a: ?[*c]i32 = null;
140 try expect(a == null);142 try expect(a == null);
141 comptime assert(a == null);143 comptime assert(a == null);
...@@ -643,6 +645,8 @@ test "result type preserved through multiple references" {...@@ -643,6 +645,8 @@ test "result type preserved through multiple references" {
643}645}
644646
645test "result type found through optional pointer" {647test "result type found through optional pointer" {
648 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
649
646 const ptr1: ?*const u32 = &@intCast(123);650 const ptr1: ?*const u32 = &@intCast(123);
647 const ptr2: ?[]const u8 = &.{ @intCast(123), @truncate(0xABCD) };651 const ptr2: ?[]const u8 = &.{ @intCast(123), @truncate(0xABCD) };
648 try expect(ptr1.?.* == 123);652 try expect(ptr1.?.* == 123);
...@@ -720,6 +724,8 @@ test "cast pointers with zero sized elements" {...@@ -720,6 +724,8 @@ test "cast pointers with zero sized elements" {
720}724}
721725
722test "comptime pointer equality through distinct fields with well-defined layout" {726test "comptime pointer equality through distinct fields with well-defined layout" {
727 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
728
723 const A = extern struct {729 const A = extern struct {
724 x: u32,730 x: u32,
725 z: u16,731 z: u16,
...@@ -744,6 +750,8 @@ test "comptime pointer equality through distinct fields with well-defined layout...@@ -744,6 +750,8 @@ test "comptime pointer equality through distinct fields with well-defined layout
744}750}
745751
746test "comptime pointer equality through distinct elements with well-defined layout" {752test "comptime pointer equality through distinct elements with well-defined layout" {
753 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
754
747 const buf: [2]u32 = .{ 123, 456 };755 const buf: [2]u32 = .{ 123, 456 };
748756
749 const ptr: *const [2]u32 = &buf;757 const ptr: *const [2]u32 = &buf;
...@@ -780,6 +788,8 @@ test "pointers to elements of many-ptr to zero-bit type" {...@@ -780,6 +788,8 @@ test "pointers to elements of many-ptr to zero-bit type" {
780}788}
781789
782test "comptime C pointer to optional pointer" {790test "comptime C pointer to optional pointer" {
791 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
792
783 const opt: ?*u8 = @ptrFromInt(0x1000);793 const opt: ?*u8 = @ptrFromInt(0x1000);
784 const outer_ptr: [*c]const ?*u8 = &opt;794 const outer_ptr: [*c]const ?*u8 = &opt;
785 const inner_ptr = &outer_ptr.*.?;795 const inner_ptr = &outer_ptr.*.?;
test/behavior/ptrcast.zig+11
...@@ -193,6 +193,7 @@ const Bytes = struct {...@@ -193,6 +193,7 @@ const Bytes = struct {
193193
194test "ptrcast of const integer has the correct object size" {194test "ptrcast of const integer has the correct object size" {
195 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO195 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
196 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
196197
197 const is_value = ~@as(isize, @intCast(std.math.minInt(isize)));198 const is_value = ~@as(isize, @intCast(std.math.minInt(isize)));
198 const is_bytes = @as([*]const u8, @ptrCast(&is_value))[0..@sizeOf(isize)];199 const is_bytes = @as([*]const u8, @ptrCast(&is_value))[0..@sizeOf(isize)];
...@@ -279,6 +280,8 @@ test "@ptrCast undefined value at comptime" {...@@ -279,6 +280,8 @@ test "@ptrCast undefined value at comptime" {
279}280}
280281
281test "comptime @ptrCast with packed struct leaves value unmodified" {282test "comptime @ptrCast with packed struct leaves value unmodified" {
283 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
284
282 const S = packed struct { three: u3 };285 const S = packed struct { three: u3 };
283 const st: S = .{ .three = 6 };286 const st: S = .{ .three = 6 };
284 try expect(st.three == 6);287 try expect(st.three == 6);
...@@ -288,6 +291,8 @@ test "comptime @ptrCast with packed struct leaves value unmodified" {...@@ -288,6 +291,8 @@ test "comptime @ptrCast with packed struct leaves value unmodified" {
288}291}
289292
290test "@ptrCast restructures comptime-only array" {293test "@ptrCast restructures comptime-only array" {
294 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
295
291 {296 {
292 const a3a2: [3][2]comptime_int = .{297 const a3a2: [3][2]comptime_int = .{
293 .{ 1, 2 },298 .{ 1, 2 },
...@@ -330,6 +335,8 @@ test "@ptrCast restructures comptime-only array" {...@@ -330,6 +335,8 @@ test "@ptrCast restructures comptime-only array" {
330}335}
331336
332test "@ptrCast restructures sliced comptime-only array" {337test "@ptrCast restructures sliced comptime-only array" {
338 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
339
333 const a3a2: [4][2]comptime_int = .{340 const a3a2: [4][2]comptime_int = .{
334 .{ 1, 2 },341 .{ 1, 2 },
335 .{ 3, 4 },342 .{ 3, 4 },
...@@ -552,6 +559,8 @@ test "@ptrCast single-item pointer to slice of bytes" {...@@ -552,6 +559,8 @@ test "@ptrCast single-item pointer to slice of bytes" {
552}559}
553560
554test "@ptrCast array pointer removing sentinel" {561test "@ptrCast array pointer removing sentinel" {
562 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
563
555 const in: *const [4:0]u8 = &.{ 1, 2, 3, 4 };564 const in: *const [4:0]u8 = &.{ 1, 2, 3, 4 };
556 const out: []const i8 = @ptrCast(in);565 const out: []const i8 = @ptrCast(in);
557 comptime assert(out.len == 4);566 comptime assert(out.len == 4);
...@@ -562,6 +571,8 @@ test "@ptrCast array pointer removing sentinel" {...@@ -562,6 +571,8 @@ test "@ptrCast array pointer removing sentinel" {
562}571}
563572
564test "@ptrcast larger type to smaller one" {573test "@ptrcast larger type to smaller one" {
574 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
575
565 const T = packed struct { x: u17 };576 const T = packed struct { x: u17 };
566 const a: u32 = 0;577 const a: u32 = 0;
567 const b: *const T = @ptrCast(&a);578 const b: *const T = @ptrCast(&a);
test/behavior/saturating_arithmetic.zig+4
...@@ -362,6 +362,7 @@ test "saturating shl uses the LHS type" {...@@ -362,6 +362,7 @@ test "saturating shl uses the LHS type" {
362test "sat add > 128 bits" {362test "sat add > 128 bits" {
363 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;363 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
364 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;364 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
365 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
365366
366 try testSatAdd(u140, 0, 0, 0);367 try testSatAdd(u140, 0, 0, 0);
367 try testSatAdd(u140, maxInt(u140), 1, maxInt(u140));368 try testSatAdd(u140, maxInt(u140), 1, maxInt(u140));
...@@ -377,6 +378,7 @@ test "sat add > 128 bits" {...@@ -377,6 +378,7 @@ test "sat add > 128 bits" {
377test "sat sub > 128 bits" {378test "sat sub > 128 bits" {
378 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;379 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
379 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;380 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
381 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
380382
381 try testSatSub(u140, 0, 1, 0);383 try testSatSub(u140, 0, 1, 0);
382 try testSatSub(u140, maxInt(u140), maxInt(u140), 0);384 try testSatSub(u140, maxInt(u140), maxInt(u140), 0);
...@@ -392,6 +394,7 @@ test "sat sub > 128 bits" {...@@ -392,6 +394,7 @@ test "sat sub > 128 bits" {
392test "sat mul > 128 bits" {394test "sat mul > 128 bits" {
393 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;395 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
394 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;396 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
397 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
395398
396 try testSatMul(u140, 0, maxInt(u140), 0);399 try testSatMul(u140, 0, maxInt(u140), 0);
397 try testSatMul(u140, 1 << 70, 1 << 69, 1 << 139);400 try testSatMul(u140, 1 << 70, 1 << 69, 1 << 139);
...@@ -407,6 +410,7 @@ test "sat mul > 128 bits" {...@@ -407,6 +410,7 @@ test "sat mul > 128 bits" {
407test "sat shl > 128 bits" {410test "sat shl > 128 bits" {
408 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;411 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
409 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;412 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
413 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
410414
411 try testSatShl(u140, 0, u8, 17, 0);415 try testSatShl(u140, 0, u8, 17, 0);
412 try testSatShl(u140, 1 << 100, u8, 20, 1 << 120);416 try testSatShl(u140, 1 << 100, u8, 20, 1 << 120);
test/behavior/sizeof_and_typeof.zig+1-1
...@@ -340,7 +340,7 @@ const exp = struct {...@@ -340,7 +340,7 @@ const exp = struct {
340 }340 }
341};341};
342comptime {342comptime {
343 _ = exp;343 if (builtin.zig_backend != .stage2_spirv) _ = exp;
344}344}
345345
346test "Extern function calls in @TypeOf" {346test "Extern function calls in @TypeOf" {
test/behavior/slice.zig+14
...@@ -67,6 +67,7 @@ test "comptime slice of undefined pointer of length 0" {...@@ -67,6 +67,7 @@ test "comptime slice of undefined pointer of length 0" {
6767
68test "implicitly cast array of size 0 to slice" {68test "implicitly cast array of size 0 to slice" {
69 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO69 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
70 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
7071
71 var msg = [_]u8{};72 var msg = [_]u8{};
72 try assertLenIsZero(&msg);73 try assertLenIsZero(&msg);
...@@ -172,6 +173,7 @@ test "pass a slice of types to a function" {...@@ -172,6 +173,7 @@ test "pass a slice of types to a function" {
172173
173test "generic malloc free" {174test "generic malloc free" {
174 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO175 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
176 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
175177
176 const a = memAlloc(u8, 10) catch unreachable;178 const a = memAlloc(u8, 10) catch unreachable;
177 memFree(u8, a);179 memFree(u8, a);
...@@ -210,6 +212,8 @@ test "comptime slice of pointer preserves comptime var" {...@@ -210,6 +212,8 @@ test "comptime slice of pointer preserves comptime var" {
210}212}
211213
212test "comptime pointer cast array and then slice" {214test "comptime pointer cast array and then slice" {
215 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
216
213 const array = [_]u8{ 1, 2, 3, 4, 5, 6, 7, 8 };217 const array = [_]u8{ 1, 2, 3, 4, 5, 6, 7, 8 };
214218
215 const ptrA: [*]const u8 = @as([*]const u8, @ptrCast(&array));219 const ptrA: [*]const u8 = @as([*]const u8, @ptrCast(&array));
...@@ -276,6 +280,7 @@ test "slice string literal has correct type" {...@@ -276,6 +280,7 @@ test "slice string literal has correct type" {
276280
277test "result location zero sized array inside struct field implicit cast to slice" {281test "result location zero sized array inside struct field implicit cast to slice" {
278 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO282 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
283 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
279284
280 const E = struct {285 const E = struct {
281 entries: []u32,286 entries: []u32,
...@@ -382,6 +387,8 @@ test "obtaining a null terminated slice" {...@@ -382,6 +387,8 @@ test "obtaining a null terminated slice" {
382}387}
383388
384test "empty array to slice" {389test "empty array to slice" {
390 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
391
385 const S = struct {392 const S = struct {
386 fn doTheTest() !void {393 fn doTheTest() !void {
387 const empty: []align(16) u8 = &[_]u8{};394 const empty: []align(16) u8 = &[_]u8{};
...@@ -786,6 +793,8 @@ test "slice bounds in comptime concatenation" {...@@ -786,6 +793,8 @@ test "slice bounds in comptime concatenation" {
786}793}
787794
788test "slice sentinel access at comptime" {795test "slice sentinel access at comptime" {
796 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
797
789 {798 {
790 const str0 = &[_:0]u8{ '1', '2', '3' };799 const str0 = &[_:0]u8{ '1', '2', '3' };
791 const slice0: [:0]const u8 = str0;800 const slice0: [:0]const u8 = str0;
...@@ -852,6 +861,8 @@ test "slice len modification at comptime" {...@@ -852,6 +861,8 @@ test "slice len modification at comptime" {
852}861}
853862
854test "slice field ptr const" {863test "slice field ptr const" {
864 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
865
855 const const_slice: []const u8 = "string";866 const const_slice: []const u8 = "string";
856867
857 const const_ptr_const_slice = &const_slice;868 const const_ptr_const_slice = &const_slice;
...@@ -865,6 +876,7 @@ test "slice field ptr const" {...@@ -865,6 +876,7 @@ test "slice field ptr const" {
865876
866test "slice field ptr var" {877test "slice field ptr var" {
867 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO878 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
879 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
868880
869 var var_slice: []const u8 = "string";881 var var_slice: []const u8 = "string";
870882
...@@ -1050,6 +1062,8 @@ test "peer slices keep abi alignment with empty struct" {...@@ -1050,6 +1062,8 @@ test "peer slices keep abi alignment with empty struct" {
1050}1062}
10511063
1052test "sentinel expression in slice operation has result type" {1064test "sentinel expression in slice operation has result type" {
1065 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1066
1053 const sentinel = std.math.maxInt(u16);1067 const sentinel = std.math.maxInt(u16);
10541068
1055 const arr: [3]u16 = .{ 1, 2, sentinel };1069 const arr: [3]u16 = .{ 1, 2, sentinel };
test/behavior/string_literals.zig+2
...@@ -84,6 +84,8 @@ test "string literal pointer sentinel" {...@@ -84,6 +84,8 @@ test "string literal pointer sentinel" {
84}84}
8585
86test "sentinel slice of string literal" {86test "sentinel slice of string literal" {
87 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
88
87 const string = "Hello!\x00World!";89 const string = "Hello!\x00World!";
88 try std.testing.expect(@TypeOf(string) == *const [13:0]u8);90 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" {...@@ -342,6 +342,7 @@ test "self-referencing struct via array member" {
342}342}
343343
344test "empty struct method call" {344test "empty struct method call" {
345 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
345 const es = EmptyStruct{};346 const es = EmptyStruct{};
346 try expect(es.method() == 1234);347 try expect(es.method() == 1234);
347}348}
...@@ -991,6 +992,7 @@ test "struct with 0-length union array field" {...@@ -991,6 +992,7 @@ test "struct with 0-length union array field" {
991}992}
992993
993test "packed struct with undefined initializers" {994test "packed struct with undefined initializers" {
995 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
994 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;996 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
995 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO997 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
996 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO998 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" {...@@ -1645,6 +1647,8 @@ test "struct init with no result pointer sets field result types" {
1645}1647}
16461648
1647test "runtime side-effects in comptime-known struct init" {1649test "runtime side-effects in comptime-known struct init" {
1650 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1651
1648 var side_effects: u4 = 0;1652 var side_effects: u4 = 0;
1649 const S = struct { a: u4, b: u4, c: u4, d: u4 };1653 const S = struct { a: u4, b: u4, c: u4, d: u4 };
1650 const init = S{1654 const init = S{
...@@ -1772,6 +1776,7 @@ test "circular dependency through pointer field of a struct" {...@@ -1772,6 +1776,7 @@ test "circular dependency through pointer field of a struct" {
1772}1776}
17731777
1774test "field calls do not force struct field init resolution" {1778test "field calls do not force struct field init resolution" {
1779 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1775 const S = struct {1780 const S = struct {
1776 x: u32 = blk: {1781 x: u32 = blk: {
1777 _ = @TypeOf(make().dummyFn()); // runtime field call - S not fully resolved - dummyFn call should not force field init resolution1782 _ = @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" {...@@ -1921,6 +1926,7 @@ test "runtime value in nested initializer passed as pointer to function" {
1921}1926}
19221927
1923test "struct field default value is a call" {1928test "struct field default value is a call" {
1929 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1924 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1930 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1925 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1931 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" {...@@ -2182,6 +2188,7 @@ test "pass a pointer to a comptime-only struct field to a function" {
2182}2188}
21832189
2184test "overaligned extern struct fields" {2190test "overaligned extern struct fields" {
2191 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2185 const A = struct {2192 const A = struct {
2186 a: *anyopaque,2193 a: *anyopaque,
2187 b: u64,2194 b: u64,
...@@ -2231,6 +2238,7 @@ test "overaligned extern struct fields" {...@@ -2231,6 +2238,7 @@ test "overaligned extern struct fields" {
2231}2238}
22322239
2233test "runtime-known slice of comptime-only struct" {2240test "runtime-known slice of comptime-only struct" {
2241 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2234 const Mixed = struct { index: u32, T: type };2242 const Mixed = struct { index: u32, T: type };
22352243
2236 const static = struct {2244 const static = struct {
...@@ -2252,6 +2260,7 @@ test "runtime-known slice of comptime-only struct" {...@@ -2252,6 +2260,7 @@ test "runtime-known slice of comptime-only struct" {
2252}2260}
22532261
2254test "struct contains aligned pointer to itself through type decl" {2262test "struct contains aligned pointer to itself through type decl" {
2263 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2255 const Slab = struct {2264 const Slab = struct {
2256 const Ptr = *align(64) const @This();2265 const Ptr = *align(64) const @This();
2257 next: Ptr,2266 next: Ptr,
...@@ -2269,6 +2278,7 @@ test "struct contains aligned pointer to itself through type decl" {...@@ -2269,6 +2278,7 @@ test "struct contains aligned pointer to itself through type decl" {
2269}2278}
22702279
2271test "struct contains underaligned field with overaligned pointer to itself" {2280test "struct contains underaligned field with overaligned pointer to itself" {
2281 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2272 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO2282 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
2273 const S = struct {2283 const S = struct {
2274 ptr: *align(8) @This() align(1),2284 ptr: *align(8) @This() align(1),
...@@ -2281,6 +2291,7 @@ test "struct contains underaligned field with overaligned pointer to itself" {...@@ -2281,6 +2291,7 @@ test "struct contains underaligned field with overaligned pointer to itself" {
2281}2291}
22822292
2283test "struct contains pointer to function accepting that struct" {2293test "struct contains pointer to function accepting that struct" {
2294 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2284 const S = struct {2295 const S = struct {
2285 const FnPtr = ?*const fn (@This()) void;2296 const FnPtr = ?*const fn (@This()) void;
2286 fn_ptr: FnPtr,2297 fn_ptr: FnPtr,
...@@ -2303,6 +2314,7 @@ test "struct queries typeinfo of struct containing pointer back to first struct"...@@ -2303,6 +2314,7 @@ test "struct queries typeinfo of struct containing pointer back to first struct"
2303}2314}
23042315
2305test "pointer to runtime field of struct containing struct containing comptime-only optional" {2316test "pointer to runtime field of struct containing struct containing comptime-only optional" {
2317 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2306 const Foo = struct {2318 const Foo = struct {
2307 padding: struct { a: u8, b: ?comptime_int },2319 padding: struct { a: u8, b: ?comptime_int },
2308 number: u8,2320 number: u8,
test/behavior/switch.zig+23
...@@ -276,6 +276,7 @@ test "switch prong with variable" {...@@ -276,6 +276,7 @@ test "switch prong with variable" {
276 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO276 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
277 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO277 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
278 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;278 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
279 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
279280
280 try switchProngWithVarFn(SwitchProngWithVarEnum{ .One = 13 });281 try switchProngWithVarFn(SwitchProngWithVarEnum{ .One = 13 });
281 try switchProngWithVarFn(SwitchProngWithVarEnum{ .Two = 13.0 });282 try switchProngWithVarFn(SwitchProngWithVarEnum{ .Two = 13.0 });
...@@ -299,6 +300,7 @@ fn switchProngWithVarFn(a: SwitchProngWithVarEnum) !void {...@@ -299,6 +300,7 @@ fn switchProngWithVarFn(a: SwitchProngWithVarEnum) !void {
299test "switch on enum using pointer capture" {300test "switch on enum using pointer capture" {
300 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO301 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
301 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO302 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
303 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
302304
303 try testSwitchEnumPtrCapture();305 try testSwitchEnumPtrCapture();
304 try comptime testSwitchEnumPtrCapture();306 try comptime testSwitchEnumPtrCapture();
...@@ -359,6 +361,7 @@ fn testSwitchHandleAllCasesRange(x: u8) u8 {...@@ -359,6 +361,7 @@ fn testSwitchHandleAllCasesRange(x: u8) u8 {
359test "switch on union with some prongs capturing" {361test "switch on union with some prongs capturing" {
360 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO362 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
361 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO363 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
364 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
362365
363 const X = union(enum) {366 const X = union(enum) {
364 a,367 a,
...@@ -395,6 +398,7 @@ test "switch on const enum with var" {...@@ -395,6 +398,7 @@ test "switch on const enum with var" {
395398
396test "anon enum literal used in switch on union enum" {399test "anon enum literal used in switch on union enum" {
397 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO400 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
401 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
398402
399 const Foo = union(enum) {403 const Foo = union(enum) {
400 a: i32,404 a: i32,
...@@ -576,6 +580,7 @@ test "switch with null and T peer types and inferred result location type" {...@@ -576,6 +580,7 @@ test "switch with null and T peer types and inferred result location type" {
576test "switch prongs with cases with identical payload types" {580test "switch prongs with cases with identical payload types" {
577 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO581 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
578 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO582 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
583 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
579584
580 const Union = union(enum) {585 const Union = union(enum) {
581 A: usize,586 A: usize,
...@@ -617,6 +622,8 @@ test "switch prongs with cases with identical payload types" {...@@ -617,6 +622,8 @@ test "switch prongs with cases with identical payload types" {
617}622}
618623
619test "switch prong pointer capture alignment" {624test "switch prong pointer capture alignment" {
625 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
626
620 const U = union(enum) {627 const U = union(enum) {
621 a: u8 align(8),628 a: u8 align(8),
622 b: u8 align(4),629 b: u8 align(4),
...@@ -840,6 +847,7 @@ test "switch capture peer type resolution" {...@@ -840,6 +847,7 @@ test "switch capture peer type resolution" {
840847
841test "switch capture peer type resolution for in-memory coercible payloads" {848test "switch capture peer type resolution for in-memory coercible payloads" {
842 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;849 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
850 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
843851
844 const T1 = c_int;852 const T1 = c_int;
845 const t1_info = @typeInfo(T1).int;853 const t1_info = @typeInfo(T1).int;
...@@ -863,6 +871,7 @@ test "switch capture peer type resolution for in-memory coercible payloads" {...@@ -863,6 +871,7 @@ test "switch capture peer type resolution for in-memory coercible payloads" {
863871
864test "switch pointer capture peer type resolution" {872test "switch pointer capture peer type resolution" {
865 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;873 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
874 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
866875
867 const T1 = c_int;876 const T1 = c_int;
868 const t1_info = @typeInfo(T1).int;877 const t1_info = @typeInfo(T1).int;
...@@ -968,6 +977,8 @@ test "switch prong captures range" {...@@ -968,6 +977,8 @@ test "switch prong captures range" {
968}977}
969978
970test "prong with inline call to unreachable" {979test "prong with inline call to unreachable" {
980 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
981
971 const U = union(enum) {982 const U = union(enum) {
972 void: void,983 void: void,
973 bool: bool,984 bool: bool,
...@@ -1174,6 +1185,8 @@ test "switch with uninstantiable union fields" {...@@ -1174,6 +1185,8 @@ test "switch with uninstantiable union fields" {
1174}1185}
11751186
1176test "switch with tag capture" {1187test "switch with tag capture" {
1188 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1189
1177 const U = union(enum) {1190 const U = union(enum) {
1178 a,1191 a,
1179 b: i32,1192 b: i32,
...@@ -1307,6 +1320,8 @@ test "single-item prong in switch on enum has comptime-known capture" {...@@ -1307,6 +1320,8 @@ test "single-item prong in switch on enum has comptime-known capture" {
1307}1320}
13081321
1309test "single range switch prong capture" {1322test "single range switch prong capture" {
1323 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1324
1310 const S = struct {1325 const S = struct {
1311 fn doTheTest(x: u8) !void {1326 fn doTheTest(x: u8) !void {
1312 switch (x) {1327 switch (x) {
...@@ -1328,6 +1343,8 @@ test "single range switch prong capture" {...@@ -1328,6 +1343,8 @@ test "single range switch prong capture" {
1328}1343}
13291344
1330test "switch on packed struct" {1345test "switch on packed struct" {
1346 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1347
1331 const P = packed struct {1348 const P = packed struct {
1332 a: u1,1349 a: u1,
1333 b: u1,1350 b: u1,
...@@ -1358,6 +1375,8 @@ test "switch on packed struct" {...@@ -1358,6 +1375,8 @@ test "switch on packed struct" {
1358}1375}
13591376
1360test "switch on packed union" {1377test "switch on packed union" {
1378 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1379
1361 const P = packed union(u2) {1380 const P = packed union(u2) {
1362 a: u2,1381 a: u2,
1363 b: i2,1382 b: i2,
...@@ -1405,6 +1424,8 @@ test "switch on packed union" {...@@ -1405,6 +1424,8 @@ test "switch on packed union" {
1405}1424}
14061425
1407test "switch on nested packed containers" {1426test "switch on nested packed containers" {
1427 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1428
1408 const P = packed struct {1429 const P = packed struct {
1409 iu: u17,1430 iu: u17,
1410 is: i31,1431 is: i31,
...@@ -1458,6 +1479,8 @@ test "switch on nested packed containers" {...@@ -1458,6 +1479,8 @@ test "switch on nested packed containers" {
1458}1479}
14591480
1460test "switch on large types" {1481test "switch on large types" {
1482 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1483
1461 const S = struct {1484 const S = struct {
1462 fn doTheTest(a: u128, b: i500) !void {1485 fn doTheTest(a: u128, b: i500) !void {
1463 switch (a) {1486 switch (a) {
test/behavior/switch_loop.zig+10
...@@ -397,6 +397,8 @@ test "switch loop on type with opv" {...@@ -397,6 +397,8 @@ test "switch loop on type with opv" {
397}397}
398398
399test "switch loop with tag capture" {399test "switch loop with tag capture" {
400 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
401
400 const U = union(enum) {402 const U = union(enum) {
401 a,403 a,
402 b: i32,404 b: i32,
...@@ -467,6 +469,8 @@ test "switch loop with tag capture" {...@@ -467,6 +469,8 @@ test "switch loop with tag capture" {
467}469}
468470
469test "switch loop for error handling" {471test "switch loop for error handling" {
472 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
473
470 const Error = error{ MyError, MyOtherError };474 const Error = error{ MyError, MyOtherError };
471 const S = struct {475 const S = struct {
472 fn doTheTest() !void {476 fn doTheTest() !void {
...@@ -511,6 +515,8 @@ test "switch loop for error handling" {...@@ -511,6 +515,8 @@ test "switch loop for error handling" {
511}515}
512516
513test "switch loop with packed structs" {517test "switch loop with packed structs" {
518 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
519
514 const P = packed struct {520 const P = packed struct {
515 a: u7,521 a: u7,
516 b: u20,522 b: u20,
...@@ -528,6 +534,8 @@ test "switch loop with packed structs" {...@@ -528,6 +534,8 @@ test "switch loop with packed structs" {
528}534}
529535
530test "switch loop with packed unions" {536test "switch loop with packed unions" {
537 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
538
531 const P = packed union {539 const P = packed union {
532 a: u7,540 a: u7,
533 b: i7,541 b: i7,
...@@ -566,6 +574,8 @@ test "switch loop with packed unions with OPV" {...@@ -566,6 +574,8 @@ test "switch loop with packed unions with OPV" {
566}574}
567575
568test "switch loop on large types" {576test "switch loop on large types" {
577 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
578
569 const S = struct {579 const S = struct {
570 fn doTheTest(a: u128, b: i500) !void {580 fn doTheTest(a: u128, b: i500) !void {
571 label: switch (a) {581 label: switch (a) {
test/behavior/switch_prong_err_enum.zig+1
...@@ -24,6 +24,7 @@ test "switch prong returns error enum" {...@@ -24,6 +24,7 @@ test "switch prong returns error enum" {
24 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;24 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
25 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO25 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
26 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;26 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
27 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2728
28 switch (doThing(17) catch unreachable) {29 switch (doThing(17) catch unreachable) {
29 FormValue.Address => |payload| {30 FormValue.Address => |payload| {
test/behavior/switch_prong_implicit_cast.zig+1
...@@ -18,6 +18,7 @@ test "switch prong implicit cast" {...@@ -18,6 +18,7 @@ test "switch prong implicit cast" {
18 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;18 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
19 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;19 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
20 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO20 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
21 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2122
22 const result = switch (foo(2) catch unreachable) {23 const result = switch (foo(2) catch unreachable) {
23 FormValue.One => false,24 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 {...@@ -50,6 +50,7 @@ fn testTruncate(comptime S: type, a: S, comptime D: type, expected: D) !void {
50test "@truncate > 128 bits" {50test "@truncate > 128 bits" {
51 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;51 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
52 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;52 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
53 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
5354
54 try testTruncate(u140, 0, u128, 0);55 try testTruncate(u140, 0, u128, 0);
55 try testTruncate(u140, maxInt(u140), u128, maxInt(u128));56 try testTruncate(u140, maxInt(u140), u128, maxInt(u128));
test/behavior/tuple.zig+2
...@@ -559,6 +559,8 @@ test "OPV tuple fields aren't comptime" {...@@ -559,6 +559,8 @@ test "OPV tuple fields aren't comptime" {
559}559}
560560
561test "array of tuples that end with a zero-bit field followed by padding" {561test "array of tuples that end with a zero-bit field followed by padding" {
562 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
563
562 const S = struct {564 const S = struct {
563 var foo: [2]struct { u32, u8, void } = .{ .{ 1, 2, {} }, .{ 3, 4, {} } };565 var foo: [2]struct { u32, u8, void } = .{ .{ 1, 2, {} }, .{ 3, 4, {} } };
564 };566 };
test/behavior/type.zig+1
...@@ -277,6 +277,7 @@ test "Type.Union from empty Type.Enum" {...@@ -277,6 +277,7 @@ test "Type.Union from empty Type.Enum" {
277277
278test "Type.Fn" {278test "Type.Fn" {
279 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO279 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
280 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
280281
281 const some_opaque = opaque {};282 const some_opaque = opaque {};
282 const some_ptr = *some_opaque;283 const some_ptr = *some_opaque;
test/behavior/type_info.zig+4
...@@ -310,6 +310,8 @@ const TestStruct = struct {...@@ -310,6 +310,8 @@ const TestStruct = struct {
310};310};
311311
312test "type info: packed struct info" {312test "type info: packed struct info" {
313 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
314
313 try testPackedStruct();315 try testPackedStruct();
314 try comptime testPackedStruct();316 try comptime testPackedStruct();
315}317}
...@@ -594,6 +596,8 @@ test "value from struct @typeInfo default_value_ptr can be loaded at comptime" {...@@ -594,6 +596,8 @@ test "value from struct @typeInfo default_value_ptr can be loaded at comptime" {
594}596}
595597
596test "type info of tuple of string literal default value" {598test "type info of tuple of string literal default value" {
599 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
600
597 const struct_info = @typeInfo(@TypeOf(.{"hi"})).@"struct";601 const struct_info = @typeInfo(@TypeOf(.{"hi"})).@"struct";
598 const struct_field_attrs = struct_info.field_attrs[0];602 const struct_field_attrs = struct_info.field_attrs[0];
599 const struct_field_type = struct_info.field_types[0];603 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" {...@@ -31,6 +31,7 @@ test "init union with runtime value - floats" {
31 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;31 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
32 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO32 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
33 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;33 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
34 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
3435
35 var foo: FooWithFloats = undefined;36 var foo: FooWithFloats = undefined;
3637
...@@ -407,6 +408,7 @@ test "tagged union with no payloads" {...@@ -407,6 +408,7 @@ test "tagged union with no payloads" {
407408
408test "union with only 1 field casted to its enum type" {409test "union with only 1 field casted to its enum type" {
409 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO410 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
411 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
410412
411 const Literal = union(enum) {413 const Literal = union(enum) {
412 Number: f64,414 Number: f64,
...@@ -443,6 +445,7 @@ var glbl: Foo1 = undefined;...@@ -443,6 +445,7 @@ var glbl: Foo1 = undefined;
443test "global union with single field is correctly initialized" {445test "global union with single field is correctly initialized" {
444 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;446 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
445 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO447 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
448 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
446449
447 glbl = Foo1{450 glbl = Foo1{
448 .f = @typeInfo(Foo1).@"union".field_types[0]{ .x = 123 },451 .f = @typeInfo(Foo1).@"union".field_types[0]{ .x = 123 },
...@@ -485,6 +488,7 @@ test "update the tag value for zero-sized unions" {...@@ -485,6 +488,7 @@ test "update the tag value for zero-sized unions" {
485test "union initializer generates padding only if needed" {488test "union initializer generates padding only if needed" {
486 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;489 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
487 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO490 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
491 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
488492
489 const U = union(enum) {493 const U = union(enum) {
490 A: u24,494 A: u24,
...@@ -550,6 +554,7 @@ const Baz = enum { A, B, C, D };...@@ -550,6 +554,7 @@ const Baz = enum { A, B, C, D };
550554
551test "tagged union type" {555test "tagged union type" {
552 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO556 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
557 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
553558
554 const foo1 = TaggedFoo{ .One = 13 };559 const foo1 = TaggedFoo{ .One = 13 };
555 const foo2 = TaggedFoo{560 const foo2 = TaggedFoo{
...@@ -654,6 +659,7 @@ fn testEnumWithSpecifiedAndUnspecifiedTagValues(x: MultipleChoice2) !void {...@@ -654,6 +659,7 @@ fn testEnumWithSpecifiedAndUnspecifiedTagValues(x: MultipleChoice2) !void {
654test "switch on union with only 1 field" {659test "switch on union with only 1 field" {
655 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO660 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
656 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO661 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
662 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
657663
658 var r: PartialInst = undefined;664 var r: PartialInst = undefined;
659 r = PartialInst.Compiled;665 r = PartialInst.Compiled;
...@@ -682,6 +688,7 @@ const PartialInstWithPayload = union(enum) {...@@ -682,6 +688,7 @@ const PartialInstWithPayload = union(enum) {
682688
683test "union with only 1 field casted to its enum type which has enum value specified" {689test "union with only 1 field casted to its enum type which has enum value specified" {
684 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO690 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
691 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
685692
686 const Literal = union(enum) {693 const Literal = union(enum) {
687 number: f64,694 number: f64,
...@@ -706,6 +713,7 @@ test "union with only 1 field casted to its enum type which has enum value speci...@@ -706,6 +713,7 @@ test "union with only 1 field casted to its enum type which has enum value speci
706test "@intFromEnum works on unions" {713test "@intFromEnum works on unions" {
707 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO714 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
708 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO715 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
716 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
709717
710 const Bar = union(enum) {718 const Bar = union(enum) {
711 A: bool,719 A: bool,
...@@ -765,6 +773,7 @@ test "return union init with void payload" {...@@ -765,6 +773,7 @@ test "return union init with void payload" {
765 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;773 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
766 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;774 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
767 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO775 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
776 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
768777
769 const S = struct {778 const S = struct {
770 fn entry() !void {779 fn entry() !void {
...@@ -789,6 +798,7 @@ test "@unionInit stored to a const" {...@@ -789,6 +798,7 @@ test "@unionInit stored to a const" {
789 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO798 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
790 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO799 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
791 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;800 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
801 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
792802
793 const S = struct {803 const S = struct {
794 const U = union(enum) {804 const U = union(enum) {
...@@ -818,6 +828,7 @@ test "@unionInit stored to a const" {...@@ -818,6 +828,7 @@ test "@unionInit stored to a const" {
818test "@unionInit can modify a union type" {828test "@unionInit can modify a union type" {
819 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO829 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
820 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO830 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
831 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
821832
822 const UnionInitEnum = union(enum) {833 const UnionInitEnum = union(enum) {
823 Boolean: bool,834 Boolean: bool,
...@@ -840,6 +851,7 @@ test "@unionInit can modify a union type" {...@@ -840,6 +851,7 @@ test "@unionInit can modify a union type" {
840test "@unionInit can modify a pointer value" {851test "@unionInit can modify a pointer value" {
841 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO852 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
842 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO853 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
854 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
843855
844 const UnionInitEnum = union(enum) {856 const UnionInitEnum = union(enum) {
845 Boolean: bool,857 Boolean: bool,
...@@ -914,6 +926,7 @@ test "function call result coerces from tagged union to the tag" {...@@ -914,6 +926,7 @@ test "function call result coerces from tagged union to the tag" {
914 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;926 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
915 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO927 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
916 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO928 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
929 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
917930
918 const S = struct {931 const S = struct {
919 const Arch = union(enum) {932 const Arch = union(enum) {
...@@ -948,6 +961,7 @@ test "function call result coerces from tagged union to the tag" {...@@ -948,6 +961,7 @@ test "function call result coerces from tagged union to the tag" {
948test "switching on non exhaustive union" {961test "switching on non exhaustive union" {
949 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO962 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
950 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO963 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
964 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
951965
952 const S = struct {966 const S = struct {
953 const E = enum(u8) {967 const E = enum(u8) {
...@@ -1004,6 +1018,7 @@ test "containers with single-field enums" {...@@ -1004,6 +1018,7 @@ test "containers with single-field enums" {
1004test "@unionInit on union with u8 tag but no fields" {1018test "@unionInit on union with u8 tag but no fields" {
1005 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1019 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1006 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1020 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1021 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
10071022
1008 const S = struct {1023 const S = struct {
1009 const Type = enum(u8) { no_op = 105 };1024 const Type = enum(u8) { no_op = 105 };
...@@ -1108,6 +1123,8 @@ test "union with a large struct field" {...@@ -1108,6 +1123,8 @@ test "union with a large struct field" {
1108}1123}
11091124
1110test "comptime equality of extern unions with same tag" {1125test "comptime equality of extern unions with same tag" {
1126 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1127
1111 const S = struct {1128 const S = struct {
1112 const U = extern union {1129 const U = extern union {
1113 a: i32,1130 a: i32,
...@@ -1126,6 +1143,7 @@ test "union tag is set when initiated as a temporary value at runtime" {...@@ -1126,6 +1143,7 @@ test "union tag is set when initiated as a temporary value at runtime" {
1126 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1143 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1127 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1144 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1128 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1145 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1146 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
11291147
1130 const U = union(enum) {1148 const U = union(enum) {
1131 a,1149 a,
...@@ -1165,6 +1183,7 @@ test "return an extern union from C calling convention" {...@@ -1165,6 +1183,7 @@ test "return an extern union from C calling convention" {
1165 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1183 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1166 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1184 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1167 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1185 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1186 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
11681187
1169 const namespace = struct {1188 const namespace = struct {
1170 const S = extern struct {1189 const S = extern struct {
...@@ -1246,6 +1265,7 @@ test "@unionInit uses tag value instead of field index" {...@@ -1246,6 +1265,7 @@ test "@unionInit uses tag value instead of field index" {
1246 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1265 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1247 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1266 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1248 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1267 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1268 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
12491269
1250 const E = enum(u8) {1270 const E = enum(u8) {
1251 b = 255,1271 b = 255,
...@@ -1303,6 +1323,7 @@ test "packed union in packed struct" {...@@ -1303,6 +1323,7 @@ test "packed union in packed struct" {
1303 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1323 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1304 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1324 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1305 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1325 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1326 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
13061327
1307 const S = packed struct {1328 const S = packed struct {
1308 nested: packed union {1329 nested: packed union {
...@@ -1374,6 +1395,7 @@ test "no dependency loop when function pointer in union returns the union" {...@@ -1374,6 +1395,7 @@ test "no dependency loop when function pointer in union returns the union" {
1374test "union reassignment can use previous value" {1395test "union reassignment can use previous value" {
1375 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1396 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1376 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1397 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1398 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
13771399
1378 const U = union {1400 const U = union {
1379 a: u32,1401 a: u32,
...@@ -1386,6 +1408,7 @@ test "union reassignment can use previous value" {...@@ -1386,6 +1408,7 @@ test "union reassignment can use previous value" {
13861408
1387test "reinterpreting enum value inside packed union" {1409test "reinterpreting enum value inside packed union" {
1388 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1410 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1411 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
13891412
1390 const U = packed union {1413 const U = packed union {
1391 tag: enum(u8) { a, b },1414 tag: enum(u8) { a, b },
...@@ -1864,6 +1887,7 @@ test "extern union initialized via reintepreted struct field initializer" {...@@ -1864,6 +1887,7 @@ test "extern union initialized via reintepreted struct field initializer" {
18641887
1865test "packed union initialized via reintepreted struct field initializer" {1888test "packed union initialized via reintepreted struct field initializer" {
1866 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1889 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1890 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
18671891
1868 const bytes = [_]u8{ 0xaa, 0xbb, 0xcc, 0xdd };1892 const bytes = [_]u8{ 0xaa, 0xbb, 0xcc, 0xdd };
18691893
...@@ -1909,6 +1933,7 @@ test "store of comptime reinterpreted memory to extern union" {...@@ -1909,6 +1933,7 @@ test "store of comptime reinterpreted memory to extern union" {
19091933
1910test "store of comptime reinterpreted memory to packed union" {1934test "store of comptime reinterpreted memory to packed union" {
1911 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1935 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1936 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
19121937
1913 const bytes = [_]u8{ 0xaa, 0xbb, 0xcc, 0xdd };1938 const bytes = [_]u8{ 0xaa, 0xbb, 0xcc, 0xdd };
19141939
...@@ -2256,6 +2281,8 @@ test "assign global tagged union" {...@@ -2256,6 +2281,8 @@ test "assign global tagged union" {
2256}2281}
22572282
2258test "set mutable union by switching on same union" {2283test "set mutable union by switching on same union" {
2284 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2285
2259 const U = union(enum) {2286 const U = union(enum) {
2260 foo,2287 foo,
2261 bar: usize,2288 bar: usize,
test/behavior/vector.zig+12
...@@ -8,6 +8,7 @@ const expectEqual = std.testing.expectEqual;...@@ -8,6 +8,7 @@ const expectEqual = std.testing.expectEqual;
88
9test "implicit cast vector to array - bool" {9test "implicit cast vector to array - bool" {
10 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;10 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
11 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1112
12 const S = struct {13 const S = struct {
13 fn doTheTest() !void {14 fn doTheTest() !void {
...@@ -30,6 +31,7 @@ test "implicit cast vector to array - bool" {...@@ -30,6 +31,7 @@ test "implicit cast vector to array - bool" {
30}31}
3132
32test "implicit cast array to vector - bool" {33test "implicit cast array to vector - bool" {
34 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
33 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;35 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
3436
35 const S = struct {37 const S = struct {
...@@ -311,6 +313,7 @@ test "peer type resolution with coercible element types" {...@@ -311,6 +313,7 @@ test "peer type resolution with coercible element types" {
311}313}
312314
313test "tuple to vector" {315test "tuple to vector" {
316 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
314 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;317 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
315 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO318 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
316 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO319 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
...@@ -413,6 +416,7 @@ test "vector @splat" {...@@ -413,6 +416,7 @@ test "vector @splat" {
413}416}
414417
415test "load vector elements via comptime index" {418test "load vector elements via comptime index" {
419 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
416 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO420 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
417 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO421 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
418422
...@@ -433,6 +437,7 @@ test "load vector elements via comptime index" {...@@ -433,6 +437,7 @@ test "load vector elements via comptime index" {
433}437}
434438
435test "store vector elements via comptime index" {439test "store vector elements via comptime index" {
440 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
436 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO441 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
437 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO442 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
438443
...@@ -1223,6 +1228,7 @@ test "@subWithOverflow" {...@@ -1223,6 +1228,7 @@ test "@subWithOverflow" {
1223}1228}
12241229
1225test "@mulWithOverflow" {1230test "@mulWithOverflow" {
1231 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1226 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1232 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1227 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1233 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1228 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1234 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
...@@ -1243,6 +1249,7 @@ test "@mulWithOverflow" {...@@ -1243,6 +1249,7 @@ test "@mulWithOverflow" {
1243}1249}
12441250
1245test "@shlWithOverflow" {1251test "@shlWithOverflow" {
1252 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1246 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1253 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1247 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1254 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1248 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1255 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
...@@ -1371,6 +1378,7 @@ test "zero multiplicand" {...@@ -1371,6 +1378,7 @@ test "zero multiplicand" {
1371 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1378 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1372 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO1379 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO
1373 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1380 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1381 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
13741382
1375 const zeros = @Vector(2, u32){ 0.0, 0.0 };1383 const zeros = @Vector(2, u32){ 0.0, 0.0 };
1376 var ones = @Vector(2, u32){ 1.0, 1.0 };1384 var ones = @Vector(2, u32){ 1.0, 1.0 };
...@@ -1413,6 +1421,7 @@ test "modRem with zero divisor" {...@@ -1413,6 +1421,7 @@ test "modRem with zero divisor" {
1413}1421}
14141422
1415test "array operands to shuffle are coerced to vectors" {1423test "array operands to shuffle are coerced to vectors" {
1424 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1416 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1425 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1417 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1426 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1418 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1427 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
...@@ -1438,6 +1447,7 @@ test "load packed vector element" {...@@ -1438,6 +1447,7 @@ test "load packed vector element" {
1438}1447}
14391448
1440test "store packed vector element" {1449test "store packed vector element" {
1450 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1441 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1451 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1442 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1452 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1443 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1453 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
...@@ -1500,6 +1510,7 @@ test "store vector with memset" {...@@ -1500,6 +1510,7 @@ test "store vector with memset" {
1500}1510}
15011511
1502test "addition of vectors represented as strings" {1512test "addition of vectors represented as strings" {
1513 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1503 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1514 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1504 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1515 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
15051516
...@@ -1510,6 +1521,7 @@ test "addition of vectors represented as strings" {...@@ -1510,6 +1521,7 @@ test "addition of vectors represented as strings" {
1510}1521}
15111522
1512test "compare vectors with different element types" {1523test "compare vectors with different element types" {
1524 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1513 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1525 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1514 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1526 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1515 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1527 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" {...@@ -401,6 +401,8 @@ test "breaking from a loop in an if statement" {
401}401}
402402
403test "labeled break from else" {403test "labeled break from else" {
404 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
405
404 const S = struct {406 const S = struct {
405 fn doTheTest(x: u32) !void {407 fn doTheTest(x: u32) !void {
406 const arr: []const u32 = &.{ 1, 3, 10 };408 const arr: []const u32 = &.{ 1, 3, 10 };