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 {...@@ -10,4 +10,4 @@ comptime {
10// backend=selfhosted10// backend=selfhosted
11// target=spirv32-vulkan11// target=spirv32-vulkan
12//12//
13// :1:45: error: "flat" decoration requires "input" or "output" address space13// :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 {...@@ -19,5 +19,5 @@ export fn main2() callconv(.kernel) void {
19// backend=selfhosted19// backend=selfhosted
20// target=spirv32-vulkan20// target=spirv32-vulkan
21//21//
22// :10:15: error: cannot load SPIR-V runtime array value22// :10:18: error: cannot load SPIR-V runtime array value
23// :15:12: error: cannot load SPIR-V runtime array value23// :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 {...@@ -11,6 +11,7 @@ export fn a() void {
11}11}
1212
13// error13// error
14// backend=selfhosted
14// target=spirv32-vulkan15// target=spirv32-vulkan
15//16//
16// :9:13: error: value with non-mergable pointer type '*i32' depends on runtime control flow17// :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 @@...@@ -1,6 +1,6 @@
1export fn a() void {1export fn a() void {
2 var buf: [3]f32 = undefined;2 var x: [3]f32 = .{ 1, 2, 3 };
3 takesSlice(&buf); // error3 takesSlice(&x);
4}4}
55
6fn takesSlice(buf: []f32) void {6fn takesSlice(buf: []f32) void {
...@@ -8,34 +8,18 @@ fn takesSlice(buf: []f32) void {...@@ -8,34 +8,18 @@ fn takesSlice(buf: []f32) void {
8}8}
99
10export fn b() void {10export fn b() void {
11 var buf: [3]f32 = undefined;11 const x: [3]f32 = .{ 1, 2, 3 };
12 for (buf[0..3]) |_| {} // error12 for (comptime x[0..3]) |_| {}
13}13 for (&x) |_| {}
1414 for (x[0..3]) |_| {}
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
29}15}
3016
31// error17// error
32// backend=auto18// backend=selfhosted
33// target=spirv32-opengl,spirv32-vulkan19// target=spirv32-opengl,spirv32-vulkan
34// cpu_features=baseline+variable_pointers20// cpu_features=baseline+variable_pointers
35//21//
36// :3:16: error: cannot construct slice from address space 'generic'22// :3:16: error: cannot construct slice from address space 'generic'
37// :3:16: note: only 'shared' and 'storage_buffer' address spaces support slicing on SPIR-V23// :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'24// :14:11: error: cannot construct slice from address space 'generic'
39// :12:13: note: only 'shared' and 'storage_buffer' address spaces support slicing on SPIR-V25// :14:11: 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
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(...@@ -389,11 +389,12 @@ fn addFromDirInner(
389 const resolved_target = b.resolveTargetQuery(target_query);389 const resolved_target = b.resolveTargetQuery(target_query);
390 const target = &resolved_target.result;390 const target = &resolved_target.result;
391 for (backends) |backend| {391 for (backends) |backend| {
392 if (backend == .selfhosted and392 if (backend == .selfhosted) {
393 target.cpu.arch != .aarch64 and target.cpu.arch != .wasm32 and target.cpu.arch != .x86_64 and target.cpu.arch != .spirv64)393 switch (target.cpu.arch) {
394 {394 .aarch64, .wasm32, .x86_64, .spirv64, .spirv32 => {},
395 // Other backends don't support new liveness format395 // Other backends don't support new liveness format
396 continue;396 else => continue,
397 }
397 }398 }
398399
399 if (backend == .selfhosted and target.cpu.arch == .aarch64) {400 if (backend == .selfhosted and target.cpu.arch == .aarch64) {