Skip to content

Commit

Permalink
macho: implement missing check steps
Browse files Browse the repository at this point in the history
  • Loading branch information
kubkon committed Dec 12, 2023
1 parent 6ec784f commit f82b3e7
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions test/macho.zig
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,13 @@ fn testFlatNamespace(b: *Build, opts: Options) *Step {
liba.addArgs(&.{ "-shared", "-Wl,-install_name,@rpath/liba.dylib", "-Wl,-flat_namespace" });
const liba_out = liba.saveOutputAs("liba.dylib");

// TODO add dyld_info opcodes check after improving CheckObject
{
const check = liba.check();
check.checkInDyldInfo();
check.checkExact("lazy bind info");
check.checkContains("(flat lookup) _getFoo");
test_step.dependOn(&check.step);
}

const libb = cc(b, opts);
libb.addCSource(
Expand All @@ -835,7 +841,13 @@ fn testFlatNamespace(b: *Build, opts: Options) *Step {
libb.addArgs(&.{ "-shared", "-Wl,-install_name,@rpath/libb.dylib", "-Wl,-flat_namespace" });
const libb_out = libb.saveOutputAs("libb.dylib");

// TODO add dyld_info opcodes check after improving CheckObject
{
const check = liba.check();
check.checkInDyldInfo();
check.checkExact("lazy bind info");
check.checkContains("(flat lookup) _getFoo");
test_step.dependOn(&check.step);
}

const main_o = cc(b, opts);
main_o.addCSource(
Expand Down Expand Up @@ -2637,11 +2649,10 @@ fn testWeakRef(b: *Build, opts: Options) *Step {
);
exe.addArgs(&.{ "-Wl,-flat_namespace", "-Wl,-undefined,suppress" });

// TODO fix in upstream CheckObject
// const check = exe.check();
// check.checkInSymtab();
// check.checkExact("(undefined) weakref external _foo (from flat lookup)");
// test_step.dependOn(&check.step);
const check = exe.check();
check.checkInSymtab();
check.checkExact("(undefined) weakref external _foo (from flat lookup)");
test_step.dependOn(&check.step);

const run = exe.run();
run.expectStdOutEqual("-1");
Expand Down

0 comments on commit f82b3e7

Please sign in to comment.