diff options
| -rw-r--r-- | test/stage2/aarch64.zig | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/stage2/aarch64.zig b/test/stage2/aarch64.zig index 48cf7700c1..323d63b9fe 100644 --- a/test/stage2/aarch64.zig +++ b/test/stage2/aarch64.zig @@ -6,6 +6,11 @@ const macos_aarch64 = std.zig.CrossTarget{ .os_tag = .macos, }; +const linux_aarch64 = std.zig.CrossTarget{ + .cpu_arch = .aarch64, + .os_tag = .linux, +}; + pub fn addCases(ctx: *TestContext) !void { // TODO enable when we add codesigning to the self-hosted linker // related to #6971 @@ -112,4 +117,44 @@ pub fn addCases(ctx: *TestContext) !void { \\ ); } + + { + var case = ctx.exe("hello world", linux_aarch64); + // Regular old hello world + case.addCompareOutput( + \\export fn _start() noreturn { + \\ print(); + \\ exit(); + \\} + \\ + \\fn doNothing() void {} + \\ + \\fn answer() u64 { + \\ return 0x1234abcd1234abcd; + \\} + \\ + \\fn print() void { + \\ asm volatile ("svc #0" + \\ : + \\ : [number] "{x8}" (64), + \\ [arg1] "{x0}" (1), + \\ [arg2] "{x1}" (@ptrToInt("Hello, World!\n")), + \\ [arg3] "{x2}" ("Hello, World!\n".len) + \\ : "memory", "cc" + \\ ); + \\} + \\ + \\fn exit() noreturn { + \\ asm volatile ("svc #0" + \\ : + \\ : [number] "{x8}" (93), + \\ [arg1] "{x0}" (0) + \\ : "memory", "cc" + \\ ); + \\ unreachable; + \\} + , + "Hello, World!\n", + ); + } } |
