diff --git a/test/cases/compile_errors/extern_spirv_decoration_validation.zig b/test/cases/compile_errors/extern_spirv_decoration_validation.zig index ae64963849857b2ba6b95f45b33c179b6700870b..a7cdd98b58e6195fe62281c9ed025659bc9c6a57 100644 --- a/test/cases/compile_errors/extern_spirv_decoration_validation.zig +++ b/test/cases/compile_errors/extern_spirv_decoration_validation.zig @@ -10,4 +10,4 @@ comptime { // backend=selfhosted // target=spirv32-vulkan // -// :1:45: error: "flat" decoration requires "input" or "output" address space +// :1:52: error: "flat" decoration requires "input" or "output" address space diff --git a/test/cases/compile_errors/loading_spirv_runtime_array_value.zig b/test/cases/compile_errors/loading_spirv_runtime_array_value.zig index 39cd38b36f0e3bce36884911de9b9e2f4f03c55f..19bdcefc4f208f262693c3503e5024e837f82592 100644 --- a/test/cases/compile_errors/loading_spirv_runtime_array_value.zig +++ b/test/cases/compile_errors/loading_spirv_runtime_array_value.zig @@ -19,5 +19,5 @@ export fn main2() callconv(.kernel) void { // backend=selfhosted // target=spirv32-vulkan // -// :10:15: error: cannot load SPIR-V runtime array value -// :15:12: error: cannot load SPIR-V runtime array value +// :10:18: error: cannot load SPIR-V runtime array value +// :15:10: error: cannot load SPIR-V runtime array value diff --git a/test/cases/compile_errors/spirv_merge_logical_pointers.zig b/test/cases/compile_errors/spirv_merge_logical_pointers.zig index ccceef8097c8418dcfc363f6baa87c0e04073b3c..640129575d3103ae9c8ac2b5bd636e7a9a1021ab 100644 --- a/test/cases/compile_errors/spirv_merge_logical_pointers.zig +++ b/test/cases/compile_errors/spirv_merge_logical_pointers.zig @@ -11,6 +11,7 @@ export fn a() void { } // error +// backend=selfhosted // target=spirv32-vulkan // // :9:13: error: value with non-mergable pointer type '*i32' depends on runtime control flow diff --git a/test/cases/compile_errors/spirv_slices.zig b/test/cases/compile_errors/spirv_slices.zig index 8e6e657025982ad316bc058025e1374e30520aec..73554699caf09fb3a1c7cf86fa3a19863ddd767e 100644 --- a/test/cases/compile_errors/spirv_slices.zig +++ b/test/cases/compile_errors/spirv_slices.zig @@ -1,6 +1,6 @@ export fn a() void { - var buf: [3]f32 = undefined; - takesSlice(&buf); // error + var x: [3]f32 = .{ 1, 2, 3 }; + takesSlice(&x); } fn takesSlice(buf: []f32) void { @@ -8,34 +8,18 @@ fn takesSlice(buf: []f32) void { } export fn b() void { - var buf: [3]f32 = undefined; - for (buf[0..3]) |_| {} // error -} - -export fn c() void { - var buf: [3]f32 = undefined; - for (&buf) |_| {} // not an error -} - -export fn d() void { - const buf: [3]f32 = .{1, 2, 3}; - for (comptime buf[0..3]) |_| {} // not an error -} - -export fn e() void { - const buf: [3]f32 = .{1, 2, 3}; - for (comptime buf[0..3]) |_| {} // not an error - for (buf[0..3]) |_| {} // error + const x: [3]f32 = .{ 1, 2, 3 }; + for (comptime x[0..3]) |_| {} + for (&x) |_| {} + for (x[0..3]) |_| {} } // error -// backend=auto +// backend=selfhosted // target=spirv32-opengl,spirv32-vulkan // cpu_features=baseline+variable_pointers // // :3:16: error: cannot construct slice from address space 'generic' // :3:16: note: only 'shared' and 'storage_buffer' address spaces support slicing on SPIR-V -// :12:13: error: cannot construct slice from address space 'generic' -// :12:13: note: only 'shared' and 'storage_buffer' address spaces support slicing on SPIR-V -// :28:13: error: cannot construct slice from address space 'generic' -// :28:13: note: only 'shared' and 'storage_buffer' address spaces support slicing on SPIR-V +// :14:11: error: cannot construct slice from address space 'generic' +// :14:11: note: only 'shared' and 'storage_buffer' address spaces support slicing on SPIR-V diff --git a/test/cases/compile_errors/spirv_unsupported_float_width.zig b/test/cases/compile_errors/spirv_unsupported_float_width.zig deleted file mode 100644 index 364e9f8385f607af4f766bdd742c261a782635a8..0000000000000000000000000000000000000000 --- a/test/cases/compile_errors/spirv_unsupported_float_width.zig +++ /dev/null @@ -1,16 +0,0 @@ -export fn use_f80() callconv(.kernel) void { - var x: f80 = 1.5; - _ = &x; -} - -export fn use_f16() callconv(.kernel) void { - var x: f16 = 1.5; - _ = &x; -} - -// error -// backend=selfhosted -// target=spirv32-vulkan -// -// :2:5: error: 'f80' is not supported on the current SPIR-V feature set -// :7:5: error: 'f16' is not supported on the current SPIR-V feature set diff --git a/test/src/Cases.zig b/test/src/Cases.zig index f16a73121c6a885ce09a1d69a39f53d85b737863..26cb1ae14be419ca3d7347c773b2d1ec567a0331 100644 --- a/test/src/Cases.zig +++ b/test/src/Cases.zig @@ -389,11 +389,12 @@ fn addFromDirInner( const resolved_target = b.resolveTargetQuery(target_query); const target = &resolved_target.result; for (backends) |backend| { - if (backend == .selfhosted and - target.cpu.arch != .aarch64 and target.cpu.arch != .wasm32 and target.cpu.arch != .x86_64 and target.cpu.arch != .spirv64) - { - // Other backends don't support new liveness format - continue; + if (backend == .selfhosted) { + switch (target.cpu.arch) { + .aarch64, .wasm32, .x86_64, .spirv64, .spirv32 => {}, + // Other backends don't support new liveness format + else => continue, + } } if (backend == .selfhosted and target.cpu.arch == .aarch64) {