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
log62e61e2e9b368bba001b67f4a29681b4bef4b822
treec3928f348ce8ea436facdf00570b90d32bc33481
parentd95c7db6ec9f17e0c212c010385ac61ad7340d43

test: do not skip spirv32 in selfhosted backend allowlist

These cases were never ran!

6 files changed, 19 insertions(+), 49 deletions(-)

test/cases/compile_errors/extern_spirv_decoration_validation.zig+1-1
......@@ -10,4 +10,4 @@ comptime {
1010// backend=selfhosted
1111// target=spirv32-vulkan
1212//
13// :1:45: error: "flat" decoration requires "input" or "output" address space
13// :1:52: error: "flat" decoration requires "input" or "output" address space
test/cases/compile_errors/loading_spirv_runtime_array_value.zig+2-2
......@@ -19,5 +19,5 @@ export fn main2() callconv(.kernel) void {
1919// backend=selfhosted
2020// target=spirv32-vulkan
2121//
22// :10:15: error: cannot load SPIR-V runtime array value
23// :15:12: error: cannot load SPIR-V runtime array value
22// :10:18: error: cannot load SPIR-V runtime array value
23// :15:10: error: cannot load SPIR-V runtime array value
test/cases/compile_errors/spirv_merge_logical_pointers.zig+1
......@@ -11,6 +11,7 @@ export fn a() void {
1111}
1212
1313// error
14// backend=selfhosted
1415// target=spirv32-vulkan
1516//
1617// :9:13: error: value with non-mergable pointer type '*i32' depends on runtime control flow
test/cases/compile_errors/spirv_slices.zig+9-25
......@@ -1,6 +1,6 @@
11export fn a() void {
2 var buf: [3]f32 = undefined;
3 takesSlice(&buf); // error
2 var x: [3]f32 = .{ 1, 2, 3 };
3 takesSlice(&x);
44}
55
66fn takesSlice(buf: []f32) void {
......@@ -8,34 +8,18 @@ fn takesSlice(buf: []f32) void {
88}
99
1010export fn b() void {
11 var buf: [3]f32 = undefined;
12 for (buf[0..3]) |_| {} // error
13}
14
15export fn c() void {
16 var buf: [3]f32 = undefined;
17 for (&buf) |_| {} // not an error
18}
19
20export fn d() void {
21 const buf: [3]f32 = .{1, 2, 3};
22 for (comptime buf[0..3]) |_| {} // not an error
23}
24
25export fn e() void {
26 const buf: [3]f32 = .{1, 2, 3};
27 for (comptime buf[0..3]) |_| {} // not an error
28 for (buf[0..3]) |_| {} // error
11 const x: [3]f32 = .{ 1, 2, 3 };
12 for (comptime x[0..3]) |_| {}
13 for (&x) |_| {}
14 for (x[0..3]) |_| {}
2915}
3016
3117// error
32// backend=auto
18// backend=selfhosted
3319// target=spirv32-opengl,spirv32-vulkan
3420// cpu_features=baseline+variable_pointers
3521//
3622// :3:16: error: cannot construct slice from address space 'generic'
3723// :3:16: note: only 'shared' and 'storage_buffer' address spaces support slicing on SPIR-V
38// :12:13: error: cannot construct slice from address space 'generic'
39// :12:13: note: only 'shared' and 'storage_buffer' address spaces support slicing on SPIR-V
40// :28:13: error: cannot construct slice from address space 'generic'
41// :28:13: note: only 'shared' and 'storage_buffer' address spaces support slicing on SPIR-V
24// :14:11: error: cannot construct slice from address space 'generic'
25// :14:11: note: only 'shared' and 'storage_buffer' address spaces support slicing on SPIR-V
test/cases/compile_errors/spirv_unsupported_float_width.zig deleted-16
......@@ -1,16 +0,0 @@
1export fn use_f80() callconv(.kernel) void {
2 var x: f80 = 1.5;
3 _ = &x;
4}
5
6export fn use_f16() callconv(.kernel) void {
7 var x: f16 = 1.5;
8 _ = &x;
9}
10
11// error
12// backend=selfhosted
13// target=spirv32-vulkan
14//
15// :2:5: error: 'f80' is not supported on the current SPIR-V feature set
16// :7:5: error: 'f16' is not supported on the current SPIR-V feature set
test/src/Cases.zig+6-5
......@@ -389,11 +389,12 @@ fn addFromDirInner(
389389 const resolved_target = b.resolveTargetQuery(target_query);
390390 const target = &resolved_target.result;
391391 for (backends) |backend| {
392 if (backend == .selfhosted and
393 target.cpu.arch != .aarch64 and target.cpu.arch != .wasm32 and target.cpu.arch != .x86_64 and target.cpu.arch != .spirv64)
394 {
395 // Other backends don't support new liveness format
396 continue;
392 if (backend == .selfhosted) {
393 switch (target.cpu.arch) {
394 .aarch64, .wasm32, .x86_64, .spirv64, .spirv32 => {},
395 // Other backends don't support new liveness format
396 else => continue,
397 }
397398 }
398399
399400 if (backend == .selfhosted and target.cpu.arch == .aarch64) {