diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-07-24 21:28:54 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-07-24 21:28:54 -0400 |
| commit | 02713e8d8aa9641616bd85e77dda784009c96113 (patch) | |
| tree | 675d61a60cbe732d2c61290b33db560552b16e05 /test/stage2 | |
| parent | adefd1a52b812813dd3e3590d398f927ffc5b9af (diff) | |
| download | zig-02713e8d8aa9641616bd85e77dda784009c96113.tar.gz zig-02713e8d8aa9641616bd85e77dda784009c96113.zip | |
fix race conditions in self-hosted compiler; add test
* fix race condition in std.event.Channel deinit
* add support to zig build for --no-rosegment
* add passing self-hosted compare-output test for calling a function
* put a global lock on LLD linking because it's not thread safe
Diffstat (limited to 'test/stage2')
| -rw-r--r-- | test/stage2/compare_output.zig | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/stage2/compare_output.zig b/test/stage2/compare_output.zig index 35adcbb96b..fdc3d49145 100644 --- a/test/stage2/compare_output.zig +++ b/test/stage2/compare_output.zig @@ -2,6 +2,7 @@ const std = @import("std"); const TestContext = @import("../../src-self-hosted/test.zig").TestContext; pub fn addCases(ctx: *TestContext) !void { + // hello world try ctx.testCompareOutputLibC( \\extern fn puts([*]const u8) void; \\export fn main() c_int { @@ -9,4 +10,16 @@ pub fn addCases(ctx: *TestContext) !void { \\ return 0; \\} , "Hello, world!" ++ std.cstr.line_sep); + + // function calling another function + try ctx.testCompareOutputLibC( + \\extern fn puts(s: [*]const u8) void; + \\export fn main() c_int { + \\ return foo(c"OK"); + \\} + \\fn foo(s: [*]const u8) c_int { + \\ puts(s); + \\ return 0; + \\} + , "OK" ++ std.cstr.line_sep); } |
