| ... | ... | @@ -25,6 +25,7 @@ pub fn testAll(b: *Build, build_opts: BuildOptions) *Step { |
| 25 | 25 | macho_step.dependOn(testLargeBss(b, .{ .target = default_target })); |
| 26 | 26 | macho_step.dependOn(testLayout(b, .{ .target = default_target })); |
| 27 | 27 | macho_step.dependOn(testMhExecuteHeader(b, .{ .target = default_target })); |
| 28 | macho_step.dependOn(testNoDeadStrip(b, .{ .target = default_target })); |
| 28 | 29 | macho_step.dependOn(testRelocatable(b, .{ .target = default_target })); |
| 29 | 30 | macho_step.dependOn(testRelocatableZig(b, .{ .target = default_target })); |
| 30 | 31 | macho_step.dependOn(testSectionBoundarySymbols(b, .{ .target = default_target })); |
| ... | ... | @@ -745,6 +746,32 @@ fn testMhExecuteHeader(b: *Build, opts: Options) *Step { |
| 745 | 746 | return test_step; |
| 746 | 747 | } |
| 747 | 748 | |
| 749 | fn testNoDeadStrip(b: *Build, opts: Options) *Step { |
| 750 | const test_step = addTestStep(b, "macho-no-dead-strip", opts); |
| 751 | |
| 752 | const exe = addExecutable(b, opts, .{ .name = "name", .c_source_bytes = |
| 753 | \\__attribute__((used)) int bogus1 = 0; |
| 754 | \\int bogus2 = 0; |
| 755 | \\int foo = 42; |
| 756 | \\int main() { |
| 757 | \\ return foo - 42; |
| 758 | \\} |
| 759 | }); |
| 760 | exe.link_gc_sections = true; |
| 761 | |
| 762 | const check = exe.checkObject(); |
| 763 | check.checkInSymtab(); |
| 764 | check.checkContains("external _bogus1"); |
| 765 | check.checkInSymtab(); |
| 766 | check.checkNotPresent("external _bogus2"); |
| 767 | test_step.dependOn(&check.step); |
| 768 | |
| 769 | const run = addRunArtifact(exe); |
| 770 | test_step.dependOn(&run.step); |
| 771 | |
| 772 | return test_step; |
| 773 | } |
| 774 | |
| 748 | 775 | fn testNeededFramework(b: *Build, opts: Options) *Step { |
| 749 | 776 | const test_step = addTestStep(b, "macho-needed-framework", opts); |
| 750 | 777 | |