Skip to content

Commit

Permalink
macho: fix x86_64 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kubkon committed Dec 25, 2024
1 parent 9b75977 commit c154fe7
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions test/macho.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3968,15 +3968,19 @@ fn testUnwindInfoNoSubsectionsX64(b: *Build, opts: Options) *Step {
);
a_o.addArg("-c");

const exe = cc(b, "a.out", opts);
exe.addCSource(
const main_o = cc(b, "main.o", opts);
main_o.addCSource(
\\#include <stdio.h>
\\int foo();
\\int main() {
\\ printf("%d\n", foo());
\\ return 0;
\\}
);
main_o.addArg("-c");

const exe = cc(b, "a.out", opts);
exe.addFileSource(main_o.getFile());
exe.addFileSource(a_o.getFile());

const run = exe.run();
Expand Down Expand Up @@ -4028,8 +4032,8 @@ fn testWeakBind(b: *Build, opts: Options) *Step {
test_step.dependOn(&check.step);
}

const exe = cc(b, "a.out", opts);
exe.addAsmSource(
const main_o = cc(b, "main.o", opts);
main_o.addAsmSource(
\\.globl _main, _weak_external, _weak_external_for_gotpcrel, _weak_external_fn
\\.weak_definition _weak_external, _weak_external_for_gotpcrel, _weak_external_fn, _weak_internal, _weak_internal_for_gotpcrel, _weak_internal_fn
\\
Expand Down Expand Up @@ -4086,6 +4090,10 @@ fn testWeakBind(b: *Build, opts: Options) *Step {
\\ .quad 0
\\ .quad _weak_internal_tlv$tlv$init
);
main_o.addArg("-c");

const exe = cc(b, "a.out", opts);
exe.addFileSource(main_o.getFile());
exe.addFileSource(lib.getFile());
exe.addPrefixedDirectorySource("-Wl,-rpath,", lib.getDir());

Expand Down

0 comments on commit c154fe7

Please sign in to comment.