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;
77const expectEqual = testing.expectEqual;
88
99test "array to slice" {
10 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
11
1012 const a: u32 align(4) = 3;
1113 const b: u32 align(8) = 4;
1214 const a_slice: []align(1) const u32 = @as(*const [1]u32, &a)[0..];
......@@ -19,8 +21,10 @@ test "array to slice" {
1921}
2022
2123test "arrays" {
24 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2225 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
2326 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
27
2428 var array: [5]u32 = undefined;
2529
2630 var i: u32 = 0;
test/behavior/backing_int.zig+6
......@@ -137,6 +137,8 @@ const T5 = union(E5) {
137137};
138138
139139test "@backingInt with tagged unions" {
140 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
141
140142 const static = struct {
141143 fn doTheTest(v1: T1, v2: T2, v4: T4, v5: T5) !void {
142144 const b1 = @backingInt(v1);
......@@ -311,6 +313,8 @@ const U5 = packed union(u0) {
311313};
312314
313315test "@backingInt with packed unions" {
316 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
317
314318 const static = struct {
315319 fn doTheTest(v1: U1, v2: U2, v3: U3, v4: U4, v5: U5) !void {
316320 const b1 = @backingInt(v1);
......@@ -339,6 +343,8 @@ test "@backingInt with packed unions" {
339343}
340344
341345test "@fromBackingInt with packed unions" {
346 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
347
342348 const static = struct {
343349 fn doTheTest(
344350 b1: @typeInfo(U1).@"union".backing_integer.?,
test/behavior/cast.zig+1
......@@ -1806,6 +1806,7 @@ test "cast compatible optional types" {
18061806
18071807test "coerce undefined single-item pointer of array to error union of slice" {
18081808 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1809 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
18091810
18101811 const a = @as([*]u8, undefined)[0..0];
18111812 var b: error{a}![]const u8 = a;
test/behavior/comptime_memory.zig+2
......@@ -437,6 +437,8 @@ test "type pun null pointer-like optional" {
437437}
438438
439439test "write empty array to end" {
440 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
441
440442 comptime var array: [5]u8 = "hello".*;
441443 array[5..5].* = .{};
442444 array[5..5].* = [0]u8{};
test/behavior/for.zig+1
......@@ -391,6 +391,7 @@ test "raw pointer and counter" {
391391test "inline for with slice as the comptime-known" {
392392 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
393393 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
394 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
394395
395396 const comptime_slice = "hello";
396397 var runtime_i: usize = 3;
test/behavior/math.zig+2
......@@ -456,6 +456,7 @@ test "division" {
456456 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
457457 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
458458 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
459 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
459460 try testIntDivision();
460461 try comptime testIntDivision();
461462
......@@ -649,6 +650,7 @@ test "division half-precision floats" {
649650 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
650651 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
651652 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
653 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
652654
653655 try testDivisionFP16();
654656 try comptime testDivisionFP16();
test/behavior/packed-union.zig+3
......@@ -229,6 +229,8 @@ test "initialize packed union field to undefined at comptime" {
229229}
230230
231231test "convert from/to backing int" {
232 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
233
232234 const U = packed union(u10) {
233235 a: i10,
234236 b: enum(u10) { x, y, z },
......@@ -244,6 +246,7 @@ test "convert from/to backing int" {
244246
245247test "equality with wide backing integer" {
246248 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
248251 const U = packed union(i200) {
249252 x: u200,
test/behavior/pointers.zig+1
......@@ -701,6 +701,7 @@ test "pointer-to-array constness for zero-size elements, var" {
701701
702702test "pointer-to-array constness for zero-size elements, const" {
703703 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
704 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
704705
705706 try constant();
706707 try comptime constant();
test/behavior/ptrcast.zig+2
......@@ -6,6 +6,7 @@ const native_endian = builtin.target.cpu.arch.endian();
66
77test "reinterpret bytes as integer with nonzero offset" {
88 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
9 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
910
1011 try testReinterpretBytesAsInteger();
1112 try comptime testReinterpretBytesAsInteger();
......@@ -39,6 +40,7 @@ fn testReinterpretWithOffsetAndNoWellDefinedLayout() !void {
3940
4041test "reinterpret bytes inside auto-layout struct as integer with nonzero offset" {
4142 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
43 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
4244
4345 try testReinterpretStructWrappedBytesAsInteger();
4446 try comptime testReinterpretStructWrappedBytesAsInteger();
test/behavior/sizeof_and_typeof.zig+2
......@@ -405,6 +405,8 @@ test "Extern function calls, dereferences and field access in @TypeOf" {
405405}
406406
407407test "@sizeOf struct is resolved when used as operand of slicing" {
408 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
409
408410 const dummy = struct {};
409411 const S = struct {
410412 var buf: [1]u8 = undefined;
test/behavior/slice.zig+8
......@@ -59,6 +59,8 @@ test "const slice" {
5959}
6060
6161test "comptime slice of undefined pointer of length 0" {
62 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
63
6264 const slice1 = @as([*]i32, undefined)[0..0];
6365 try expect(slice1.len == 0);
6466 const slice2 = @as([*]i32, undefined)[100..100];
......@@ -173,6 +175,8 @@ test "pass a slice of types to a function" {
173175
174176test "generic malloc free" {
175177 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
178 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
179
176180 const a = memAlloc(u8, 10) catch unreachable;
177181 memFree(u8, a);
178182}
......@@ -209,6 +213,8 @@ test "comptime slice of pointer preserves comptime var" {
209213}
210214
211215test "comptime pointer cast array and then slice" {
216 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
217
212218 const array = [_]u8{ 1, 2, 3, 4, 5, 6, 7, 8 };
213219
214220 const ptrA: [*]const u8 = @as([*]const u8, @ptrCast(&array));
......@@ -1079,6 +1085,8 @@ test "conditionally return second argument slice" {
10791085}
10801086
10811087test "slice field alignment" {
1088 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1089
10821090 const S = struct {
10831091 fn doTheTest(p: *align(1) const []u8) !void {
10841092 comptime assert(@TypeOf(&p.ptr) == *align(1) const [*]u8);
test/behavior/string_literals.zig+2
......@@ -84,6 +84,8 @@ test "string literal pointer sentinel" {
8484}
8585
8686test "sentinel slice of string literal" {
87 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
88
8789 const string = "Hello!\x00World!";
8890 try std.testing.expect(@TypeOf(string) == *const [13:0]u8);
8991
test/behavior/vector.zig+2
......@@ -680,6 +680,8 @@ test "vector division operators" {
680680 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
681681 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
682682 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
683 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
684
683685 const S = struct {
684686 fn doTheTestDiv(comptime T: type, x: @Vector(4, T), y: @Vector(4, T)) !void {
685687 const is_signed_int = switch (@typeInfo(T)) {