authorgravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2026-08-25 21:55:19+03:30
committergravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2026-08-26 08:13:06+03:30
logd95c7db6ec9f17e0c212c010385ac61ad7340d43
treecd06864f293d020148eb11c9830b0f3c529ebc67
parente8e47b3428845a176eb5ee1c373063102ab7f6e2

test: skip failing behavior tests for spirv


13 files changed, 36 insertions(+), 0 deletions(-)

test/behavior/array.zig+4
...@@ -7,6 +7,8 @@ const expect = testing.expect;...@@ -7,6 +7,8 @@ const expect = testing.expect;
7const expectEqual = testing.expectEqual;7const expectEqual = testing.expectEqual;
88
9test "array to slice" {9test "array to slice" {
10 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
11
10 const a: u32 align(4) = 3;12 const a: u32 align(4) = 3;
11 const b: u32 align(8) = 4;13 const b: u32 align(8) = 4;
12 const a_slice: []align(1) const u32 = @as(*const [1]u32, &a)[0..];14 const a_slice: []align(1) const u32 = @as(*const [1]u32, &a)[0..];
...@@ -19,8 +21,10 @@ test "array to slice" {...@@ -19,8 +21,10 @@ test "array to slice" {
19}21}
2022
21test "arrays" {23test "arrays" {
24 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
22 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;25 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
23 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO26 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
27
24 var array: [5]u32 = undefined;28 var array: [5]u32 = undefined;
2529
26 var i: u32 = 0;30 var i: u32 = 0;
test/behavior/backing_int.zig+6
...@@ -137,6 +137,8 @@ const T5 = union(E5) {...@@ -137,6 +137,8 @@ const T5 = union(E5) {
137};137};
138138
139test "@backingInt with tagged unions" {139test "@backingInt with tagged unions" {
140 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
141
140 const static = struct {142 const static = struct {
141 fn doTheTest(v1: T1, v2: T2, v4: T4, v5: T5) !void {143 fn doTheTest(v1: T1, v2: T2, v4: T4, v5: T5) !void {
142 const b1 = @backingInt(v1);144 const b1 = @backingInt(v1);
...@@ -311,6 +313,8 @@ const U5 = packed union(u0) {...@@ -311,6 +313,8 @@ const U5 = packed union(u0) {
311};313};
312314
313test "@backingInt with packed unions" {315test "@backingInt with packed unions" {
316 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
317
314 const static = struct {318 const static = struct {
315 fn doTheTest(v1: U1, v2: U2, v3: U3, v4: U4, v5: U5) !void {319 fn doTheTest(v1: U1, v2: U2, v3: U3, v4: U4, v5: U5) !void {
316 const b1 = @backingInt(v1);320 const b1 = @backingInt(v1);
...@@ -339,6 +343,8 @@ test "@backingInt with packed unions" {...@@ -339,6 +343,8 @@ test "@backingInt with packed unions" {
339}343}
340344
341test "@fromBackingInt with packed unions" {345test "@fromBackingInt with packed unions" {
346 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
347
342 const static = struct {348 const static = struct {
343 fn doTheTest(349 fn doTheTest(
344 b1: @typeInfo(U1).@"union".backing_integer.?,350 b1: @typeInfo(U1).@"union".backing_integer.?,
test/behavior/cast.zig+1
...@@ -1806,6 +1806,7 @@ test "cast compatible optional types" {...@@ -1806,6 +1806,7 @@ test "cast compatible optional types" {
18061806
1807test "coerce undefined single-item pointer of array to error union of slice" {1807test "coerce undefined single-item pointer of array to error union of slice" {
1808 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1808 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1809 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
18091810
1810 const a = @as([*]u8, undefined)[0..0];1811 const a = @as([*]u8, undefined)[0..0];
1811 var b: error{a}![]const u8 = a;1812 var b: error{a}![]const u8 = a;
test/behavior/comptime_memory.zig+2
...@@ -437,6 +437,8 @@ test "type pun null pointer-like optional" {...@@ -437,6 +437,8 @@ test "type pun null pointer-like optional" {
437}437}
438438
439test "write empty array to end" {439test "write empty array to end" {
440 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
441
440 comptime var array: [5]u8 = "hello".*;442 comptime var array: [5]u8 = "hello".*;
441 array[5..5].* = .{};443 array[5..5].* = .{};
442 array[5..5].* = [0]u8{};444 array[5..5].* = [0]u8{};
test/behavior/for.zig+1
...@@ -391,6 +391,7 @@ test "raw pointer and counter" {...@@ -391,6 +391,7 @@ test "raw pointer and counter" {
391test "inline for with slice as the comptime-known" {391test "inline for with slice as the comptime-known" {
392 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO392 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
393 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO393 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
394 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
394395
395 const comptime_slice = "hello";396 const comptime_slice = "hello";
396 var runtime_i: usize = 3;397 var runtime_i: usize = 3;
test/behavior/math.zig+2
...@@ -456,6 +456,7 @@ test "division" {...@@ -456,6 +456,7 @@ test "division" {
456 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO456 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
457 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO457 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
458 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;458 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
459 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
459 try testIntDivision();460 try testIntDivision();
460 try comptime testIntDivision();461 try comptime testIntDivision();
461462
...@@ -649,6 +650,7 @@ test "division half-precision floats" {...@@ -649,6 +650,7 @@ test "division half-precision floats" {
649 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO650 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
650 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO651 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
651 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;652 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
653 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
652654
653 try testDivisionFP16();655 try testDivisionFP16();
654 try comptime testDivisionFP16();656 try comptime testDivisionFP16();
test/behavior/packed-union.zig+3
...@@ -229,6 +229,8 @@ test "initialize packed union field to undefined at comptime" {...@@ -229,6 +229,8 @@ test "initialize packed union field to undefined at comptime" {
229}229}
230230
231test "convert from/to backing int" {231test "convert from/to backing int" {
232 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
233
232 const U = packed union(u10) {234 const U = packed union(u10) {
233 a: i10,235 a: i10,
234 b: enum(u10) { x, y, z },236 b: enum(u10) { x, y, z },
...@@ -244,6 +246,7 @@ test "convert from/to backing int" {...@@ -244,6 +246,7 @@ test "convert from/to backing int" {
244246
245test "equality with wide backing integer" {247test "equality with wide backing integer" {
246 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/35982248 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/35982
249 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
247250
248 const U = packed union(i200) {251 const U = packed union(i200) {
249 x: u200,252 x: u200,
test/behavior/pointers.zig+1
...@@ -701,6 +701,7 @@ test "pointer-to-array constness for zero-size elements, var" {...@@ -701,6 +701,7 @@ test "pointer-to-array constness for zero-size elements, var" {
701701
702test "pointer-to-array constness for zero-size elements, const" {702test "pointer-to-array constness for zero-size elements, const" {
703 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO703 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
704 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
704705
705 try constant();706 try constant();
706 try comptime constant();707 try comptime constant();
test/behavior/ptrcast.zig+2
...@@ -6,6 +6,7 @@ const native_endian = builtin.target.cpu.arch.endian();...@@ -6,6 +6,7 @@ const native_endian = builtin.target.cpu.arch.endian();
66
7test "reinterpret bytes as integer with nonzero offset" {7test "reinterpret bytes as integer with nonzero offset" {
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;
910
10 try testReinterpretBytesAsInteger();11 try testReinterpretBytesAsInteger();
11 try comptime testReinterpretBytesAsInteger();12 try comptime testReinterpretBytesAsInteger();
...@@ -39,6 +40,7 @@ fn testReinterpretWithOffsetAndNoWellDefinedLayout() !void {...@@ -39,6 +40,7 @@ fn testReinterpretWithOffsetAndNoWellDefinedLayout() !void {
3940
40test "reinterpret bytes inside auto-layout struct as integer with nonzero offset" {41test "reinterpret bytes inside auto-layout struct as integer with nonzero offset" {
41 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO42 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
43 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
4244
43 try testReinterpretStructWrappedBytesAsInteger();45 try testReinterpretStructWrappedBytesAsInteger();
44 try comptime testReinterpretStructWrappedBytesAsInteger();46 try comptime testReinterpretStructWrappedBytesAsInteger();
test/behavior/sizeof_and_typeof.zig+2
...@@ -405,6 +405,8 @@ test "Extern function calls, dereferences and field access in @TypeOf" {...@@ -405,6 +405,8 @@ test "Extern function calls, dereferences and field access in @TypeOf" {
405}405}
406406
407test "@sizeOf struct is resolved when used as operand of slicing" {407test "@sizeOf struct is resolved when used as operand of slicing" {
408 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
409
408 const dummy = struct {};410 const dummy = struct {};
409 const S = struct {411 const S = struct {
410 var buf: [1]u8 = undefined;412 var buf: [1]u8 = undefined;
test/behavior/slice.zig+8
...@@ -59,6 +59,8 @@ test "const slice" {...@@ -59,6 +59,8 @@ test "const slice" {
59}59}
6060
61test "comptime slice of undefined pointer of length 0" {61test "comptime slice of undefined pointer of length 0" {
62 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
63
62 const slice1 = @as([*]i32, undefined)[0..0];64 const slice1 = @as([*]i32, undefined)[0..0];
63 try expect(slice1.len == 0);65 try expect(slice1.len == 0);
64 const slice2 = @as([*]i32, undefined)[100..100];66 const slice2 = @as([*]i32, undefined)[100..100];
...@@ -173,6 +175,8 @@ test "pass a slice of types to a function" {...@@ -173,6 +175,8 @@ test "pass a slice of types to a function" {
173175
174test "generic malloc free" {176test "generic malloc free" {
175 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_spirv) return error.SkipZigTest;
179
176 const a = memAlloc(u8, 10) catch unreachable;180 const a = memAlloc(u8, 10) catch unreachable;
177 memFree(u8, a);181 memFree(u8, a);
178}182}
...@@ -209,6 +213,8 @@ test "comptime slice of pointer preserves comptime var" {...@@ -209,6 +213,8 @@ test "comptime slice of pointer preserves comptime var" {
209}213}
210214
211test "comptime pointer cast array and then slice" {215test "comptime pointer cast array and then slice" {
216 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
217
212 const array = [_]u8{ 1, 2, 3, 4, 5, 6, 7, 8 };218 const array = [_]u8{ 1, 2, 3, 4, 5, 6, 7, 8 };
213219
214 const ptrA: [*]const u8 = @as([*]const u8, @ptrCast(&array));220 const ptrA: [*]const u8 = @as([*]const u8, @ptrCast(&array));
...@@ -1079,6 +1085,8 @@ test "conditionally return second argument slice" {...@@ -1079,6 +1085,8 @@ test "conditionally return second argument slice" {
1079}1085}
10801086
1081test "slice field alignment" {1087test "slice field alignment" {
1088 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1089
1082 const S = struct {1090 const S = struct {
1083 fn doTheTest(p: *align(1) const []u8) !void {1091 fn doTheTest(p: *align(1) const []u8) !void {
1084 comptime assert(@TypeOf(&p.ptr) == *align(1) const [*]u8);1092 comptime assert(@TypeOf(&p.ptr) == *align(1) const [*]u8);
test/behavior/string_literals.zig+2
...@@ -84,6 +84,8 @@ test "string literal pointer sentinel" {...@@ -84,6 +84,8 @@ test "string literal pointer sentinel" {
84}84}
8585
86test "sentinel slice of string literal" {86test "sentinel slice of string literal" {
87 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
88
87 const string = "Hello!\x00World!";89 const string = "Hello!\x00World!";
88 try std.testing.expect(@TypeOf(string) == *const [13:0]u8);90 try std.testing.expect(@TypeOf(string) == *const [13:0]u8);
8991
test/behavior/vector.zig+2
...@@ -680,6 +680,8 @@ test "vector division operators" {...@@ -680,6 +680,8 @@ test "vector division operators" {
680 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO680 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
681 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO681 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
682 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;682 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
683 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
684
683 const S = struct {685 const S = struct {
684 fn doTheTestDiv(comptime T: type, x: @Vector(4, T), y: @Vector(4, T)) !void {686 fn doTheTestDiv(comptime T: type, x: @Vector(4, T), y: @Vector(4, T)) !void {
685 const is_signed_int = switch (@typeInfo(T)) {687 const is_signed_int = switch (@typeInfo(T)) {