authorgravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2025-08-09 13:27:45+03:30
committergravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2025-08-09 13:27:45+03:30
log64563e2fffd0e304019c343a32f31c925be20ea2
tree10e996625fab88c9a6231616e7ec1a6b5fb9e647
parentbed99e1ecd6c919f4c8a974e598302773db10b8a
signaturelock-open Commit is signed but in an unrecognized format.

test: skip tests that were not meant to pass for spirv


10 files changed, 38 insertions(+), 0 deletions(-)

test/behavior/align.zig+2
......@@ -561,6 +561,8 @@ test "function pointer @intFromPtr/@ptrFromInt roundtrip" {
561561}
562562
563563test "function pointer align mask" {
564 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
565
564566 const int = if (builtin.cpu.arch.isArm() or builtin.cpu.arch.isMIPS()) 0x20202021 else 0x20202020;
565567 const unaligned: *const fn () callconv(.c) void = @ptrFromInt(int);
566568 const aligned: *align(16) const fn () callconv(.c) void = @alignCast(unaligned);
test/behavior/array.zig+2
......@@ -1088,6 +1088,8 @@ test "pass pointer to empty array initializer to anytype parameter" {
10881088}
10891089
10901090test "initialize pointer to anyopaque with reference to empty array initializer" {
1091 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1092
10911093 const ptr: *const anyopaque = &.{};
10921094 // The above acts like an untyped initializer, since the `.{}` has no result type.
10931095 // So, `ptr` points in memory to an empty tuple (`@TypeOf(.{})`).
test/behavior/cast.zig+10
......@@ -9,6 +9,8 @@ const maxInt = std.math.maxInt;
99const native_endian = builtin.target.cpu.arch.endian();
1010
1111test "int to ptr cast" {
12 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
13
1214 const x = @as(usize, 13);
1315 const y = @as(*u8, @ptrFromInt(x));
1416 const z = @intFromPtr(y);
......@@ -16,6 +18,8 @@ test "int to ptr cast" {
1618}
1719
1820test "integer literal to pointer cast" {
21 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
22
1923 const vga_mem = @as(*u16, @ptrFromInt(0xB8000));
2024 try expect(@intFromPtr(vga_mem) == 0xB8000);
2125}
......@@ -269,6 +273,8 @@ test "implicit cast from *[N]T to [*c]T" {
269273}
270274
271275test "*usize to *void" {
276 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
277
272278 var i = @as(usize, 0);
273279 const v: *void = @ptrCast(&i);
274280 v.* = {};
......@@ -1481,6 +1487,8 @@ test "coerce between pointers of compatible differently-named floats" {
14811487}
14821488
14831489test "peer type resolution of const and non-const pointer to array" {
1490 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1491
14841492 const a = @as(*[1024]u8, @ptrFromInt(42));
14851493 const b = @as(*const [1024]u8, @ptrFromInt(42));
14861494 try std.testing.expect(@TypeOf(a, b) == *const [1024]u8);
......@@ -1543,6 +1551,8 @@ test "optional pointer coerced to optional allowzero pointer" {
15431551}
15441552
15451553test "optional slice coerced to allowzero many pointer" {
1554 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1555
15461556 const a: ?[]const u32 = null;
15471557 const b: [*]allowzero const u8 = @ptrCast(a);
15481558 const c = @intFromPtr(b);
test/behavior/comptime_memory.zig+6
......@@ -406,6 +406,8 @@ test "mutate entire slice at comptime" {
406406}
407407
408408test "dereference undefined pointer to zero-bit type" {
409 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
410
409411 const p0: *void = undefined;
410412 try testing.expectEqual({}, p0.*);
411413
......@@ -421,6 +423,8 @@ test "type pun extern struct" {
421423}
422424
423425test "type pun @ptrFromInt" {
426 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
427
424428 const p: *u8 = @ptrFromInt(42);
425429 // note that expectEqual hides the bug
426430 try testing.expect(@as(*const [*]u8, @ptrCast(&p)).* == @as([*]u8, @ptrFromInt(42)));
......@@ -511,6 +515,8 @@ fn fieldPtrTest() u32 {
511515 return a.value;
512516}
513517test "pointer in aggregate field can mutate comptime state" {
518 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
519
514520 try comptime std.testing.expect(fieldPtrTest() == 2);
515521}
516522
test/behavior/generics.zig+1
......@@ -169,6 +169,7 @@ test "generic fn keeps non-generic parameter types" {
169169 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
170170 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
171171 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
172 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
172173
173174 const A = 128;
174175
test/behavior/pointers.zig+8
......@@ -267,6 +267,8 @@ test "implicit cast error unions with non-optional to optional pointer" {
267267}
268268
269269test "compare equality of optional and non-optional pointer" {
270 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
271
270272 const a = @as(*const usize, @ptrFromInt(0x12345678));
271273 const b = @as(?*usize, @ptrFromInt(0x12345678));
272274 try expect(a == b);
......@@ -453,6 +455,8 @@ test "pointer sentinel with +inf" {
453455}
454456
455457test "pointer to array at fixed address" {
458 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
459
456460 const array = @as(*volatile [2]u32, @ptrFromInt(0x10));
457461 // Silly check just to reference `array`
458462 try expect(@intFromPtr(&array[0]) == 0x10);
......@@ -494,6 +498,8 @@ test "pointer-integer arithmetic affects the alignment" {
494498}
495499
496500test "@intFromPtr on null optional at comptime" {
501 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
502
497503 {
498504 const pointer = @as(?*u8, @ptrFromInt(0x000));
499505 const x = @intFromPtr(pointer);
......@@ -704,6 +710,8 @@ test "pointer-to-array constness for zero-size elements, const" {
704710}
705711
706712test "cast pointers with zero sized elements" {
713 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
714
707715 const a: *void = undefined;
708716 const b: *[1]void = a;
709717 _ = b;
test/behavior/ptrfromint.zig+1
......@@ -44,6 +44,7 @@ test "@ptrFromInt creates null pointer" {
4444test "@ptrFromInt creates allowzero zero pointer" {
4545 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
4646 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
47 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
4748
4849 const ptr = @as(*allowzero u32, @ptrFromInt(0));
4950 try expectEqual(@as(usize, 0), @intFromPtr(ptr));
test/behavior/slice.zig+2
......@@ -238,6 +238,8 @@ test "slicing pointer by length" {
238238const x = @as([*]i32, @ptrFromInt(0x1000))[0..0x500];
239239const y = x[0x100..];
240240test "compile time slice of pointer to hard coded address" {
241 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
242
241243 try expect(@intFromPtr(x) == 0x1000);
242244 try expect(x.len == 0x500);
243245
test/behavior/struct.zig+4
......@@ -1347,6 +1347,8 @@ test "struct field has a pointer to an aligned version of itself" {
13471347}
13481348
13491349test "struct has only one reference" {
1350 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1351
13501352 const S = struct {
13511353 fn optionalStructParam(_: ?struct { x: u8 }) void {}
13521354 fn errorUnionStructParam(_: error{}!struct { x: u8 }) void {}
......@@ -1553,6 +1555,7 @@ test "struct field pointer has correct alignment" {
15531555 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
15541556 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
15551557 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1558 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
15561559
15571560 const S = struct {
15581561 fn doTheTest() !void {
......@@ -1582,6 +1585,7 @@ test "extern struct field pointer has correct alignment" {
15821585 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
15831586 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
15841587 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1588 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
15851589
15861590 const S = struct {
15871591 fn doTheTest() !void {
test/behavior/union.zig+2
......@@ -1481,6 +1481,7 @@ test "defined-layout union field pointer has correct alignment" {
14811481 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
14821482 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
14831483 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1484 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
14841485
14851486 const S = struct {
14861487 fn doTheTest(comptime U: type) !void {
......@@ -1515,6 +1516,7 @@ test "undefined-layout union field pointer has correct alignment" {
15151516 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
15161517 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
15171518 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1519 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
15181520
15191521 const S = struct {
15201522 fn doTheTest(comptime U: type) !void {