aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/try.zig
diff options
context:
space:
mode:
authorAli Chraghi <alichraghi@proton.me>2023-05-11 09:23:34 +0330
committerRobin Voetter <robin@voetter.nl>2023-05-11 20:31:52 +0200
commitccc490ef6876291ed3df5e945e7df913018c32af (patch)
tree6716f9e5019e686c9584fee43e83334e689716c9 /test/behavior/try.zig
parente26d8d060410ff5f62356c41f3c782f8a9081495 (diff)
downloadzig-ccc490ef6876291ed3df5e945e7df913018c32af.tar.gz
zig-ccc490ef6876291ed3df5e945e7df913018c32af.zip
setup spirv backend in behavior tests
Diffstat (limited to 'test/behavior/try.zig')
-rw-r--r--test/behavior/try.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/behavior/try.zig b/test/behavior/try.zig
index 36428a4616..967b1af04e 100644
--- a/test/behavior/try.zig
+++ b/test/behavior/try.zig
@@ -4,6 +4,7 @@ const expect = std.testing.expect;
test "try on error union" {
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try tryOnErrorUnionImpl();
comptime try tryOnErrorUnionImpl();
@@ -23,6 +24,8 @@ fn returnsTen() anyerror!i32 {
}
test "try without vars" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
const result1 = if (failIfTrue(true)) 1 else |_| @as(i32, 2);
try expect(result1 == 2);
@@ -39,6 +42,8 @@ fn failIfTrue(ok: bool) anyerror!void {
}
test "try then not executed with assignment" {
+ if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
+
if (failIfTrue(true)) {
unreachable;
} else |err| {