authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-01-15 10:35:42+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-01-24 12:34:40+01:00
log7c65f0be375c7e4f0d2ecdc846ae5e9b49cf2737
tree8529b8f91be990d902d2e14e2176a4b67c5c0ad5
parent4cf94bb14869641316f337903ab24eef52eb7899

test/link/macho: test no exports in a dylib


1 files changed, 14 insertions(+), 0 deletions(-)

test/link/macho.zig+14
......@@ -26,6 +26,7 @@ pub fn testAll(b: *Build, build_opts: BuildOptions) *Step {
2626 macho_step.dependOn(testLayout(b, .{ .target = default_target }));
2727 macho_step.dependOn(testMhExecuteHeader(b, .{ .target = default_target }));
2828 macho_step.dependOn(testNoDeadStrip(b, .{ .target = default_target }));
29 macho_step.dependOn(testNoExportsDylib(b, .{ .target = default_target }));
2930 macho_step.dependOn(testRelocatable(b, .{ .target = default_target }));
3031 macho_step.dependOn(testRelocatableZig(b, .{ .target = default_target }));
3132 macho_step.dependOn(testSectionBoundarySymbols(b, .{ .target = default_target }));
......@@ -772,6 +773,19 @@ fn testNoDeadStrip(b: *Build, opts: Options) *Step {
772773 return test_step;
773774}
774775
776fn testNoExportsDylib(b: *Build, opts: Options) *Step {
777 const test_step = addTestStep(b, "macho-no-exports-dylib", opts);
778
779 const dylib = addSharedLibrary(b, opts, .{ .name = "a", .c_source_bytes = "static void abc() {}" });
780
781 const check = dylib.checkObject();
782 check.checkInSymtab();
783 check.checkNotPresent("external _abc");
784 test_step.dependOn(&check.step);
785
786 return test_step;
787}
788
775789fn testNeededFramework(b: *Build, opts: Options) *Step {
776790 const test_step = addTestStep(b, "macho-needed-framework", opts);
777791