| ... | @@ -12,6 +12,8 @@ test "switch with numbers" { | ... | @@ -12,6 +12,8 @@ test "switch with numbers" { |
| 12 | } | 12 | } |
| 13 | | 13 | |
| 14 | fn testSwitchWithNumbers(x: u32) !void { | 14 | fn testSwitchWithNumbers(x: u32) !void { |
| | 15 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // TODO |
| | 16 | |
| 15 | const result = switch (x) { | 17 | const result = switch (x) { |
| 16 | 1, 2, 3, 4...8 => false, | 18 | 1, 2, 3, 4...8 => false, |
| 17 | 13 => true, | 19 | 13 => true, |
| ... | @@ -22,6 +24,7 @@ fn testSwitchWithNumbers(x: u32) !void { | ... | @@ -22,6 +24,7 @@ fn testSwitchWithNumbers(x: u32) !void { |
| 22 | | 24 | |
| 23 | test "switch with all ranges" { | 25 | test "switch with all ranges" { |
| 24 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 26 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| | 27 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // TODO |
| 25 | | 28 | |
| 26 | try expect(testSwitchWithAllRanges(50, 3) == 1); | 29 | try expect(testSwitchWithAllRanges(50, 3) == 1); |
| 27 | try expect(testSwitchWithAllRanges(101, 0) == 2); | 30 | try expect(testSwitchWithAllRanges(101, 0) == 2); |
| ... | @@ -173,6 +176,7 @@ test "undefined.u0" { | ... | @@ -173,6 +176,7 @@ test "undefined.u0" { |
| 173 | | 176 | |
| 174 | test "switch with disjoint range" { | 177 | test "switch with disjoint range" { |
| 175 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 178 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| | 179 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // TODO |
| 176 | | 180 | |
| 177 | var q: u8 = 0; | 181 | var q: u8 = 0; |
| 178 | _ = &q; | 182 | _ = &q; |
| ... | @@ -184,6 +188,8 @@ test "switch with disjoint range" { | ... | @@ -184,6 +188,8 @@ test "switch with disjoint range" { |
| 184 | } | 188 | } |
| 185 | | 189 | |
| 186 | test "switch variable for range and multiple prongs" { | 190 | test "switch variable for range and multiple prongs" { |
| | 191 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // TODO |
| | 192 | |
| 187 | const S = struct { | 193 | const S = struct { |
| 188 | fn doTheTest() !void { | 194 | fn doTheTest() !void { |
| 189 | try doTheSwitch(16); | 195 | try doTheSwitch(16); |
| ... | @@ -281,6 +287,8 @@ test "switch handles all cases of number" { | ... | @@ -281,6 +287,8 @@ test "switch handles all cases of number" { |
| 281 | } | 287 | } |
| 282 | | 288 | |
| 283 | fn testSwitchHandleAllCases() !void { | 289 | fn testSwitchHandleAllCases() !void { |
| | 290 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // TODO |
| | 291 | |
| 284 | try expect(testSwitchHandleAllCasesExhaustive(0) == 3); | 292 | try expect(testSwitchHandleAllCasesExhaustive(0) == 3); |
| 285 | try expect(testSwitchHandleAllCasesExhaustive(1) == 2); | 293 | try expect(testSwitchHandleAllCasesExhaustive(1) == 2); |
| 286 | try expect(testSwitchHandleAllCasesExhaustive(2) == 1); | 294 | try expect(testSwitchHandleAllCasesExhaustive(2) == 1); |
| ... | @@ -497,6 +505,7 @@ test "switch prongs with error set cases make a new error set type for capture v | ... | @@ -497,6 +505,7 @@ test "switch prongs with error set cases make a new error set type for capture v |
| 497 | | 505 | |
| 498 | test "return result loc and then switch with range implicit casted to error union" { | 506 | test "return result loc and then switch with range implicit casted to error union" { |
| 499 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 507 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| | 508 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // TODO |
| 500 | | 509 | |
| 501 | const S = struct { | 510 | const S = struct { |
| 502 | fn doTheTest() !void { | 511 | fn doTheTest() !void { |
| ... | @@ -714,6 +723,7 @@ test "switch capture copies its payload" { | ... | @@ -714,6 +723,7 @@ test "switch capture copies its payload" { |
| 714 | | 723 | |
| 715 | test "capture of integer forwards the switch condition directly" { | 724 | test "capture of integer forwards the switch condition directly" { |
| 716 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 725 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| | 726 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // TODO |
| 717 | | 727 | |
| 718 | const S = struct { | 728 | const S = struct { |
| 719 | fn foo(x: u8) !void { | 729 | fn foo(x: u8) !void { |
| ... | @@ -854,6 +864,7 @@ test "inline switch range that includes the maximum value of the switched type" | ... | @@ -854,6 +864,7 @@ test "inline switch range that includes the maximum value of the switched type" |
| 854 | | 864 | |
| 855 | test "nested break ignores switch conditions and breaks instead" { | 865 | test "nested break ignores switch conditions and breaks instead" { |
| 856 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 866 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| | 867 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 857 | | 868 | |
| 858 | const S = struct { | 869 | const S = struct { |
| 859 | fn register_to_address(ident: []const u8) !u8 { | 870 | fn register_to_address(ident: []const u8) !u8 { |
| ... | @@ -901,6 +912,7 @@ test "peer type resolution on switch captures ignores unused payload bits" { | ... | @@ -901,6 +912,7 @@ test "peer type resolution on switch captures ignores unused payload bits" { |
| 901 | test "switch prong captures range" { | 912 | test "switch prong captures range" { |
| 902 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO | 913 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 903 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 914 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| | 915 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // TODO |
| 904 | | 916 | |
| 905 | const S = struct { | 917 | const S = struct { |
| 906 | fn a(b: []u3, c: u3) void { | 918 | fn a(b: []u3, c: u3) void { |
| ... | @@ -935,6 +947,8 @@ test "prong with inline call to unreachable" { | ... | @@ -935,6 +947,8 @@ test "prong with inline call to unreachable" { |
| 935 | } | 947 | } |
| 936 | | 948 | |
| 937 | test "block error return trace index is reset between prongs" { | 949 | test "block error return trace index is reset between prongs" { |
| | 950 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // TODO |
| | 951 | |
| 938 | const S = struct { | 952 | const S = struct { |
| 939 | fn returnError() error{TestFailed} { | 953 | fn returnError() error{TestFailed} { |
| 940 | return error.TestFailed; | 954 | return error.TestFailed; |
| ... | @@ -963,6 +977,8 @@ test "block error return trace index is reset between prongs" { | ... | @@ -963,6 +977,8 @@ test "block error return trace index is reset between prongs" { |
| 963 | } | 977 | } |
| 964 | | 978 | |
| 965 | test "labeled switch with break" { | 979 | test "labeled switch with break" { |
| | 980 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // TODO |
| | 981 | |
| 966 | var six: u32 = undefined; | 982 | var six: u32 = undefined; |
| 967 | six = 6; | 983 | six = 6; |
| 968 | | 984 | |