aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNoam Preil <pleasantatk@gmail.com>2020-06-26 04:03:54 -0400
committerNoam Preil <pleasantatk@gmail.com>2020-06-26 04:05:41 -0400
commit6510888039baaa0058a7e2bade2750569af1abbd (patch)
tree1c2254e5d22d4e2d72b2f21c78094589689d0baf /test
parent4a17e008daa90d5dbb0fc917d53e52c1ec990f2d (diff)
downloadzig-6510888039baaa0058a7e2bade2750569af1abbd.tar.gz
zig-6510888039baaa0058a7e2bade2750569af1abbd.zip
Stage2: function redefinition detection for Zig code
Diffstat (limited to 'test')
-rw-r--r--test/stage2/compile_errors.zig24
1 files changed, 19 insertions, 5 deletions
diff --git a/test/stage2/compile_errors.zig b/test/stage2/compile_errors.zig
index 79b67da2c2..f7766abcef 100644
--- a/test/stage2/compile_errors.zig
+++ b/test/stage2/compile_errors.zig
@@ -67,14 +67,28 @@ pub fn addCases(ctx: *TestContext) !void {
\\@1 = export(@0, "start")
);
}
+ // TODO: need to make sure this works with other variants of export.
+ // As is, the same error occurs without export.
+ {
+ var case = ctx.obj("exported symbol collision", linux_x64);
+ case.addError(
+ \\export fn entry() void {}
+ \\export fn entry() void {}
+ , &[_][]const u8{":2:11: error: redefinition of 'entry'"});
+ case.compiles(
+ \\export fn entry() void {}
+ );
+ case.addError(
+ \\fn entry() void {}
+ \\fn entry() void {}
+ , &[_][]const u8{":2:4: error: redefinition of 'entry'"});
+ case.compiles(
+ \\export fn entry() void {}
+ );
+ }
// TODO: re-enable these tests.
// https://github.com/ziglang/zig/issues/1364
- // ctx.compileError("Export same symbol twice", linux_x64,
- // \\export fn entry() void {}
- // \\export fn entry() void {}
- // , &[_][]const u8{":2:1: error: exported symbol collision"});
-
// ctx.addError("Missing function name", linux_x64, .Zig,
// \\fn() void {}
// , &[_][]const u8{":1:3: error: missing function name"});