stage2: add aarch64 stage2 tests

Fix missing string format specifier in Mach-O used to generate
path to debug symbols bundle.
This commit is contained in:
Jakub Konka
2021-01-03 23:20:09 +01:00
parent 2a410baa2b
commit 807dc56fd6
2 changed files with 45 additions and 1 deletions

View File

@@ -298,7 +298,7 @@ pub fn openPath(allocator: *Allocator, sub_path: []const u8, options: link.Optio
self.base.file = file;
// Create dSYM bundle.
const d_sym_path = try fmt.allocPrint(allocator, "{}.dSYM/Contents/Resources/DWARF/", .{sub_path});
const d_sym_path = try fmt.allocPrint(allocator, "{s}.dSYM/Contents/Resources/DWARF/", .{sub_path});
defer allocator.free(d_sym_path);
var d_sym_bundle = try options.emit.?.directory.handle.makeOpenPath(d_sym_path, .{});
defer d_sym_bundle.close();

View File

@@ -155,4 +155,48 @@ pub fn addCases(ctx: *TestContext) !void {
"Hello, World!\n",
);
}
{
var case = ctx.exe("exit fn taking argument", macos_aarch64);
case.addCompareOutput(
\\export fn _start() noreturn {
\\ exit(0);
\\}
\\
\\fn exit(ret: usize) noreturn {
\\ asm volatile ("svc #0x80"
\\ :
\\ : [number] "{x16}" (1),
\\ [arg1] "{x0}" (ret)
\\ : "memory"
\\ );
\\ unreachable;
\\}
,
"",
);
}
{
var case = ctx.exe("exit fn taking argument", linux_aarch64);
case.addCompareOutput(
\\export fn _start() noreturn {
\\ exit(0);
\\}
\\
\\fn exit(ret: usize) noreturn {
\\ asm volatile ("svc #0"
\\ :
\\ : [number] "{x8}" (93),
\\ [arg1] "{x0}" (ret)
\\ : "memory", "cc"
\\ );
\\ unreachable;
\\}
,
"",
);
}
}