setup spirv backend in behavior tests
This commit is contained in:
committed by
Robin Voetter
parent
e26d8d0604
commit
ccc490ef68
@@ -5,6 +5,7 @@ const assert = std.debug.assert;
|
||||
|
||||
test "while loop" {
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
var i: i32 = 0;
|
||||
while (i < 4) {
|
||||
@@ -38,6 +39,8 @@ fn staticWhileLoop2() i32 {
|
||||
}
|
||||
|
||||
test "while with continue expression" {
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
var sum: i32 = 0;
|
||||
{
|
||||
var i: i32 = 0;
|
||||
@@ -50,6 +53,8 @@ test "while with continue expression" {
|
||||
}
|
||||
|
||||
test "while with else" {
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
var sum: i32 = 0;
|
||||
var i: i32 = 0;
|
||||
var got_else: i32 = 0;
|
||||
@@ -77,6 +82,8 @@ fn getNumberOrNull() ?i32 {
|
||||
}
|
||||
|
||||
test "continue outer while loop" {
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
testContinueOuter();
|
||||
comptime testContinueOuter();
|
||||
}
|
||||
@@ -123,6 +130,7 @@ test "while copies its payload" {
|
||||
|
||||
test "continue and break" {
|
||||
if (builtin.zig_backend == .stage2_aarch64 and builtin.os.tag == .macos) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
try runContinueAndBreakTest();
|
||||
try expect(continue_and_break_counter == 8);
|
||||
@@ -144,6 +152,7 @@ fn runContinueAndBreakTest() !void {
|
||||
test "while with optional as condition" {
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
numbers_left = 10;
|
||||
var sum: i32 = 0;
|
||||
@@ -156,6 +165,7 @@ test "while with optional as condition" {
|
||||
test "while with optional as condition with else" {
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
numbers_left = 10;
|
||||
var sum: i32 = 0;
|
||||
@@ -172,6 +182,7 @@ test "while with optional as condition with else" {
|
||||
|
||||
test "while with error union condition" {
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
numbers_left = 10;
|
||||
var sum: i32 = 0;
|
||||
@@ -215,6 +226,7 @@ test "while on optional with else result follow break prong" {
|
||||
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;
|
||||
|
||||
const result = while (returnOptional(10)) |value| {
|
||||
break value;
|
||||
@@ -242,6 +254,8 @@ fn returnTrue() bool {
|
||||
}
|
||||
|
||||
test "return with implicit cast from while loop" {
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
returnWithImplicitCastFromWhileLoopTest() catch unreachable;
|
||||
}
|
||||
fn returnWithImplicitCastFromWhileLoopTest() anyerror!void {
|
||||
@@ -252,6 +266,7 @@ fn returnWithImplicitCastFromWhileLoopTest() anyerror!void {
|
||||
|
||||
test "while on error union with else result follow else prong" {
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
const result = while (returnError()) |value| {
|
||||
break value;
|
||||
@@ -261,6 +276,7 @@ test "while on error union with else result follow else prong" {
|
||||
|
||||
test "while on error union with else result follow break prong" {
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
const result = while (returnSuccess(10)) |value| {
|
||||
break value;
|
||||
@@ -306,6 +322,7 @@ test "while error 2 break statements and an else" {
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
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;
|
||||
|
||||
const S = struct {
|
||||
fn entry(opt_t: anyerror!bool, f: bool) !void {
|
||||
@@ -331,6 +348,8 @@ test "continue inline while loop" {
|
||||
}
|
||||
|
||||
test "else continue outer while" {
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
var i: usize = 0;
|
||||
while (true) {
|
||||
i += 1;
|
||||
@@ -343,6 +362,7 @@ test "else continue outer while" {
|
||||
test "try terminating an infinite loop" {
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
// Test coverage for https://github.com/ziglang/zig/issues/13546
|
||||
const Foo = struct {
|
||||
|
||||
Reference in New Issue
Block a user