diff --git a/test/link/macho.zig b/test/link/macho.zig index 7b87448d58..91f60246f2 100644 --- a/test/link/macho.zig +++ b/test/link/macho.zig @@ -26,6 +26,7 @@ pub fn testAll(b: *Build, build_opts: BuildOptions) *Step { macho_step.dependOn(testLayout(b, .{ .target = default_target })); macho_step.dependOn(testMhExecuteHeader(b, .{ .target = default_target })); macho_step.dependOn(testNoDeadStrip(b, .{ .target = default_target })); + macho_step.dependOn(testNoExportsDylib(b, .{ .target = default_target })); macho_step.dependOn(testRelocatable(b, .{ .target = default_target })); macho_step.dependOn(testRelocatableZig(b, .{ .target = default_target })); macho_step.dependOn(testSectionBoundarySymbols(b, .{ .target = default_target })); @@ -772,6 +773,19 @@ fn testNoDeadStrip(b: *Build, opts: Options) *Step { return test_step; } +fn testNoExportsDylib(b: *Build, opts: Options) *Step { + const test_step = addTestStep(b, "macho-no-exports-dylib", opts); + + const dylib = addSharedLibrary(b, opts, .{ .name = "a", .c_source_bytes = "static void abc() {}" }); + + const check = dylib.checkObject(); + check.checkInSymtab(); + check.checkNotPresent("external _abc"); + test_step.dependOn(&check.step); + + return test_step; +} + fn testNeededFramework(b: *Build, opts: Options) *Step { const test_step = addTestStep(b, "macho-needed-framework", opts);