| ... | ... | @@ -1495,4 +1495,22 @@ pub fn addCases(ctx: *TestContext) !void { |
| 1495 | 1495 | \\} |
| 1496 | 1496 | , &[_][]const u8{":8:10: error: evaluation exceeded 1000 backwards branches"}); |
| 1497 | 1497 | } |
| 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 | } |
| 1498 | 1516 | } |