mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
spirv: don't hardcode test error type alignment
This commit is contained in:
parent
2a4e06bcb3
commit
2fc409a32f
3 changed files with 7 additions and 1 deletions
|
|
@ -2821,6 +2821,7 @@ const NavGen = struct {
|
||||||
/// TODO is to also write out the error as a function call parameter, and to somehow fetch
|
/// TODO is to also write out the error as a function call parameter, and to somehow fetch
|
||||||
/// the name of an error in the text executor.
|
/// the name of an error in the text executor.
|
||||||
fn generateTestEntryPoint(self: *NavGen, name: []const u8, spv_test_decl_index: SpvModule.Decl.Index) !void {
|
fn generateTestEntryPoint(self: *NavGen, name: []const u8, spv_test_decl_index: SpvModule.Decl.Index) !void {
|
||||||
|
const zcu = self.pt.zcu;
|
||||||
const target = self.spv.target;
|
const target = self.spv.target;
|
||||||
|
|
||||||
const anyerror_ty_id = try self.resolveType(Type.anyerror, .direct);
|
const anyerror_ty_id = try self.resolveType(Type.anyerror, .direct);
|
||||||
|
|
@ -2950,7 +2951,7 @@ const NavGen = struct {
|
||||||
.pointer = p_error_id,
|
.pointer = p_error_id,
|
||||||
.object = error_id,
|
.object = error_id,
|
||||||
.memory_access = .{
|
.memory_access = .{
|
||||||
.Aligned = .{ .literal_integer = @sizeOf(u16) },
|
.Aligned = .{ .literal_integer = @intCast(Type.abiAlignment(.anyerror, zcu).toByteUnits().?) },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
try section.emit(self.spv.gpa, .OpReturn, {});
|
try section.emit(self.spv.gpa, .OpReturn, {});
|
||||||
|
|
|
||||||
|
|
@ -140,6 +140,8 @@ test {
|
||||||
|
|
||||||
// This bug only repros in the root file
|
// This bug only repros in the root file
|
||||||
test "deference @embedFile() of a file full of zero bytes" {
|
test "deference @embedFile() of a file full of zero bytes" {
|
||||||
|
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||||
|
|
||||||
const contents = @embedFile("behavior/zero.bin").*;
|
const contents = @embedFile("behavior/zero.bin").*;
|
||||||
try @import("std").testing.expect(contents.len == 456);
|
try @import("std").testing.expect(contents.len == 456);
|
||||||
for (contents) |byte| try @import("std").testing.expect(byte == 0);
|
for (contents) |byte| try @import("std").testing.expect(byte == 0);
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,7 @@ test "cmp f16" {
|
||||||
}
|
}
|
||||||
|
|
||||||
test "cmp f32" {
|
test "cmp f32" {
|
||||||
|
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||||
if (builtin.cpu.arch.isArm() and builtin.target.abi.float() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
|
if (builtin.cpu.arch.isArm() and builtin.target.abi.float() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
|
||||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||||
|
|
@ -142,6 +143,7 @@ test "cmp f32" {
|
||||||
}
|
}
|
||||||
|
|
||||||
test "cmp f64" {
|
test "cmp f64" {
|
||||||
|
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||||
if (builtin.cpu.arch.isArm() and builtin.target.abi.float() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
|
if (builtin.cpu.arch.isArm() and builtin.target.abi.float() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234
|
||||||
|
|
@ -245,6 +247,7 @@ test "vector cmp f16" {
|
||||||
}
|
}
|
||||||
|
|
||||||
test "vector cmp f32" {
|
test "vector cmp f32" {
|
||||||
|
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
||||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue