| ... | ... | @@ -6,6 +6,11 @@ const macos_aarch64 = std.zig.CrossTarget{ |
| 6 | 6 | .os_tag = .macos, |
| 7 | 7 | }; |
| 8 | 8 | |
| 9 | const linux_aarch64 = std.zig.CrossTarget{ |
| 10 | .cpu_arch = .aarch64, |
| 11 | .os_tag = .linux, |
| 12 | }; |
| 13 | |
| 9 | 14 | pub fn addCases(ctx: *TestContext) !void { |
| 10 | 15 | // TODO enable when we add codesigning to the self-hosted linker |
| 11 | 16 | // related to #6971 |
| ... | ... | @@ -112,4 +117,44 @@ pub fn addCases(ctx: *TestContext) !void { |
| 112 | 117 | \\ |
| 113 | 118 | ); |
| 114 | 119 | } |
| 120 | |
| 121 | { |
| 122 | var case = ctx.exe("hello world", linux_aarch64); |
| 123 | // Regular old hello world |
| 124 | case.addCompareOutput( |
| 125 | \\export fn _start() noreturn { |
| 126 | \\ print(); |
| 127 | \\ exit(); |
| 128 | \\} |
| 129 | \\ |
| 130 | \\fn doNothing() void {} |
| 131 | \\ |
| 132 | \\fn answer() u64 { |
| 133 | \\ return 0x1234abcd1234abcd; |
| 134 | \\} |
| 135 | \\ |
| 136 | \\fn print() void { |
| 137 | \\ asm volatile ("svc #0" |
| 138 | \\ : |
| 139 | \\ : [number] "{x8}" (64), |
| 140 | \\ [arg1] "{x0}" (1), |
| 141 | \\ [arg2] "{x1}" (@ptrToInt("Hello, World!\n")), |
| 142 | \\ [arg3] "{x2}" ("Hello, World!\n".len) |
| 143 | \\ : "memory", "cc" |
| 144 | \\ ); |
| 145 | \\} |
| 146 | \\ |
| 147 | \\fn exit() noreturn { |
| 148 | \\ asm volatile ("svc #0" |
| 149 | \\ : |
| 150 | \\ : [number] "{x8}" (93), |
| 151 | \\ [arg1] "{x0}" (0) |
| 152 | \\ : "memory", "cc" |
| 153 | \\ ); |
| 154 | \\ unreachable; |
| 155 | \\} |
| 156 | , |
| 157 | "Hello, World!\n", |
| 158 | ); |
| 159 | } |
| 115 | 160 | } |