diff --git a/test/link.zig b/test/link.zig index ac0bcf3df8..c877e6c357 100644 --- a/test/link.zig +++ b/test/link.zig @@ -92,6 +92,10 @@ pub const cases = [_]Case{ .build_root = "test/link/macho/bugs/13457", .import = @import("link/macho/bugs/13457/build.zig"), }, + .{ + .build_root = "test/link/macho/bugs/16308", + .import = @import("link/macho/bugs/16308/build.zig"), + }, .{ .build_root = "test/link/macho/dead_strip", .import = @import("link/macho/dead_strip/build.zig"), diff --git a/test/link/macho/bugs/16308/build.zig b/test/link/macho/bugs/16308/build.zig new file mode 100644 index 0000000000..a6329074a0 --- /dev/null +++ b/test/link/macho/bugs/16308/build.zig @@ -0,0 +1,23 @@ +const std = @import("std"); + +pub const requires_symlinks = true; + +pub fn build(b: *std.Build) void { + const test_step = b.step("test", "Test it"); + b.default_step = test_step; + + const target: std.zig.CrossTarget = .{ .os_tag = .macos }; + + const lib = b.addSharedLibrary(.{ + .name = "a", + .root_source_file = .{ .path = "main.zig" }, + .optimize = .Debug, + .target = target, + }); + + const check = lib.checkObject(); + check.checkInSymtab(); + check.checkNotPresent("external"); + + test_step.dependOn(&check.step); +} diff --git a/test/link/macho/bugs/16308/main.zig b/test/link/macho/bugs/16308/main.zig new file mode 100644 index 0000000000..fd94789461 --- /dev/null +++ b/test/link/macho/bugs/16308/main.zig @@ -0,0 +1 @@ +fn abc() void {}