authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-01-03 23:20:09+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-01-03 23:20:09+01:00
log807dc56fd6c9af2603e3db9c1160b0a72fc703c0
treecb593106a578f418049901eeabd414ba10f3c9d7
parent2a410baa2b82528cf2bf8bcbfe0ce030ce972cec

stage2: add aarch64 stage2 tests

Fix missing string format specifier in Mach-O used to generate path to debug symbols bundle.

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

src/link/MachO.zig+1-1
......@@ -298,7 +298,7 @@ pub fn openPath(allocator: *Allocator, sub_path: []const u8, options: link.Optio
298298 self.base.file = file;
299299
300300 // Create dSYM bundle.
301 const d_sym_path = try fmt.allocPrint(allocator, "{}.dSYM/Contents/Resources/DWARF/", .{sub_path});
301 const d_sym_path = try fmt.allocPrint(allocator, "{s}.dSYM/Contents/Resources/DWARF/", .{sub_path});
302302 defer allocator.free(d_sym_path);
303303 var d_sym_bundle = try options.emit.?.directory.handle.makeOpenPath(d_sym_path, .{});
304304 defer d_sym_bundle.close();
test/stage2/aarch64.zig+44
......@@ -155,4 +155,48 @@ pub fn addCases(ctx: *TestContext) !void {
155155 "Hello, World!\n",
156156 );
157157 }
158
159 {
160 var case = ctx.exe("exit fn taking argument", macos_aarch64);
161
162 case.addCompareOutput(
163 \\export fn _start() noreturn {
164 \\ exit(0);
165 \\}
166 \\
167 \\fn exit(ret: usize) noreturn {
168 \\ asm volatile ("svc #0x80"
169 \\ :
170 \\ : [number] "{x16}" (1),
171 \\ [arg1] "{x0}" (ret)
172 \\ : "memory"
173 \\ );
174 \\ unreachable;
175 \\}
176 ,
177 "",
178 );
179 }
180
181 {
182 var case = ctx.exe("exit fn taking argument", linux_aarch64);
183
184 case.addCompareOutput(
185 \\export fn _start() noreturn {
186 \\ exit(0);
187 \\}
188 \\
189 \\fn exit(ret: usize) noreturn {
190 \\ asm volatile ("svc #0"
191 \\ :
192 \\ : [number] "{x8}" (93),
193 \\ [arg1] "{x0}" (ret)
194 \\ : "memory", "cc"
195 \\ );
196 \\ unreachable;
197 \\}
198 ,
199 "",
200 );
201 }
158202}