authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-01-10 21:10:26+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-01-13 23:55:56+01:00
log4ffa8952ccaef106ef4dfcdb4369960816337ba3
tree202297748f17748a74a432df4ef8541cdf18a456
parent2ea0901dd639a98f182b71f7da7fde988fdcd91b

macho: add x86_64 tests


2 files changed, 20 insertions(+), 1 deletions(-)

test/stage2/aarch64.zig+2-1
......@@ -209,7 +209,8 @@ pub fn addCases(ctx: *TestContext) !void {
209209 \\extern "c" fn exit(usize) noreturn;
210210 \\
211211 \\export fn _start() noreturn {
212 \\ write(1, @ptrToInt("Hello, World!\n"), 14);
212 \\ write(1, @ptrToInt("Hello,"), 6);
213 \\ write(1, @ptrToInt(" World!\n,"), 8);
213214 \\ exit(0);
214215 \\}
215216 ,
test/stage2/test.zig+18
......@@ -1495,4 +1495,22 @@ pub fn addCases(ctx: *TestContext) !void {
14951495 \\}
14961496 , &[_][]const u8{":8:10: error: evaluation exceeded 1000 backwards branches"});
14971497 }
1498
1499 {
1500 var case = ctx.exe("hello world linked to libc", macosx_x64);
1501
1502 // TODO rewrite this test once we handle more int conversions and return args.
1503 case.addCompareOutput(
1504 \\extern "c" fn write(usize, usize, usize) void;
1505 \\extern "c" fn exit(usize) noreturn;
1506 \\
1507 \\export fn _start() noreturn {
1508 \\ write(1, @ptrToInt("Hello,"), 6);
1509 \\ write(1, @ptrToInt(" World!\n,"), 8);
1510 \\ exit(0);
1511 \\}
1512 ,
1513 "Hello, World!\n",
1514 );
1515 }
14981516}