authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-03-10 14:46:35-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-03-15 10:48:14-07:00
log1a3c1fe820ad9eeaa7b30a1fc6e1b8b8e2b871b6
treea878459c542a83dd9d5f4acf8de95847969fcfc1
parent2956232b427276c6ad1e52678e1cf3651976ec39

test-link: add names to headerpad test


1 files changed, 10 insertions(+), 6 deletions(-)

test/link/macho/headerpad/build.zig+10-6
......@@ -17,7 +17,7 @@ pub fn build(b: *std.Build) void {
1717fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.OptimizeMode) void {
1818 {
1919 // Test -headerpad_max_install_names
20 const exe = simpleExe(b, optimize);
20 const exe = simpleExe(b, optimize, "headerpad_max_install_names");
2121 exe.headerpad_max_install_names = true;
2222
2323 const check = exe.checkObject();
......@@ -42,7 +42,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
4242
4343 {
4444 // Test -headerpad
45 const exe = simpleExe(b, optimize);
45 const exe = simpleExe(b, optimize, "headerpad");
4646 exe.headerpad_size = 0x10000;
4747
4848 const check = exe.checkObject();
......@@ -58,7 +58,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
5858
5959 {
6060 // Test both flags with -headerpad overriding -headerpad_max_install_names
61 const exe = simpleExe(b, optimize);
61 const exe = simpleExe(b, optimize, "headerpad_overriding");
6262 exe.headerpad_max_install_names = true;
6363 exe.headerpad_size = 0x10000;
6464
......@@ -75,7 +75,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
7575
7676 {
7777 // Test both flags with -headerpad_max_install_names overriding -headerpad
78 const exe = simpleExe(b, optimize);
78 const exe = simpleExe(b, optimize, "headerpad_max_install_names_overriding");
7979 exe.headerpad_size = 0x1000;
8080 exe.headerpad_max_install_names = true;
8181
......@@ -100,9 +100,13 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
100100 }
101101}
102102
103fn simpleExe(b: *std.Build, optimize: std.builtin.OptimizeMode) *std.Build.CompileStep {
103fn simpleExe(
104 b: *std.Build,
105 optimize: std.builtin.OptimizeMode,
106 name: []const u8,
107) *std.Build.CompileStep {
104108 const exe = b.addExecutable(.{
105 .name = "main",
109 .name = name,
106110 .optimize = optimize,
107111 });
108112 exe.addCSourceFile("main.c", &.{});