aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Voetter <robin@voetter.nl>2023-08-26 11:32:37 +0200
committerAndrew Kelley <andrew@ziglang.org>2023-09-23 12:36:44 -0700
commit79f7481575005f9f63b5b3be8dd89b92b11b9c77 (patch)
treeab44253bc9180d8947322504c78ddc5c91e01b75
parent865b2e259bf78dbf1d4c1051b5fff68b90bca65f (diff)
downloadzig-79f7481575005f9f63b5b3be8dd89b92b11b9c77.tar.gz
zig-79f7481575005f9f63b5b3be8dd89b92b11b9c77.zip
spirv: disable failing tests
-rw-r--r--src/codegen/spirv.zig1
-rw-r--r--src/link/SpirV.zig5
-rw-r--r--test/behavior/alignof.zig2
-rw-r--r--test/behavior/array.zig4
-rw-r--r--test/behavior/bitcast.zig4
-rw-r--r--test/behavior/bugs/5487.zig1
-rw-r--r--test/behavior/call_tail.zig1
-rw-r--r--test/behavior/cast.zig2
-rw-r--r--test/behavior/comptime_memory.zig2
-rw-r--r--test/behavior/error.zig1
-rw-r--r--test/behavior/eval.zig1
-rw-r--r--test/behavior/fn.zig2
-rw-r--r--test/behavior/generics.zig1
-rw-r--r--test/behavior/math.zig2
-rw-r--r--test/behavior/optional.zig2
-rw-r--r--test/behavior/struct.zig11
-rw-r--r--test/behavior/switch.zig2
-rw-r--r--test/behavior/translate_c_macros.zig2
-rw-r--r--test/behavior/type_info_only_pub_decls.zig3
-rw-r--r--test/behavior/undefined.zig1
-rw-r--r--test/behavior/union.zig2
-rw-r--r--test/behavior/var_args.zig9
22 files changed, 61 insertions, 0 deletions
diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig
index 33a864ea0a..22d7560806 100644
--- a/src/codegen/spirv.zig
+++ b/src/codegen/spirv.zig
@@ -1242,6 +1242,7 @@ pub const DeclGen = struct {
},
.Int => {
const int_info = ty.intInfo(mod);
+ // TODO: Integers in OpenCL kernels are always unsigned.
return try self.intType(int_info.signedness, int_info.bits);
},
.Enum => {
diff --git a/src/link/SpirV.zig b/src/link/SpirV.zig
index da5fef7c85..bf133bbb16 100644
--- a/src/link/SpirV.zig
+++ b/src/link/SpirV.zig
@@ -110,6 +110,8 @@ pub fn updateFunc(self: *SpirV, module: *Module, func_index: InternPool.Index, a
}
const func = module.funcInfo(func_index);
+ const decl = module.declPtr(func.owner_decl);
+ log.debug("lowering function {s}", .{ module.intern_pool.stringToSlice(decl.name) });
var decl_gen = codegen.DeclGen.init(self.base.allocator, module, &self.spv, &self.decl_link);
defer decl_gen.deinit();
@@ -124,6 +126,9 @@ pub fn updateDecl(self: *SpirV, module: *Module, decl_index: Module.Decl.Index)
@panic("Attempted to compile for architecture that was disabled by build configuration");
}
+ const decl = module.declPtr(decl_index);
+ log.debug("lowering declaration {s}", .{ module.intern_pool.stringToSlice(decl.name) });
+
var decl_gen = codegen.DeclGen.init(self.base.allocator, module, &self.spv, &self.decl_link);
defer decl_gen.deinit();
diff --git a/test/behavior/alignof.zig b/test/behavior/alignof.zig
index 0443b2d6b3..ddc514e4e3 100644
--- a/test/behavior/alignof.zig
+++ b/test/behavior/alignof.zig
@@ -28,6 +28,8 @@ test "comparison of @alignOf(T) against zero" {
}
test "correct alignment for elements and slices of aligned array" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
var buf: [1024]u8 align(64) = undefined;
var start: usize = 1;
var end: usize = undefined;
diff --git a/test/behavior/array.zig b/test/behavior/array.zig
index 523855161a..b252265c5b 100644
--- a/test/behavior/array.zig
+++ b/test/behavior/array.zig
@@ -763,6 +763,8 @@ test "slicing array of zero-sized values" {
}
test "array init with no result pointer sets field result types" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
const S = struct {
// A function parameter has a result type, but no result pointer.
fn f(arr: [1]u32) u32 {
@@ -777,6 +779,8 @@ test "array init with no result pointer sets field result types" {
}
test "runtime side-effects in comptime-known array init" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
var side_effects: u4 = 0;
const init = [4]u4{
blk: {
diff --git a/test/behavior/bitcast.zig b/test/behavior/bitcast.zig
index 974d656323..4294cf117a 100644
--- a/test/behavior/bitcast.zig
+++ b/test/behavior/bitcast.zig
@@ -271,6 +271,8 @@ test "comptime bitcast used in expression has the correct type" {
}
test "bitcast passed as tuple element" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
const S = struct {
fn foo(args: anytype) !void {
try comptime expect(@TypeOf(args[0]) == f32);
@@ -281,6 +283,8 @@ test "bitcast passed as tuple element" {
}
test "triple level result location with bitcast sandwich passed as tuple element" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
const S = struct {
fn foo(args: anytype) !void {
try comptime expect(@TypeOf(args[0]) == f64);
diff --git a/test/behavior/bugs/5487.zig b/test/behavior/bugs/5487.zig
index 3ea8cad220..ac9f15dfef 100644
--- a/test/behavior/bugs/5487.zig
+++ b/test/behavior/bugs/5487.zig
@@ -13,5 +13,6 @@ test "crash" {
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
_ = io.multiWriter(.{writer()});
}
diff --git a/test/behavior/call_tail.zig b/test/behavior/call_tail.zig
index 10ef766a65..ccd0d2ad1e 100644
--- a/test/behavior/call_tail.zig
+++ b/test/behavior/call_tail.zig
@@ -46,6 +46,7 @@ test "arguments pointed to on stack into tailcall" {
}
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
var data = [_]u64{ 1, 6, 2, 7, 1, 9, 3 };
base = @intFromPtr(&data);
diff --git a/test/behavior/cast.zig b/test/behavior/cast.zig
index b2dbffee17..bdaece3533 100644
--- a/test/behavior/cast.zig
+++ b/test/behavior/cast.zig
@@ -1156,6 +1156,7 @@ fn foobar(func: PFN_void) !void {
test "cast function with an opaque parameter" {
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_c) {
// https://github.com/ziglang/zig/issues/16845
@@ -2501,6 +2502,7 @@ test "@intFromBool on vector" {
test "numeric coercions with undefined" {
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
const from: i32 = undefined;
var to: f32 = from;
diff --git a/test/behavior/comptime_memory.zig b/test/behavior/comptime_memory.zig
index 639de0f5f2..4d6ef5b1db 100644
--- a/test/behavior/comptime_memory.zig
+++ b/test/behavior/comptime_memory.zig
@@ -425,6 +425,8 @@ test "mutate entire slice at comptime" {
}
test "dereference undefined pointer to zero-bit type" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
const p0: *void = undefined;
try testing.expectEqual({}, p0.*);
diff --git a/test/behavior/error.zig b/test/behavior/error.zig
index 4f26c9b18c..dc4cd838ec 100644
--- a/test/behavior/error.zig
+++ b/test/behavior/error.zig
@@ -942,6 +942,7 @@ test "returning an error union containing a type with no runtime bits" {
test "try used in recursive function with inferred error set" {
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
const Value = union(enum) {
values: []const @This(),
diff --git a/test/behavior/eval.zig b/test/behavior/eval.zig
index e838dcaf42..2812457388 100644
--- a/test/behavior/eval.zig
+++ b/test/behavior/eval.zig
@@ -729,6 +729,7 @@ fn loopNTimes(comptime n: usize) void {
}
test "variable inside inline loop that has different types on different iterations" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try testVarInsideInlineLoop(.{ true, @as(u32, 42) });
}
diff --git a/test/behavior/fn.zig b/test/behavior/fn.zig
index 1a5becc6b0..7ccd9d5351 100644
--- a/test/behavior/fn.zig
+++ b/test/behavior/fn.zig
@@ -583,6 +583,8 @@ test "lazy values passed to anytype parameter" {
}
test "pass and return comptime-only types" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
const S = struct {
fn returnNull(comptime x: @Type(.Null)) @Type(.Null) {
return x;
diff --git a/test/behavior/generics.zig b/test/behavior/generics.zig
index 0954615223..f2b4ebf309 100644
--- a/test/behavior/generics.zig
+++ b/test/behavior/generics.zig
@@ -288,6 +288,7 @@ test "generic function instantiation turns into comptime call" {
test "generic function with void and comptime parameter" {
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
const S = struct { x: i32 };
const namespace = struct {
diff --git a/test/behavior/math.zig b/test/behavior/math.zig
index a7aea59e9a..64ee1c4cbf 100644
--- a/test/behavior/math.zig
+++ b/test/behavior/math.zig
@@ -1289,6 +1289,8 @@ fn testShrExact(x: u8) !void {
}
test "shift left/right on u0 operand" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
const S = struct {
fn doTheTest() !void {
var x: u0 = 0;
diff --git a/test/behavior/optional.zig b/test/behavior/optional.zig
index 496da99e00..0b2d7d1110 100644
--- a/test/behavior/optional.zig
+++ b/test/behavior/optional.zig
@@ -500,6 +500,8 @@ test "cast slice to const slice nested in error union and optional" {
}
test "variable of optional of noreturn" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
var null_opv: ?noreturn = null;
try std.testing.expectEqual(@as(?noreturn, null), null_opv);
}
diff --git a/test/behavior/struct.zig b/test/behavior/struct.zig
index 636ac8c2a5..ac57f9176b 100644
--- a/test/behavior/struct.zig
+++ b/test/behavior/struct.zig
@@ -137,6 +137,8 @@ test "invoke static method in global scope" {
const empty_global_instance = StructWithNoFields{};
test "return empty struct instance" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
_ = returnEmptyStructInstance();
}
fn returnEmptyStructInstance() StructWithNoFields {
@@ -331,6 +333,7 @@ const VoidStructFieldsFoo = struct {
test "return empty struct from fn" {
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
_ = testReturnEmptyStructFromFn();
}
@@ -893,6 +896,8 @@ test "anonymous struct literal syntax" {
}
test "fully anonymous struct" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
const S = struct {
fn doTheTest() !void {
try dump(.{
@@ -915,6 +920,8 @@ test "fully anonymous struct" {
}
test "fully anonymous list literal" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
const S = struct {
fn doTheTest() !void {
try dump(.{ @as(u32, 1234), @as(f64, 12.34), true, "hi" });
@@ -1715,6 +1722,8 @@ test "extern struct field pointer has correct alignment" {
}
test "packed struct field in anonymous struct" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
const T = packed struct {
f1: bool = false,
};
@@ -1740,6 +1749,8 @@ test "struct init with no result pointer sets field result types" {
}
test "runtime side-effects in comptime-known struct init" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
var side_effects: u4 = 0;
const S = struct { a: u4, b: u4, c: u4, d: u4 };
const init = S{
diff --git a/test/behavior/switch.zig b/test/behavior/switch.zig
index 7d90247a30..4e6b7ad761 100644
--- a/test/behavior/switch.zig
+++ b/test/behavior/switch.zig
@@ -799,6 +799,8 @@ test "inline switch range that includes the maximum value of the switched type"
}
test "nested break ignores switch conditions and breaks instead" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
const S = struct {
fn register_to_address(ident: []const u8) !u8 {
const reg: u8 = if (std.mem.eql(u8, ident, "zero")) 0x00 else blk: {
diff --git a/test/behavior/translate_c_macros.zig b/test/behavior/translate_c_macros.zig
index 09dabb7df6..b497c9073b 100644
--- a/test/behavior/translate_c_macros.zig
+++ b/test/behavior/translate_c_macros.zig
@@ -233,6 +233,8 @@ test "@typeInfo on @cImport result" {
}
test "Macro that uses Long type concatenation casting" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
try expect((@TypeOf(h.X)) == c_long);
try expectEqual(h.X, @as(c_long, 10));
}
diff --git a/test/behavior/type_info_only_pub_decls.zig b/test/behavior/type_info_only_pub_decls.zig
index 7ed6910570..80d05d8ba1 100644
--- a/test/behavior/type_info_only_pub_decls.zig
+++ b/test/behavior/type_info_only_pub_decls.zig
@@ -1,3 +1,4 @@
+const builtin = @import("builtin");
const std = @import("std");
const other = struct {
const std = @import("std");
@@ -14,6 +15,8 @@ const other = struct {
};
test {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
const ti = @typeInfo(other);
const decls = ti.Struct.decls;
diff --git a/test/behavior/undefined.zig b/test/behavior/undefined.zig
index 9f134b315f..04172acfa1 100644
--- a/test/behavior/undefined.zig
+++ b/test/behavior/undefined.zig
@@ -82,6 +82,7 @@ test "assign undefined to struct with method" {
test "type name of undefined" {
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
const x = undefined;
try expect(mem.eql(u8, @typeName(@TypeOf(x)), "@TypeOf(undefined)"));
diff --git a/test/behavior/union.zig b/test/behavior/union.zig
index ff5fd9edc4..408506d3aa 100644
--- a/test/behavior/union.zig
+++ b/test/behavior/union.zig
@@ -1669,6 +1669,8 @@ test "packed union field pointer has correct alignment" {
}
test "union with 128 bit integer" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
const ValueTag = enum { int, other };
const Value3 = union(ValueTag) {
diff --git a/test/behavior/var_args.zig b/test/behavior/var_args.zig
index 01732b7f53..3aea3ec248 100644
--- a/test/behavior/var_args.zig
+++ b/test/behavior/var_args.zig
@@ -14,6 +14,8 @@ fn add(args: anytype) i32 {
}
test "add arbitrary args" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
try expect(add(.{ @as(i32, 1), @as(i32, 2), @as(i32, 3), @as(i32, 4) }) == 10);
try expect(add(.{@as(i32, 1234)}) == 1234);
try expect(add(.{}) == 0);
@@ -24,12 +26,15 @@ fn readFirstVarArg(args: anytype) void {
}
test "send void arg to var args" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
readFirstVarArg(.{{}});
}
test "pass args directly" {
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try expect(addSomeStuff(.{ @as(i32, 1), @as(i32, 2), @as(i32, 3), @as(i32, 4) }) == 10);
try expect(addSomeStuff(.{@as(i32, 1234)}) == 1234);
@@ -82,11 +87,15 @@ fn foo2(args: anytype) bool {
}
test "array of var args functions" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
try expect(foos[0](.{}));
try expect(!foos[1](.{}));
}
test "pass zero length array to var args param" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
doNothingWithFirstArg(.{""});
}