authorgravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2026-09-13 16:41:22+03:30
committergravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2026-09-18 16:36:24+03:30
log65b95b0af42b3da0aaa86c9448e32e8aca388a17
treeb23b76af4f22bf95692d10c858be9f4d41b4fb9f
parentc4c3818c396dc57e1422356f3bb865d99c0c27e8

add unskip_spirv_tests.zig tool


40 files changed, 331 insertions(+), 63 deletions(-)

test/behavior/addrspace_and_linksection.zig+4
...@@ -12,6 +12,8 @@ const var_linksection = linksections.?[1];...@@ -12,6 +12,8 @@ const var_linksection = linksections.?[1];
12const fn_linksection = linksections.?[2];12const fn_linksection = linksections.?[2];
1313
14test "addrspace on container-level const" {14test "addrspace on container-level const" {
15 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
16
15 const S = struct {17 const S = struct {
16 const a: u32 addrspace(.generic) = 123;18 const a: u32 addrspace(.generic) = 123;
17 fn check(ptr: anytype) !void {19 fn check(ptr: anytype) !void {
...@@ -47,6 +49,8 @@ test "addrspace and linksection on container-level const" {...@@ -47,6 +49,8 @@ test "addrspace and linksection on container-level const" {
47}49}
4850
49test "addrspace on container-level var" {51test "addrspace on container-level var" {
52 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
53
50 const S = struct {54 const S = struct {
51 var a: u32 addrspace(.generic) = 123;55 var a: u32 addrspace(.generic) = 123;
52 fn check(ptr: anytype) !void {56 fn check(ptr: anytype) !void {
test/behavior/align.zig+1
...@@ -467,6 +467,7 @@ var default_aligned_global = DefaultAligned{...@@ -467,6 +467,7 @@ var default_aligned_global = DefaultAligned{
467};467};
468468
469test "read 128-bit field from default aligned struct in global memory" {469test "read 128-bit field from default aligned struct in global memory" {
470 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
470 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO471 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO
471 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;472 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
472 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO473 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
test/behavior/array.zig+1-1
...@@ -582,6 +582,7 @@ test "array with comptime-only element type" {...@@ -582,6 +582,7 @@ test "array with comptime-only element type" {
582}582}
583583
584test "tuple to array handles sentinel" {584test "tuple to array handles sentinel" {
585 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
585 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO586 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
586 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO587 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
587588
...@@ -936,7 +937,6 @@ test "accessing multidimensional global array at comptime" {...@@ -936,7 +937,6 @@ test "accessing multidimensional global array at comptime" {
936937
937test "union that needs padding bytes inside an array" {938test "union that needs padding bytes inside an array" {
938 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;939 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
939 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
940 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;940 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
941 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO941 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
942942
test/behavior/basic.zig+6
...@@ -60,6 +60,7 @@ const g1: i32 = 1233 + 1;...@@ -60,6 +60,7 @@ const g1: i32 = 1233 + 1;
60var g2: i32 = 0;60var g2: i32 = 0;
6161
62test "global variables" {62test "global variables" {
63 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
63 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO64 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
6465
65 try expect(g2 == 0);66 try expect(g2 == 0);
...@@ -683,6 +684,7 @@ var gdt = [_]GDTEntry{...@@ -683,6 +684,7 @@ var gdt = [_]GDTEntry{
683var global_ptr = &gdt[0];684var global_ptr = &gdt[0];
684685
685test "global constant is loaded with a runtime-known index" {686test "global constant is loaded with a runtime-known index" {
687 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
686 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO688 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
687689
688 const S = struct {690 const S = struct {
...@@ -999,6 +1001,8 @@ test "generic function uses return type of other generic function" {...@@ -999,6 +1001,8 @@ test "generic function uses return type of other generic function" {
999}1001}
10001002
1001test "const alloc with comptime-known initializer is made comptime-known" {1003test "const alloc with comptime-known initializer is made comptime-known" {
1004 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1005
1002 const S = struct {1006 const S = struct {
1003 a: bool,1007 a: bool,
1004 b: [2]u8,1008 b: [2]u8,
...@@ -1079,6 +1083,8 @@ test "inline call of function with a switch inside the return statement" {...@@ -1079,6 +1083,8 @@ test "inline call of function with a switch inside the return statement" {
1079}1083}
10801084
1081test "pointer to zero sized global is mutable" {1085test "pointer to zero sized global is mutable" {
1086 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1087
1082 const S = struct {1088 const S = struct {
1083 const Thing = struct {};1089 const Thing = struct {};
10841090
test/behavior/bitcast.zig-1
...@@ -110,7 +110,6 @@ test "@bitCast packed structs at runtime and comptime" {...@@ -110,7 +110,6 @@ test "@bitCast packed structs at runtime and comptime" {
110 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;110 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
111 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;111 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
112 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO112 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
113 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
114113
115 const Full = packed struct {114 const Full = packed struct {
116 number: u16,115 number: u16,
test/behavior/call.zig+2
...@@ -538,6 +538,8 @@ test "call function pointer in comptime field" {...@@ -538,6 +538,8 @@ test "call function pointer in comptime field" {
538}538}
539539
540test "generic function pointer can be called" {540test "generic function pointer can be called" {
541 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
542
541 const S = struct {543 const S = struct {
542 var ok = false;544 var ok = false;
543 fn foo(x: anytype) void {545 fn foo(x: anytype) void {
test/behavior/comptime_memory.zig+2
...@@ -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);
test/behavior/decl_literals.zig-1
...@@ -35,7 +35,6 @@ test "decl literal with pointer" {...@@ -35,7 +35,6 @@ test "decl literal with pointer" {
35test "call decl literal with optional" {35test "call decl literal with optional" {
36 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest;36 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest;
37 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;37 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
38 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
3938
40 const S = struct {39 const S = struct {
41 x: u32,40 x: u32,
test/behavior/defer.zig+1
...@@ -89,6 +89,7 @@ fn runSomeErrorDefers(x: bool) !bool {...@@ -89,6 +89,7 @@ fn runSomeErrorDefers(x: bool) !bool {
89}89}
9090
91test "mixing normal and error defers" {91test "mixing normal and error defers" {
92 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
92 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO93 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
93 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO94 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
9495
test/behavior/enum.zig-1
...@@ -930,7 +930,6 @@ test "constant enum initialization with differing sizes" {...@@ -930,7 +930,6 @@ test "constant enum initialization with differing sizes" {
930 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;930 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
931 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO931 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
932 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;932 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
933 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
934 try test3_1(test3_foo);933 try test3_1(test3_foo);
935 try test3_2(test3_bar);934 try test3_2(test3_bar);
936}935}
test/behavior/error.zig+3-1
...@@ -524,7 +524,6 @@ test "function pointer with return type that is error union with payload which i...@@ -524,7 +524,6 @@ test "function pointer with return type that is error union with payload which i
524}524}
525525
526test "return result loc as peer result loc in inferred error set function" {526test "return result loc as peer result loc in inferred error set function" {
527 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
528 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;527 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
529 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO528 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
530 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO529 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
...@@ -783,6 +782,7 @@ const NoReturn = struct {...@@ -783,6 +782,7 @@ const NoReturn = struct {
783};782};
784783
785test "error union of noreturn used with if" {784test "error union of noreturn used with if" {
785 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
786 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO786 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
787 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO787 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
788 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;788 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
...@@ -796,6 +796,7 @@ test "error union of noreturn used with if" {...@@ -796,6 +796,7 @@ test "error union of noreturn used with if" {
796}796}
797797
798test "error union of noreturn used with try" {798test "error union of noreturn used with try" {
799 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
799 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO800 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
800 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO801 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
801 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;802 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
...@@ -806,6 +807,7 @@ test "error union of noreturn used with try" {...@@ -806,6 +807,7 @@ test "error union of noreturn used with try" {
806}807}
807808
808test "error union of noreturn used with catch" {809test "error union of noreturn used with catch" {
810 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
809 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO811 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
810 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO812 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
811 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;813 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
test/behavior/eval.zig+13
...@@ -5,6 +5,8 @@ const expect = std.testing.expect;...@@ -5,6 +5,8 @@ const expect = std.testing.expect;
5const expectEqual = std.testing.expectEqual;5const expectEqual = std.testing.expectEqual;
66
7test "compile time recursion" {7test "compile time recursion" {
8 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
9
8 try expect(some_data.len == 21);10 try expect(some_data.len == 21);
9}11}
10var some_data: [@as(usize, @intCast(fibonacci(7)))]u8 = undefined;12var some_data: [@as(usize, @intCast(fibonacci(7)))]u8 = undefined;
...@@ -388,6 +390,7 @@ test "return 0 from function that has u0 return type" {...@@ -388,6 +390,7 @@ test "return 0 from function that has u0 return type" {
388}390}
389391
390test "statically initialized struct" {392test "statically initialized struct" {
393 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
391 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO394 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
392395
393 st_init_str_foo.x += 1;396 st_init_str_foo.x += 1;
...@@ -927,6 +930,7 @@ test "closure capture type of runtime-known var" {...@@ -927,6 +930,7 @@ test "closure capture type of runtime-known var" {
927}930}
928931
929test "comptime break passing through runtime condition converted to runtime break" {932test "comptime break passing through runtime condition converted to runtime break" {
933 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
930 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO934 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
931935
932 const S = struct {936 const S = struct {
...@@ -959,6 +963,7 @@ test "comptime break passing through runtime condition converted to runtime brea...@@ -959,6 +963,7 @@ test "comptime break passing through runtime condition converted to runtime brea
959}963}
960964
961test "comptime break to outer loop passing through runtime condition converted to runtime break" {965test "comptime break to outer loop passing through runtime condition converted to runtime break" {
966 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
962 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO967 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
963 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO968 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
964969
...@@ -1158,6 +1163,8 @@ test "repeated value is correctly expanded" {...@@ -1158,6 +1163,8 @@ test "repeated value is correctly expanded" {
1158}1163}
11591164
1160test "value in if block is comptime-known" {1165test "value in if block is comptime-known" {
1166 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1167
1161 const first = blk: {1168 const first = blk: {
1162 const s = if (false) "a" else "b";1169 const s = if (false) "a" else "b";
1163 break :blk "foo" ++ s;1170 break :blk "foo" ++ s;
...@@ -1266,6 +1273,8 @@ test "continue in inline for inside a comptime switch" {...@@ -1266,6 +1273,8 @@ test "continue in inline for inside a comptime switch" {
1266}1273}
12671274
1268test "length of global array is determinable at comptime" {1275test "length of global array is determinable at comptime" {
1276 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1277
1269 const S = struct {1278 const S = struct {
1270 var bytes: [1024]u8 = undefined;1279 var bytes: [1024]u8 = undefined;
12711280
...@@ -1313,6 +1322,7 @@ test "continue nested inline for loop in named block expr" {...@@ -1313,6 +1322,7 @@ test "continue nested inline for loop in named block expr" {
1313}1322}
13141323
1315test "x and false is comptime-known false" {1324test "x and false is comptime-known false" {
1325 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1316 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1326 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
13171327
1318 const T = struct {1328 const T = struct {
...@@ -1340,6 +1350,7 @@ test "x and false is comptime-known false" {...@@ -1340,6 +1350,7 @@ test "x and false is comptime-known false" {
1340}1350}
13411351
1342test "x or true is comptime-known true" {1352test "x or true is comptime-known true" {
1353 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1343 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1354 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
13441355
1345 const T = struct {1356 const T = struct {
...@@ -1401,6 +1412,8 @@ test "comptime function turns function value to function pointer" {...@@ -1401,6 +1412,8 @@ test "comptime function turns function value to function pointer" {
1401}1412}
14021413
1403test "container level const and var have unique addresses" {1414test "container level const and var have unique addresses" {
1415 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1416
1404 const S = struct {1417 const S = struct {
1405 x: i32,1418 x: i32,
1406 y: i32,1419 y: i32,
test/behavior/export_builtin.zig+2
...@@ -4,6 +4,7 @@ const expect = std.testing.expect;...@@ -4,6 +4,7 @@ const expect = std.testing.expect;
44
5test "exporting enum value" {5test "exporting enum value" {
6 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;6 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
7 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
78
8 const S = struct {9 const S = struct {
9 const E = enum(c_int) { one, two };10 const E = enum(c_int) { one, two };
...@@ -29,6 +30,7 @@ test "exporting with internal linkage" {...@@ -29,6 +30,7 @@ test "exporting with internal linkage" {
2930
30test "exporting using namespace access" {31test "exporting using namespace access" {
31 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;32 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
33 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
3234
33 const S = struct {35 const S = struct {
34 const Inner = struct {36 const Inner = struct {
test/behavior/floatop.zig-7
...@@ -464,7 +464,6 @@ test "@sqrt with vectors" {...@@ -464,7 +464,6 @@ test "@sqrt with vectors" {
464 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;464 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
465 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO465 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
466 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;466 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
467 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
468467
469 try testSqrtWithVectors();468 try testSqrtWithVectors();
470 try comptime testSqrtWithVectors();469 try comptime testSqrtWithVectors();
...@@ -532,7 +531,6 @@ test "@sin with vectors" {...@@ -532,7 +531,6 @@ test "@sin with vectors" {
532 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;531 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
533 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO532 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
534 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;533 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
535 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
536534
537 try testSinWithVectors();535 try testSinWithVectors();
538 try comptime testSinWithVectors();536 try comptime testSinWithVectors();
...@@ -600,7 +598,6 @@ test "@cos with vectors" {...@@ -600,7 +598,6 @@ test "@cos with vectors" {
600 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;598 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
601 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO599 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
602 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;600 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
603 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
604601
605 try testCosWithVectors();602 try testCosWithVectors();
606 try comptime testCosWithVectors();603 try comptime testCosWithVectors();
...@@ -668,7 +665,6 @@ test "@tan with vectors" {...@@ -668,7 +665,6 @@ test "@tan with vectors" {
668 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;665 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
669 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO666 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
670 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;667 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
671 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
672668
673 try testTanWithVectors();669 try testTanWithVectors();
674 try comptime testTanWithVectors();670 try comptime testTanWithVectors();
...@@ -740,7 +736,6 @@ test "@exp with vectors" {...@@ -740,7 +736,6 @@ test "@exp with vectors" {
740 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;736 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
741 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO737 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
742 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;738 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
743 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
744739
745 try testExpWithVectors();740 try testExpWithVectors();
746 try comptime testExpWithVectors();741 try comptime testExpWithVectors();
...@@ -807,7 +802,6 @@ test "@exp2 with @vectors" {...@@ -807,7 +802,6 @@ test "@exp2 with @vectors" {
807 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;802 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
808 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO803 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
809 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;804 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
810 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
811805
812 try testExp2WithVectors();806 try testExp2WithVectors();
813 try comptime testExp2WithVectors();807 try comptime testExp2WithVectors();
...@@ -939,7 +933,6 @@ test "@log2 with vectors" {...@@ -939,7 +933,6 @@ test "@log2 with vectors" {
939 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;933 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
940 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO934 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
941 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;935 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
942 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
943 // https://github.com/ziglang/zig/issues/13681936 // https://github.com/ziglang/zig/issues/13681
944 if (builtin.zig_backend == .stage2_llvm and937 if (builtin.zig_backend == .stage2_llvm and
945 builtin.cpu.arch == .aarch64 and938 builtin.cpu.arch == .aarch64 and
test/behavior/generics.zig+1
...@@ -516,6 +516,7 @@ test "comptime callconv(.c) function ptr uses comptime type argument" {...@@ -516,6 +516,7 @@ test "comptime callconv(.c) function ptr uses comptime type argument" {
516}516}
517517
518test "call generic function with from function called by the generic function" {518test "call generic function with from function called by the generic function" {
519 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
519 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;520 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
520 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;521 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
521 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO522 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
test/behavior/globals.zig+2-4
...@@ -4,6 +4,7 @@ const expect = std.testing.expect;...@@ -4,6 +4,7 @@ const expect = std.testing.expect;
44
5var pos = [2]f32{ 0.0, 0.0 };5var pos = [2]f32{ 0.0, 0.0 };
6test "store to global array" {6test "store to global array" {
7 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
7 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest;8 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest;
8 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;9 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
910
...@@ -14,6 +15,7 @@ test "store to global array" {...@@ -14,6 +15,7 @@ test "store to global array" {
1415
15var vpos = @Vector(2, f32){ 0.0, 0.0 };16var vpos = @Vector(2, f32){ 0.0, 0.0 };
16test "store to global vector" {17test "store to global vector" {
18 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
17 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest;19 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest;
18 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;20 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
1921
...@@ -66,8 +68,6 @@ test "global loads can affect liveness" {...@@ -66,8 +68,6 @@ test "global loads can affect liveness" {
66}68}
6769
68test "global const can be self-referential" {70test "global const can be self-referential" {
69 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
70
71 const S = struct {71 const S = struct {
72 self: *const @This(),72 self: *const @This(),
73 x: u32,73 x: u32,
...@@ -112,8 +112,6 @@ test "global var can be self-referential" {...@@ -112,8 +112,6 @@ test "global var can be self-referential" {
112}112}
113113
114test "global const can be indirectly self-referential" {114test "global const can be indirectly self-referential" {
115 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
116
117 const S = struct {115 const S = struct {
118 other: *const @This(),116 other: *const @This(),
119 x: u32,117 x: u32,
test/behavior/if.zig+1
...@@ -44,6 +44,7 @@ var global_with_val: anyerror!u32 = 0;...@@ -44,6 +44,7 @@ var global_with_val: anyerror!u32 = 0;
44var global_with_err: anyerror!u32 = error.SomeError;44var global_with_err: anyerror!u32 = error.SomeError;
4545
46test "unwrap mutable global var" {46test "unwrap mutable global var" {
47 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
47 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO48 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
4849
49 if (global_with_val) |v| {50 if (global_with_val) |v| {
test/behavior/inline_switch.zig-2
...@@ -4,7 +4,6 @@ const builtin = @import("builtin");...@@ -4,7 +4,6 @@ const builtin = @import("builtin");
44
5test "inline scalar prongs" {5test "inline scalar prongs" {
6 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO6 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
7 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
87
9 var x: usize = 0;8 var x: usize = 0;
10 switch (x) {9 switch (x) {
...@@ -19,7 +18,6 @@ test "inline scalar prongs" {...@@ -19,7 +18,6 @@ test "inline scalar prongs" {
1918
20test "inline prong ranges" {19test "inline prong ranges" {
21 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO20 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
22 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2321
24 var x: usize = 0;22 var x: usize = 0;
25 _ = &x;23 _ = &x;
test/behavior/ir_block_deps.zig-1
...@@ -19,7 +19,6 @@ fn getErrInt() anyerror!i32 {...@@ -19,7 +19,6 @@ fn getErrInt() anyerror!i32 {
1919
20test "ir block deps" {20test "ir block deps" {
21 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO21 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
22 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
23 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO22 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
2423
25 try expect((foo(1) catch unreachable) == 0);24 try expect((foo(1) catch unreachable) == 0);
test/behavior/math.zig+1
...@@ -2570,6 +2570,7 @@ test "partially-runtime integer vector division would be illegal if vector eleme...@@ -2570,6 +2570,7 @@ test "partially-runtime integer vector division would be illegal if vector eleme
2570 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO2570 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
2571 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO2571 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
2572 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;2572 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
2573 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2573 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;2574 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
25742575
2575 var lhs: @Vector(2, i8) = .{ -128, 5 };2576 var lhs: @Vector(2, i8) = .{ -128, 5 };
test/behavior/null.zig+1
...@@ -183,6 +183,7 @@ const SillyStruct = struct {...@@ -183,6 +183,7 @@ const SillyStruct = struct {
183const here_is_a_null_literal = SillyStruct{ .context = null };183const here_is_a_null_literal = SillyStruct{ .context = null };
184184
185test "unwrap optional which is field of global var" {185test "unwrap optional which is field of global var" {
186 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
186 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;187 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
187 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO188 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
188189
test/behavior/optional.zig+2-4
...@@ -319,7 +319,6 @@ test "assigning to an unwrapped optional field in an inline loop" {...@@ -319,7 +319,6 @@ test "assigning to an unwrapped optional field in an inline loop" {
319test "coerce an anon struct literal to optional struct" {319test "coerce an anon struct literal to optional struct" {
320 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO320 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
321 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO321 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
322 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
323322
324 const S = struct {323 const S = struct {
325 const Struct = struct {324 const Struct = struct {
...@@ -388,7 +387,6 @@ test "0-bit child type coerced to optional" {...@@ -388,7 +387,6 @@ test "0-bit child type coerced to optional" {
388test "array of optional unaligned types" {387test "array of optional unaligned types" {
389 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO388 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
390 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO389 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
391 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
392390
393 const Enum = enum { one, two, three };391 const Enum = enum { one, two, three };
394392
...@@ -477,6 +475,7 @@ const NoReturn = struct {...@@ -477,6 +475,7 @@ const NoReturn = struct {
477};475};
478476
479test "optional of noreturn used with if" {477test "optional of noreturn used with if" {
478 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
480 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO479 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
481480
482 NoReturn.a = 64;481 NoReturn.a = 64;
...@@ -488,6 +487,7 @@ test "optional of noreturn used with if" {...@@ -488,6 +487,7 @@ test "optional of noreturn used with if" {
488}487}
489488
490test "optional of noreturn used with orelse" {489test "optional of noreturn used with orelse" {
490 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
491 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO491 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
492492
493 NoReturn.a = 64;493 NoReturn.a = 64;
...@@ -652,8 +652,6 @@ test "result location initialization of optional with OPV payload" {...@@ -652,8 +652,6 @@ test "result location initialization of optional with OPV payload" {
652}652}
653653
654test "global comptime only optional" {654test "global comptime only optional" {
655 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
656
657 const S = struct {655 const S = struct {
658 const @"null": ?*type = null;656 const @"null": ?*type = null;
659 const @"void": ?*const type = &void;657 const @"void": ?*const type = &void;
test/behavior/packed-struct.zig-9
...@@ -794,7 +794,6 @@ test "nested packed struct at non-zero offset 2" {...@@ -794,7 +794,6 @@ test "nested packed struct at non-zero offset 2" {
794test "runtime init of unnamed packed struct type" {794test "runtime init of unnamed packed struct type" {
795 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;795 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
796 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO796 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
797 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
798797
799 var z: u8 = 123;798 var z: u8 = 123;
800 _ = &z;799 _ = &z;
...@@ -889,7 +888,6 @@ test "store undefined to packed result location" {...@@ -889,7 +888,6 @@ test "store undefined to packed result location" {
889 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;888 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
890 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;889 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
891 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;890 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
892 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
893891
894 var x: u4 = 0;892 var x: u4 = 0;
895 _ = &x;893 _ = &x;
...@@ -910,7 +908,6 @@ test "bitcast back and forth" {...@@ -910,7 +908,6 @@ test "bitcast back and forth" {
910// Originally reported at https://github.com/ziglang/zig/issues/14200908// Originally reported at https://github.com/ziglang/zig/issues/14200
911test "field access of packed struct smaller than its abi size inside struct initialized with rls" {909test "field access of packed struct smaller than its abi size inside struct initialized with rls" {
912 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;910 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
913 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
914 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO911 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO
915912
916 const S = struct {913 const S = struct {
...@@ -1006,7 +1003,6 @@ test "packed struct acts as a namespace" {...@@ -1006,7 +1003,6 @@ test "packed struct acts as a namespace" {
1006test "assignment to non-byte-aligned field in packed struct" {1003test "assignment to non-byte-aligned field in packed struct" {
1007 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1004 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1008 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1005 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1009 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1010 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO1006 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO
10111007
1012 const Frame = packed struct {1008 const Frame = packed struct {
...@@ -1046,7 +1042,6 @@ test "load flag from packed struct in union" {...@@ -1046,7 +1042,6 @@ test "load flag from packed struct in union" {
1046 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1042 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1047 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1043 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1048 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1044 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1049 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1050 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1045 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
10511046
1052 const A = packed struct {1047 const A = packed struct {
...@@ -1168,7 +1163,6 @@ test "packed struct equality" {...@@ -1168,7 +1163,6 @@ test "packed struct equality" {
11681163
1169test "packed struct equality ignores padding bits" {1164test "packed struct equality ignores padding bits" {
1170 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1165 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1171 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
11721166
1173 const S = packed struct { b: bool };1167 const S = packed struct { b: bool };
1174 var s: S = undefined;1168 var s: S = undefined;
...@@ -1178,7 +1172,6 @@ test "packed struct equality ignores padding bits" {...@@ -1178,7 +1172,6 @@ test "packed struct equality ignores padding bits" {
1178}1172}
11791173
1180test "packed struct with signed field" {1174test "packed struct with signed field" {
1181 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1182 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1175 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
11831176
1184 var s: packed struct {1177 var s: packed struct {
...@@ -1193,7 +1186,6 @@ test "packed struct with signed field" {...@@ -1193,7 +1186,6 @@ test "packed struct with signed field" {
1193test "assign packed struct initialized with RLS to packed struct literal field" {1186test "assign packed struct initialized with RLS to packed struct literal field" {
1194 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1187 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1195 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1188 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1196 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
11971189
1198 const Inner = packed struct { x: u17 };1190 const Inner = packed struct { x: u17 };
1199 const Outer = packed struct { inner: Inner, x: u15 };1191 const Outer = packed struct { inner: Inner, x: u15 };
...@@ -1209,7 +1201,6 @@ test "assign packed struct initialized with RLS to packed struct literal field"...@@ -1209,7 +1201,6 @@ test "assign packed struct initialized with RLS to packed struct literal field"
12091201
1210test "packed struct store of comparison result" {1202test "packed struct store of comparison result" {
1211 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1203 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1212 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1213 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO1204 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO
12141205
1215 const S1 = packed struct {1206 const S1 = packed struct {
test/behavior/pointers.zig+2
...@@ -642,6 +642,8 @@ test "result type preserved through multiple references" {...@@ -642,6 +642,8 @@ test "result type preserved through multiple references" {
642}642}
643643
644test "result type found through optional pointer" {644test "result type found through optional pointer" {
645 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
646
645 const ptr1: ?*const u32 = &@intCast(123);647 const ptr1: ?*const u32 = &@intCast(123);
646 const ptr2: ?[]const u8 = &.{ @intCast(123), @truncate(0xABCD) };648 const ptr2: ?[]const u8 = &.{ @intCast(123), @truncate(0xABCD) };
647 try expect(ptr1.?.* == 123);649 try expect(ptr1.?.* == 123);
test/behavior/shuffle.zig-1
...@@ -176,7 +176,6 @@ test "@shuffle u0" {...@@ -176,7 +176,6 @@ test "@shuffle u0" {
176 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO176 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
177 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO177 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
178 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;178 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
179 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
180179
181 const S = struct {180 const S = struct {
182 fn doTheTest() !void {181 fn doTheTest() !void {
test/behavior/sizeof_and_typeof.zig+1
...@@ -134,6 +134,7 @@ test "@TypeOf() has no runtime side effects" {...@@ -134,6 +134,7 @@ test "@TypeOf() has no runtime side effects" {
134}134}
135135
136test "branching logic inside @TypeOf" {136test "branching logic inside @TypeOf" {
137 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
137 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;138 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
138139
139 const S = struct {140 const S = struct {
test/behavior/slice.zig+1-2
...@@ -254,8 +254,6 @@ test "slicing pointer by length" {...@@ -254,8 +254,6 @@ test "slicing pointer by length" {
254const x = @as([*]i32, @ptrFromInt(0x1000))[0..0x500];254const x = @as([*]i32, @ptrFromInt(0x1000))[0..0x500];
255const y = x[0x100..];255const y = x[0x100..];
256test "compile time slice of pointer to hard coded address" {256test "compile time slice of pointer to hard coded address" {
257 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
258
259 try expect(@intFromPtr(x) == 0x1000);257 try expect(@intFromPtr(x) == 0x1000);
260 try expect(x.len == 0x500);258 try expect(x.len == 0x500);
261259
...@@ -858,6 +856,7 @@ test "slice len modification at comptime" {...@@ -858,6 +856,7 @@ test "slice len modification at comptime" {
858}856}
859857
860test "slice field ptr const" {858test "slice field ptr const" {
859 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
861 const const_slice: []const u8 = "string";860 const const_slice: []const u8 = "string";
862861
863 const const_ptr_const_slice = &const_slice;862 const const_ptr_const_slice = &const_slice;
test/behavior/splat.zig+1
...@@ -92,6 +92,7 @@ test "splat with an error union or optional result type" {...@@ -92,6 +92,7 @@ test "splat with an error union or optional result type" {
92}92}
9393
94test "read/write through global variable array of struct fields initialized via splat" {94test "read/write through global variable array of struct fields initialized via splat" {
95 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
95 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO96 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
96 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO97 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
9798
test/behavior/struct.zig+5-2
...@@ -443,6 +443,7 @@ test "packed struct 24bits" {...@@ -443,6 +443,7 @@ test "packed struct 24bits" {
443}443}
444444
445test "runtime struct initialization of bitfield" {445test "runtime struct initialization of bitfield" {
446 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
446 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;447 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
447 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO448 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
448 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO449 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
...@@ -714,6 +715,7 @@ test "packed struct with u0 field access" {...@@ -714,6 +715,7 @@ test "packed struct with u0 field access" {
714}715}
715716
716test "access to global struct fields" {717test "access to global struct fields" {
718 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
717 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO719 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
718720
719 g_foo.bar.value = 42;721 g_foo.bar.value = 42;
...@@ -943,7 +945,6 @@ test "tuple element initialized with fn call" {...@@ -943,7 +945,6 @@ test "tuple element initialized with fn call" {
943}945}
944946
945test "struct with union field" {947test "struct with union field" {
946 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
947 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO948 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
948 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO949 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
949950
...@@ -1081,7 +1082,6 @@ test "anon init through error unions and optionals" {...@@ -1081,7 +1082,6 @@ test "anon init through error unions and optionals" {
1081test "anon init through optional" {1082test "anon init through optional" {
1082 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1083 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1083 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1084 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1084 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
10851085
1086 const S = struct {1086 const S = struct {
1087 a: u32,1087 a: u32,
...@@ -1760,6 +1760,8 @@ test "circular dependency through pointer field of a struct" {...@@ -1760,6 +1760,8 @@ test "circular dependency through pointer field of a struct" {
1760}1760}
17611761
1762test "field calls do not force struct field init resolution" {1762test "field calls do not force struct field init resolution" {
1763 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1764
1763 const S = struct {1765 const S = struct {
1764 x: u32 = blk: {1766 x: u32 = blk: {
1765 _ = @TypeOf(make().dummyFn()); // runtime field call - S not fully resolved - dummyFn call should not force field init resolution1767 _ = @TypeOf(make().dummyFn()); // runtime field call - S not fully resolved - dummyFn call should not force field init resolution
...@@ -1985,6 +1987,7 @@ test "assignment of field with padding" {...@@ -1985,6 +1987,7 @@ test "assignment of field with padding" {
1985}1987}
19861988
1987test "initiate global variable with runtime value" {1989test "initiate global variable with runtime value" {
1990 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1988 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;1991 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
1989 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1992 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
19901993
test/behavior/switch.zig+1-10
...@@ -252,6 +252,7 @@ fn poll() void {...@@ -252,6 +252,7 @@ fn poll() void {
252}252}
253253
254test "switch on global mutable var isn't constant-folded" {254test "switch on global mutable var isn't constant-folded" {
255 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
255 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO256 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
256257
257 while (state < 2) {258 while (state < 2) {
...@@ -270,7 +271,6 @@ test "switch prong with variable" {...@@ -270,7 +271,6 @@ test "switch prong with variable" {
270 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO271 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
271 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO272 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
272 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;273 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
273 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
274274
275 try switchProngWithVarFn(SwitchProngWithVarEnum{ .One = 13 });275 try switchProngWithVarFn(SwitchProngWithVarEnum{ .One = 13 });
276 try switchProngWithVarFn(SwitchProngWithVarEnum{ .Two = 13.0 });276 try switchProngWithVarFn(SwitchProngWithVarEnum{ .Two = 13.0 });
...@@ -294,7 +294,6 @@ fn switchProngWithVarFn(a: SwitchProngWithVarEnum) !void {...@@ -294,7 +294,6 @@ fn switchProngWithVarFn(a: SwitchProngWithVarEnum) !void {
294test "switch on enum using pointer capture" {294test "switch on enum using pointer capture" {
295 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO295 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
296 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO296 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
297 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
298297
299 try testSwitchEnumPtrCapture();298 try testSwitchEnumPtrCapture();
300 try comptime testSwitchEnumPtrCapture();299 try comptime testSwitchEnumPtrCapture();
...@@ -570,7 +569,6 @@ test "switch with null and T peer types and inferred result location type" {...@@ -570,7 +569,6 @@ test "switch with null and T peer types and inferred result location type" {
570test "switch prongs with cases with identical payload types" {569test "switch prongs with cases with identical payload types" {
571 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO570 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
572 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO571 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
573 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
574572
575 const Union = union(enum) {573 const Union = union(enum) {
576 A: usize,574 A: usize,
...@@ -726,7 +724,6 @@ test "switch on error set with single else" {...@@ -726,7 +724,6 @@ test "switch on error set with single else" {
726test "switch capture copies its payload" {724test "switch capture copies its payload" {
727 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO725 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
728 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO726 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
729 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
730727
731 const S = struct {728 const S = struct {
732 fn doTheTest() !void {729 fn doTheTest() !void {
...@@ -788,7 +785,6 @@ test "enum value without tag name used as switch item" {...@@ -788,7 +785,6 @@ test "enum value without tag name used as switch item" {
788}785}
789786
790test "switch item sizeof" {787test "switch item sizeof" {
791 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
792 const S = struct {788 const S = struct {
793 fn doTheTest() !void {789 fn doTheTest() !void {
794 var a: usize = 0;790 var a: usize = 0;
...@@ -817,8 +813,6 @@ test "comptime inline switch" {...@@ -817,8 +813,6 @@ test "comptime inline switch" {
817}813}
818814
819test "switch capture peer type resolution" {815test "switch capture peer type resolution" {
820 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
821
822 const U = union(enum) {816 const U = union(enum) {
823 a: u32,817 a: u32,
824 b: u64,818 b: u64,
...@@ -835,7 +829,6 @@ test "switch capture peer type resolution" {...@@ -835,7 +829,6 @@ test "switch capture peer type resolution" {
835829
836test "switch capture peer type resolution for in-memory coercible payloads" {830test "switch capture peer type resolution for in-memory coercible payloads" {
837 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;831 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
838 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
839832
840 const T1 = c_int;833 const T1 = c_int;
841 const t1_info = @typeInfo(T1).int;834 const t1_info = @typeInfo(T1).int;
...@@ -1166,8 +1159,6 @@ test "switch with uninstantiable union fields" {...@@ -1166,8 +1159,6 @@ test "switch with uninstantiable union fields" {
1166}1159}
11671160
1168test "switch with tag capture" {1161test "switch with tag capture" {
1169 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1170
1171 const U = union(enum) {1162 const U = union(enum) {
1172 a,1163 a,
1173 b: i32,1164 b: i32,
test/behavior/switch_loop.zig-2
...@@ -96,7 +96,6 @@ test "switch loop on tagged union" {...@@ -96,7 +96,6 @@ test "switch loop on tagged union" {
96 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;96 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
97 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO97 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
98 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO98 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
99 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO
100 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;99 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
101100
102 const S = struct {101 const S = struct {
...@@ -291,7 +290,6 @@ test "switch loop with discarded tag capture" {...@@ -291,7 +290,6 @@ test "switch loop with discarded tag capture" {
291}290}
292291
293test "switch loop with single catch-all prong" {292test "switch loop with single catch-all prong" {
294 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
295 const S = struct {293 const S = struct {
296 const E = enum { a, b, c };294 const E = enum { a, b, c };
297 const U = union(E) { a: u32, b: u16, c: u8 };295 const U = union(E) { a: u32, b: u16, c: u8 };
test/behavior/switch_prong_implicit_cast.zig-1
...@@ -18,7 +18,6 @@ test "switch prong implicit cast" {...@@ -18,7 +18,6 @@ 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;
2221
23 const result = switch (foo(2) catch unreachable) {22 const result = switch (foo(2) catch unreachable) {
24 FormValue.One => false,23 FormValue.One => false,
test/behavior/threadlocal.zig-1
...@@ -6,7 +6,6 @@ test "thread local variable" {...@@ -6,7 +6,6 @@ test "thread local variable" {
6 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO6 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
7 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO7 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
8 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO8 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
9 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
10 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO9 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO
1110
12 const S = struct {11 const S = struct {
test/behavior/tuple.zig+2
...@@ -548,6 +548,8 @@ test "OPV tuple fields aren't comptime" {...@@ -548,6 +548,8 @@ test "OPV tuple fields aren't comptime" {
548}548}
549549
550test "array of tuples that end with a zero-bit field followed by padding" {550test "array of tuples that end with a zero-bit field followed by padding" {
551 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
552
551 const S = struct {553 const S = struct {
552 var foo: [2]struct { u32, u8, void } = .{ .{ 1, 2, {} }, .{ 3, 4, {} } };554 var foo: [2]struct { u32, u8, void } = .{ .{ 1, 2, {} }, .{ 3, 4, {} } };
553 };555 };
test/behavior/type.zig+2
...@@ -406,6 +406,8 @@ test "matching captures causes opaque equivalence" {...@@ -406,6 +406,8 @@ test "matching captures causes opaque equivalence" {
406}406}
407407
408test "reify enum where fields refers to part of array" {408test "reify enum where fields refers to part of array" {
409 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
410
409 const field_names: [3][]const u8 = .{ "foo", "bar", undefined };411 const field_names: [3][]const u8 = .{ "foo", "bar", undefined };
410 const field_values: [3]u8 = .{ undefined, 0, 1 };412 const field_values: [3]u8 = .{ undefined, 0, 1 };
411 const E = @Enum(u8, .exhaustive, field_names[0..2], field_values[1..3]);413 const E = @Enum(u8, .exhaustive, field_names[0..2], field_values[1..3]);
test/behavior/union.zig+3-11
...@@ -442,6 +442,7 @@ const Foo1 = union(enum) {...@@ -442,6 +442,7 @@ const Foo1 = union(enum) {
442var glbl: Foo1 = undefined;442var glbl: Foo1 = undefined;
443443
444test "global union with single field is correctly initialized" {444test "global union with single field is correctly initialized" {
445 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
445 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;446 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
446 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO447 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
447448
...@@ -551,7 +552,6 @@ const Baz = enum { A, B, C, D };...@@ -551,7 +552,6 @@ const Baz = enum { A, B, C, D };
551552
552test "tagged union type" {553test "tagged union type" {
553 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO554 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
554 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
555555
556 const foo1 = TaggedFoo{ .One = 13 };556 const foo1 = TaggedFoo{ .One = 13 };
557 const foo2 = TaggedFoo{557 const foo2 = TaggedFoo{
...@@ -576,7 +576,6 @@ test "tagged union as return value" {...@@ -576,7 +576,6 @@ test "tagged union as return value" {
576 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;576 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
577 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO577 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
578 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;578 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
579 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
580579
581 switch (returnAnInt(13)) {580 switch (returnAnInt(13)) {
582 TaggedFoo.One => |value| try expect(value == 13),581 TaggedFoo.One => |value| try expect(value == 13),
...@@ -619,7 +618,6 @@ test "union(enum(u32)) with specified and unspecified tag values" {...@@ -619,7 +618,6 @@ test "union(enum(u32)) with specified and unspecified tag values" {
619 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;618 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
620 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;619 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
621 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO620 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
622 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
623621
624 comptime assert(Tag(Tag(MultipleChoice2)) == u32);622 comptime assert(Tag(Tag(MultipleChoice2)) == u32);
625 try testEnumWithSpecifiedAndUnspecifiedTagValues(MultipleChoice2{ .C = 123 });623 try testEnumWithSpecifiedAndUnspecifiedTagValues(MultipleChoice2{ .C = 123 });
...@@ -709,7 +707,6 @@ test "union with only 1 field casted to its enum type which has enum value speci...@@ -709,7 +707,6 @@ test "union with only 1 field casted to its enum type which has enum value speci
709test "@intFromEnum works on unions" {707test "@intFromEnum works on unions" {
710 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO708 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
711 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO709 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
712 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
713710
714 const Bar = union(enum) {711 const Bar = union(enum) {
715 A: bool,712 A: bool,
...@@ -793,7 +790,6 @@ test "@unionInit stored to a const" {...@@ -793,7 +790,6 @@ test "@unionInit stored to a const" {
793 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO790 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
794 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO791 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
795 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;792 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
796 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
797793
798 const S = struct {794 const S = struct {
799 const U = union(enum) {795 const U = union(enum) {
...@@ -823,7 +819,6 @@ test "@unionInit stored to a const" {...@@ -823,7 +819,6 @@ test "@unionInit stored to a const" {
823test "@unionInit can modify a union type" {819test "@unionInit can modify a union type" {
824 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO820 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
825 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO821 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
826 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
827822
828 const UnionInitEnum = union(enum) {823 const UnionInitEnum = union(enum) {
829 Boolean: bool,824 Boolean: bool,
...@@ -846,7 +841,6 @@ test "@unionInit can modify a union type" {...@@ -846,7 +841,6 @@ test "@unionInit can modify a union type" {
846test "@unionInit can modify a pointer value" {841test "@unionInit can modify a pointer value" {
847 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO842 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
848 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO843 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
849 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
850844
851 const UnionInitEnum = union(enum) {845 const UnionInitEnum = union(enum) {
852 Boolean: bool,846 Boolean: bool,
...@@ -954,7 +948,6 @@ test "function call result coerces from tagged union to the tag" {...@@ -954,7 +948,6 @@ test "function call result coerces from tagged union to the tag" {
954test "switching on non exhaustive union" {948test "switching on non exhaustive union" {
955 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO949 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
956 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO950 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
957 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
958951
959 const S = struct {952 const S = struct {
960 const E = enum(u8) {953 const E = enum(u8) {
...@@ -1256,7 +1249,6 @@ test "@unionInit uses tag value instead of field index" {...@@ -1256,7 +1249,6 @@ test "@unionInit uses tag value instead of field index" {
1256 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1249 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1257 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1250 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1258 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1251 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1259 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1260 const E = enum(u8) {1252 const E = enum(u8) {
1261 b = 255,1253 b = 255,
1262 a = 3,1254 a = 3,
...@@ -1414,6 +1406,8 @@ test "reinterpreting enum value inside packed union" {...@@ -1414,6 +1406,8 @@ test "reinterpreting enum value inside packed union" {
1414}1406}
14151407
1416test "access the tag of a global tagged union" {1408test "access the tag of a global tagged union" {
1409 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1410
1417 const U = union(enum) {1411 const U = union(enum) {
1418 a,1412 a,
1419 b: u8,1413 b: u8,
...@@ -2005,7 +1999,6 @@ test "circular dependency through pointer field of a union" {...@@ -2005,7 +1999,6 @@ test "circular dependency through pointer field of a union" {
20051999
2006test "pass nested union with rls" {2000test "pass nested union with rls" {
2007 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;2001 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
2008 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
20092002
2010 const Union = union(enum) {2003 const Union = union(enum) {
2011 a: u32,2004 a: u32,
...@@ -2052,7 +2045,6 @@ test "runtime union init, most-aligned field != largest" {...@@ -2052,7 +2045,6 @@ test "runtime union init, most-aligned field != largest" {
2052test "copied union field doesn't alias source" {2045test "copied union field doesn't alias source" {
2053 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO2046 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
2054 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO2047 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
2055 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
20562048
2057 const U = union(enum) {2049 const U = union(enum) {
2058 array: [10]u32,2050 array: [10]u32,
test/behavior/vector.zig-1
...@@ -378,7 +378,6 @@ test "array of non-abi-sized integer to vector of same type" {...@@ -378,7 +378,6 @@ test "array of non-abi-sized integer to vector of same type" {
378 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;378 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
379 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO379 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
380 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO380 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
381 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
382381
383 const S = struct {382 const S = struct {
384 fn doTheTest() !void {383 fn doTheTest() !void {
test/behavior/while.zig+5
...@@ -122,6 +122,8 @@ test "while copies its payload" {...@@ -122,6 +122,8 @@ test "while copies its payload" {
122}122}
123123
124test "continue and break" {124test "continue and break" {
125 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
126
125 try runContinueAndBreakTest();127 try runContinueAndBreakTest();
126 try expect(continue_and_break_counter == 8);128 try expect(continue_and_break_counter == 8);
127}129}
...@@ -140,6 +142,7 @@ fn runContinueAndBreakTest() !void {...@@ -140,6 +142,7 @@ fn runContinueAndBreakTest() !void {
140}142}
141143
142test "while with optional as condition" {144test "while with optional as condition" {
145 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
143 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;146 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
144 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO147 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
145 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;148 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
...@@ -153,6 +156,7 @@ test "while with optional as condition" {...@@ -153,6 +156,7 @@ test "while with optional as condition" {
153}156}
154157
155test "while with optional as condition with else" {158test "while with optional as condition with else" {
159 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
156 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;160 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
157 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO161 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
158 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;162 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
...@@ -171,6 +175,7 @@ test "while with optional as condition with else" {...@@ -171,6 +175,7 @@ test "while with optional as condition with else" {
171}175}
172176
173test "while with error union condition" {177test "while with error union condition" {
178 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
174 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO179 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
175 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;180 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
176181
test/standalone/build.zig+1
...@@ -44,6 +44,7 @@ pub fn build(b: *std.Build) void {...@@ -44,6 +44,7 @@ pub fn build(b: *std.Build) void {
44 "../../tools/generate_linux_syscalls.zig",44 "../../tools/generate_linux_syscalls.zig",
45 "../../tools/process_headers.zig",45 "../../tools/process_headers.zig",
46 "../../tools/migrate_langref.zig",46 "../../tools/migrate_langref.zig",
47 "../../tools/unskip_spirv_tests.zig",
47 "../../tools/update-linux-headers.zig",48 "../../tools/update-linux-headers.zig",
48 "../../tools/update_clang_options.zig",49 "../../tools/update_clang_options.zig",
49 "../../tools/update_cpu_features.zig",50 "../../tools/update_cpu_features.zig",
tools/unskip_spirv_tests.zig created+264
...@@ -0,0 +1,264 @@
1const std = @import("std");
2const Io = std.Io;
3const Allocator = std.mem.Allocator;
4const Ast = std.zig.Ast;
5
6const usage =
7 \\Usage: unskip_spirv_tests <zig> <test_runner> <test_cmd> [test/behavior/*.zig ...]
8 \\
9 \\For example:
10 \\zig run tools/unskip_spirv_tests.zig -- zig-out/bin/zig \
11 \\ ../zig-spirv-test-executor/src/test_runner.zig \
12 \\ ../zig-spirv-test-executor/zig-out/bin/zig-spirv-test-executor [files...]
13 \\
14 \\Runs every behavior test that is skipped on stage2_spirv in isolation and
15 \\removes the skip if the test passes.
16 \\
17;
18
19const Test = struct {
20 body: Ast.Node.Index,
21 name: []const u8,
22 skip: ?Ast.Node.Index,
23};
24
25pub fn main(init: std.process.Init) !void {
26 const io = init.io;
27 const arena = init.arena.allocator();
28
29 var args = try init.minimal.args.iterateAllocator(arena);
30 _ = args.skip();
31 const zig = args.next() orelse std.process.fatal(usage, .{});
32 const test_runner = args.next() orelse std.process.fatal(usage, .{});
33 const test_cmd = args.next() orelse std.process.fatal(usage, .{});
34
35 var files: std.ArrayList([]const u8) = .empty;
36 while (args.next()) |path| try files.append(arena, path);
37
38 if (files.items.len == 0) {
39 var dir = try Io.Dir.openDir(.cwd(), io, "test/behavior", .{ .iterate = true });
40 defer dir.close(io);
41
42 var it = dir.iterate();
43 while (try it.next(io)) |entry| {
44 if (entry.kind != .file or !std.mem.endsWith(u8, entry.name, ".zig")) continue;
45 const path = try std.fs.path.join(arena, &.{ "test/behavior", entry.name });
46 const source = try Io.Dir.readFileAlloc(.cwd(), io, path, arena, .unlimited);
47 if (std.mem.find(u8, source, "stage2_spirv") != null) {
48 try files.append(arena, path);
49 }
50 }
51 }
52
53 var stdout_buffer: [4096]u8 = undefined;
54 var stdout_writer = Io.File.stdout().writer(io, &stdout_buffer);
55 const stdout = &stdout_writer.interface;
56
57 const progress = std.Progress.start(io, .{ .estimated_total_items = files.items.len });
58 const cache_dir = init.environ_map.get("ZIG_LOCAL_CACHE_DIR") orelse ".zig-cache";
59 const variant_dir = try std.fs.path.join(arena, &.{ cache_dir, "unskip" });
60 try Io.Dir.createDirPath(.cwd(), io, variant_dir);
61
62 var failures: std.array_hash_map.String(std.ArrayList([]const u8)) = .empty;
63 var total_removed: usize = 0;
64 var files_changed: usize = 0;
65 for (files.items) |path| {
66 const basename = std.fs.path.basename(path);
67 const source = try Io.Dir.readFileAlloc(.cwd(), io, path, arena, .unlimited);
68 const ast = try Ast.parse(arena, try arena.dupeSentinel(u8, source, 0), .{});
69 if (ast.errors.len != 0) std.process.fatal("{s}: parse error", .{path});
70
71 var tests: std.ArrayList(Test) = .empty;
72 var skips: usize = 0;
73 for (ast.rootDecls()) |decl| {
74 if (ast.nodeTag(decl) != .test_decl) continue;
75 const name_token, const body = ast.nodeData(decl).opt_token_and_node;
76 const token = name_token.unwrap() orelse continue;
77 const name = if (ast.tokenTag(token) == .string_literal)
78 try std.zig.string_literal.parseAlloc(arena, ast.tokenSlice(token))
79 else
80 ast.tokenSlice(token);
81
82 var buffer: [2]Ast.Node.Index = undefined;
83 const skip: ?Ast.Node.Index = for (ast.blockStatements(&buffer, body) orelse &.{}) |statement| {
84 const if_full = ast.fullIf(statement) orelse continue;
85 if (ast.nodeTag(if_full.ast.cond_expr) != .equal_equal) continue;
86 _, const rhs = ast.nodeData(if_full.ast.cond_expr).node_and_node;
87 if (!std.mem.eql(u8, ast.getNodeSource(rhs), ".stage2_spirv")) continue;
88 if (ast.nodeTag(if_full.ast.then_expr) != .@"return") continue;
89 const value = ast.nodeData(if_full.ast.then_expr).opt_node.unwrap() orelse continue;
90 if (!std.mem.eql(u8, ast.getNodeSource(value), "error.SkipZigTest")) continue;
91 break statement;
92 } else null;
93 skips += @intFromBool(skip != null);
94
95 try tests.append(arena, .{ .body = body, .name = name, .skip = skip });
96 }
97
98 if (skips == 0) {
99 progress.completeOne();
100 continue;
101 }
102
103 const file_node = progress.start(basename, skips);
104 defer file_node.end();
105 const variant_path = try std.fs.path.join(arena, &.{ variant_dir, basename });
106
107 var removed: Ast.Render.Fixups = .{};
108 for (tests.items) |candidate| {
109 const skip = candidate.skip orelse continue;
110 const test_node = file_node.start(candidate.name, 0);
111 defer test_node.end();
112
113 var fixups: Ast.Render.Fixups = .{};
114 try fixups.omit_nodes.put(arena, skip, {});
115 for (tests.items) |other| {
116 if (other.body == candidate.body) continue;
117 try fixups.replace_nodes_with_string.put(arena, other.body, "{ return error.SkipZigTest; }");
118 }
119
120 var variant: Io.Writer.Allocating = .init(arena);
121 try ast.render(arena, &variant.writer, fixups);
122 try Io.Dir.writeFile(.cwd(), io, .{ .sub_path = variant_path, .data = variant.written() });
123
124 const signature: []const u8 = signature: {
125 const result = std.process.run(arena, io, .{
126 .argv = &.{
127 zig, "test", variant_path,
128 "--test-runner", test_runner, "-target",
129 "spirv64-vulkan", "-mcpu", "vulkan_v1_2+variable_pointers+int64",
130 "-fno-llvm", "--zig-lib-dir", "lib",
131 "--test-cmd", test_cmd, "--test-cmd-bin",
132 },
133 .timeout = .{ .duration = .{ .raw = .fromSeconds(120), .clock = .awake } },
134 .progress_node = test_node,
135 }) catch |err| switch (err) {
136 error.Timeout => break :signature "timeout",
137 else => |e| return e,
138 };
139
140 if (result.term.success()) {
141 try removed.omit_nodes.put(arena, skip, {});
142 std.debug.print("{s}: removed skip for {s}\n", .{ basename, candidate.name });
143 continue;
144 }
145
146 const output = try std.mem.concat(arena, u8, &.{ result.stdout, result.stderr });
147 var lines = std.mem.splitScalar(u8, output, '\n');
148 while (lines.next()) |line| {
149 const rest = std.mem.cutPrefix(u8, line, "error: line ") orelse continue;
150 const colon = std.mem.findScalar(u8, rest, ':') orelse continue;
151 if (!allDigits(rest[0..colon])) continue;
152 break :signature try normalize(arena, "spirv-val: ", rest[colon + 1 ..]);
153 }
154 lines.reset();
155
156 while (lines.next()) |line| {
157 const rest = std.mem.cutPrefix(u8, line, "thread ") orelse continue;
158 const panic = std.mem.find(u8, rest, " panic: ") orelse continue;
159 if (std.mem.findScalar(u8, rest[0..panic], ' ') != null) continue;
160 break :signature try normalize(arena, "panic: ", rest[panic + " panic: ".len ..]);
161 }
162 lines.reset();
163
164 while (lines.next()) |line| {
165 const marker = std.mem.find(u8, line, ": error: ") orelse continue;
166 const location = line[0..marker];
167 const line_colon = std.mem.findScalarLast(u8, location, ':') orelse continue;
168 const file_colon = std.mem.findScalarLast(u8, location[0..line_colon], ':') orelse continue;
169 if (std.mem.findScalar(u8, location[0..file_colon], ' ') != null) continue;
170 if (!allDigits(location[file_colon + 1 .. line_colon])) continue;
171 if (!allDigits(location[line_colon + 1 ..])) continue;
172 const message = line[marker + ": error: ".len ..];
173 break :signature try normalize(arena, "compile error: ", message);
174 }
175 lines.reset();
176
177 while (lines.next()) |line| {
178 const rest = std.mem.cutPrefix(u8, line, "error: ") orelse continue;
179 break :signature try normalize(arena, "error: ", rest);
180 }
181
182 if (std.mem.trim(u8, output, &std.ascii.whitespace).len > 0) {
183 break :signature "unknown failure (no error: line found)";
184 }
185 break :signature "no output";
186 };
187
188 const gop = try failures.getOrPut(arena, signature);
189 if (!gop.found_existing) gop.value_ptr.* = .empty;
190 const failed_test = try std.fmt.allocPrint(arena, "{s} :: {s}", .{ basename, candidate.name });
191 try gop.value_ptr.append(arena, failed_test);
192 }
193
194 std.debug.print("{s}: {d}/{d} skips removed\n", .{ basename, removed.omit_nodes.count(), skips });
195 Io.Dir.deleteFile(.cwd(), io, variant_path) catch {};
196 if (removed.omit_nodes.count() == 0) continue;
197
198 var final: Io.Writer.Allocating = .init(arena);
199 try ast.render(arena, &final.writer, removed);
200 const rendered = try Ast.parse(arena, try arena.dupeSentinel(u8, final.written(), 0), .{});
201 const formatted = try rendered.renderAlloc(arena);
202 try Io.Dir.writeFile(.cwd(), io, .{ .sub_path = path, .data = formatted });
203 total_removed += removed.omit_nodes.count();
204 files_changed += 1;
205 }
206
207 progress.end();
208
209 try stdout.print("\nDone: removed {d} spirv skips across {d} files\n", .{ total_removed, files_changed });
210 if (failures.count() > 0) {
211 var total_failures: usize = 0;
212 for (failures.values()) |failed_tests| total_failures += failed_tests.items.len;
213 try stdout.print("\nMost common blockers ({d} failing attempts, {d} unique signatures):\n", .{
214 total_failures,
215 failures.count(),
216 });
217
218 const Ctx = struct {
219 failed_tests: []const std.ArrayList([]const u8),
220
221 pub fn lessThan(ctx: @This(), a: usize, b: usize) bool {
222 return ctx.failed_tests[a].items.len > ctx.failed_tests[b].items.len;
223 }
224 };
225 failures.sort(Ctx{ .failed_tests = failures.values() });
226
227 for (failures.keys()[0..@min(failures.count(), 30)], failures.values()) |signature, failed_tests| {
228 const count = failed_tests.items.len;
229 const percent = @as(f64, @floatFromInt(count)) * 100 / @as(f64, @floatFromInt(total_failures));
230 try stdout.print("{d:4} ({d:5.1}%) {s}\n", .{ count, percent, signature });
231 for (failed_tests.items) |failed_test| try stdout.print(" {s}\n", .{failed_test});
232 }
233 }
234 try stdout.flush();
235}
236
237fn allDigits(text: []const u8) bool {
238 if (text.len == 0) return false;
239 for (text) |c| if (!std.ascii.isDigit(c)) return false;
240 return true;
241}
242
243fn normalize(arena: Allocator, prefix: []const u8, message: []const u8) ![]u8 {
244 const source = try arena.dupeSentinel(u8, std.mem.trim(u8, message, &std.ascii.whitespace), 0);
245 var out: std.ArrayList(u8) = .empty;
246 try out.appendSlice(arena, prefix);
247 var tokenizer: std.zig.Tokenizer = .init(source);
248 var end: usize = 0;
249 while (true) {
250 const token = tokenizer.next();
251 if (token.tag == .eof) break;
252 try out.appendSlice(arena, source[end..token.loc.start]);
253 end = token.loc.end;
254 const text = source[token.loc.start..token.loc.end];
255 try out.appendSlice(arena, switch (token.tag) {
256 .number_literal => "<n>",
257 .char_literal, .string_literal => "<str>",
258 .identifier => if (token.loc.start > 0 and source[token.loc.start - 1] == '%') "<id>" else text,
259 else => text,
260 });
261 }
262 try out.appendSlice(arena, source[end..]);
263 return out.items[0..@min(out.items.len, prefix.len + 200)];
264}