| author | |
| committer | |
| log | 6664d2418d0348c6432a1c93c96b4412f80036a8 |
| tree | cf713f610f947f596e71ea777978c69d7f5d286b |
| parent | 6d6f6a4ac6f1f2666fa2d4500ef4634fdfe0d947 |
The new testing harness is not bound by previous limitations; it can now
test compile log output as well.7 files changed, 34 insertions(+), 1 deletions(-)
test/cases/compile_errors/compileLog_of_tagged_enum_doesnt_crash_the_compiler.zig+4| ... | ... | @@ -15,3 +15,7 @@ pub export fn entry() void { |
| 15 | 15 | // target=native |
| 16 | 16 | // |
| 17 | 17 | // :6:5: error: found compile log statement |
| 18 | // | |
| 19 | // Compile Log Output: | |
| 20 | // @as(tmp.Bar, .{ .X = 123 }) | |
| 21 | // @as(tmp.Bar, [runtime value]) |
test/cases/compile_errors/compile_log.zig+9| ... | ... | @@ -17,3 +17,12 @@ export fn baz() void { |
| 17 | 17 | // |
| 18 | 18 | // :5:5: error: found compile log statement |
| 19 | 19 | // :11:5: note: also here |
| 20 | // | |
| 21 | // Compile Log Output: | |
| 22 | // @as(*const [5:0]u8, "begin") | |
| 23 | // @as(*const [1:0]u8, "a"), @as(i32, 12), @as(*const [1:0]u8, "b"), @as([]const u8, "hi") | |
| 24 | // @as(*const [3:0]u8, "end") | |
| 25 | // @as(comptime_int, 4) | |
| 26 | // @as(*const [5:0]u8, "begin") | |
| 27 | // @as(*const [1:0]u8, "a"), @as(i32, [runtime value]), @as(*const [1:0]u8, "b"), @as([]const u8, [runtime value]) | |
| 28 | // @as(*const [3:0]u8, "end") |
test/cases/compile_errors/compile_log_a_pointer_to_an_opaque_value.zig+4-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | export fn entry() void { |
| 2 | @compileLog(@ptrCast(*const anyopaque, &entry)); | |
| 2 | @compileLog(@ptrCast(*align(1) const anyopaque, &entry)); | |
| 3 | 3 | } |
| 4 | 4 | |
| 5 | 5 | // error |
| ... | ... | @@ -7,3 +7,6 @@ export fn entry() void { |
| 7 | 7 | // target=native |
| 8 | 8 | // |
| 9 | 9 | // :2:5: error: found compile log statement |
| 10 | // | |
| 11 | // Compile Log Output: | |
| 12 | // @as(*const anyopaque, (function 'entry')) |
test/cases/compile_errors/compile_log_statement_inside_function_which_must_be_comptime_evaluated.zig+3| ... | ... | @@ -12,3 +12,6 @@ export fn entry() void { |
| 12 | 12 | // target=native |
| 13 | 13 | // |
| 14 | 14 | // :2:5: error: found compile log statement |
| 15 | // | |
| 16 | // Compile Log Output: | |
| 17 | // @as(*const [3:0]u8, "i32\x00") |
test/cases/compile_errors/compile_log_statement_warning_deduplication_in_generic_fn.zig+5| ... | ... | @@ -13,3 +13,8 @@ fn inner(comptime n: usize) void { |
| 13 | 13 | // |
| 14 | 14 | // :7:39: error: found compile log statement |
| 15 | 15 | // :7:39: note: also here |
| 16 | // | |
| 17 | // Compile Log Output: | |
| 18 | // @as(*const [4:0]u8, "!@#$") | |
| 19 | // @as(*const [4:0]u8, "!@#$") | |
| 20 | // @as(*const [4:0]u8, "!@#$") |
test/cases/compile_log.0.zig+5| ... | ... | @@ -15,3 +15,8 @@ fn x() void {} |
| 15 | 15 | // error |
| 16 | 16 | // |
| 17 | 17 | // :6:23: error: expected type 'usize', found 'bool' |
| 18 | // | |
| 19 | // Compile Log Output: | |
| 20 | // @as(bool, true), @as(comptime_int, 20), @as(u32, [runtime value]), @as(fn() void, (function 'x')) | |
| 21 | // @as(comptime_int, 1000) | |
| 22 | // @as(comptime_int, 1234) |
test/cases/compile_log.1.zig+4| ... | ... | @@ -14,3 +14,7 @@ fn x() void {} |
| 14 | 14 | // |
| 15 | 15 | // :9:5: error: found compile log statement |
| 16 | 16 | // :4:5: note: also here |
| 17 | // | |
| 18 | // Compile Log Output: | |
| 19 | // @as(bool, true), @as(comptime_int, 20), @as(u32, [runtime value]), @as(fn() void, (function 'x')) | |
| 20 | // @as(comptime_int, 1000) |