| author | |
| committer | |
| log | 073289d0dadfd1ea0088837563a109100b065ed3 |
| tree | 0f418d7fd310b768ba343aa7778b528f7ec02135 |
| parent | aa398034eb1b2fd74e1815ae2e75ca1a3ca4a567 |
| signature |
Some new behavior tests have recently been added, and not all of these
pass with the SPIR-V backend.6 files changed, 13 insertions(+), 0 deletions(-)
test/behavior/c_char_signedness.zig+3| ... | ... | @@ -1,10 +1,13 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | |
| 2 | 3 | const expectEqual = std.testing.expectEqual; |
| 3 | 4 | const c = @cImport({ |
| 4 | 5 | @cInclude("limits.h"); |
| 5 | 6 | }); |
| 6 | 7 | |
| 7 | 8 | test "c_char signedness" { |
| 9 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 10 | ||
| 8 | 11 | try expectEqual(@as(c_char, c.CHAR_MIN), std.math.minInt(c_char)); |
| 9 | 12 | try expectEqual(@as(c_char, c.CHAR_MAX), std.math.maxInt(c_char)); |
| 10 | 13 | } |
test/behavior/call.zig+2| ... | ... | @@ -417,6 +417,8 @@ test "inline while with @call" { |
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | test "method call as parameter type" { |
| 420 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 421 | ||
| 420 | 422 | const S = struct { |
| 421 | 423 | fn foo(x: anytype, y: @TypeOf(x).Inner()) @TypeOf(y) { |
| 422 | 424 | return y; |
test/behavior/comptime_memory.zig+2| ... | ... | @@ -433,6 +433,8 @@ test "dereference undefined pointer to zero-bit type" { |
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | test "type pun extern struct" { |
| 436 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 437 | ||
| 436 | 438 | const S = extern struct { f: u8 }; |
| 437 | 439 | comptime var s = S{ .f = 123 }; |
| 438 | 440 | @as(*u8, @ptrCast(&s)).* = 72; |
test/behavior/enum.zig+2| ... | ... | @@ -1199,6 +1199,8 @@ test "enum tag from a local variable" { |
| 1199 | 1199 | } |
| 1200 | 1200 | |
| 1201 | 1201 | test "auto-numbered enum with signed tag type" { |
| 1202 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 1203 | ||
| 1202 | 1204 | const E = enum(i32) { a, b }; |
| 1203 | 1205 | |
| 1204 | 1206 | try std.testing.expectEqual(@as(i32, 0), @intFromEnum(E.a)); |
test/behavior/maximum_minimum.zig+2| ... | ... | @@ -297,6 +297,8 @@ test "@min/@max notices bounds from vector types when element of comptime-known |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | test "@min/@max of signed and unsigned runtime integers" { |
| 300 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 301 | ||
| 300 | 302 | var x: i32 = -1; |
| 301 | 303 | var y: u31 = 1; |
| 302 | 304 |
test/behavior/ptrfromint.zig+2| ... | ... | @@ -33,6 +33,7 @@ test "@ptrFromInt creates null pointer" { |
| 33 | 33 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 34 | 34 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 35 | 35 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 36 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 36 | 37 | |
| 37 | 38 | const ptr = @as(?*u32, @ptrFromInt(0)); |
| 38 | 39 | try expectEqual(@as(?*u32, null), ptr); |
| ... | ... | @@ -42,6 +43,7 @@ test "@ptrFromInt creates allowzero zero pointer" { |
| 42 | 43 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 43 | 44 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 44 | 45 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 46 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 45 | 47 | |
| 46 | 48 | const ptr = @as(*allowzero u32, @ptrFromInt(0)); |
| 47 | 49 | try expectEqual(@as(usize, 0), @intFromPtr(ptr)); |