aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorg-w1 <58830309+g-w1@users.noreply.github.com>2020-12-25 19:40:49 -0500
committerGitHub <noreply@github.com>2020-12-26 02:40:49 +0200
commit1634d45f1d53c8d7bfefa56ab4d2fa4cc8218b6d (patch)
tree85ec2c108a227da13542385d601364d7394e853b /test
parent939bd52c8a389993ab168ec9bb88c4e395045ac7 (diff)
downloadzig-1634d45f1d53c8d7bfefa56ab4d2fa4cc8218b6d.tar.gz
zig-1634d45f1d53c8d7bfefa56ab4d2fa4cc8218b6d.zip
stage2: add compile log statement (#7191)
Diffstat (limited to 'test')
-rw-r--r--test/stage2/test.zig15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/stage2/test.zig b/test/stage2/test.zig
index 3da497fb9b..d17ccc7b8b 100644
--- a/test/stage2/test.zig
+++ b/test/stage2/test.zig
@@ -1171,6 +1171,21 @@ pub fn addCases(ctx: *TestContext) !void {
\\fn entry() void {}
, &[_][]const u8{":2:4: error: redefinition of 'entry'"});
+ ctx.compileError("compileLog", linux_x64,
+ \\export fn _start() noreturn {
+ \\ const b = true;
+ \\ var f: u32 = 1;
+ \\ @compileLog(b, 20, f, x, .foo);
+ \\ var y: u32 = true;
+ \\ unreachable;
+ \\}
+ \\fn x() void {}
+ , &[_][]const u8{
+ ":4:3: error: found compile log statement", ":5:16: error: expected u32, found bool",
+ });
+
+ // "| true, 20, (runtime value), (function)" // TODO if this is here it invalidates the compile error checker. Need a way to check though.
+
{
var case = ctx.obj("variable shadowing", linux_x64);
case.addError(