authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-06-25 00:36:42+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-06-25 17:59:09+02:00
loga6fbdfabb9b60262594da012b8d877a43d8d8e99
tree5ba41dac34c70b6772172928c5b9aba1e0e202d0
parent8c1feef4cd3af223ed8278bd55e8191936b526f0

link-tests: add -headerpad_size test scenario


2 files changed, 28 insertions(+), 0 deletions(-)

test/link/macho/headerpad_size/build.zig created+25
......@@ -0,0 +1,25 @@
1const std = @import("std");
2const Builder = std.build.Builder;
3
4pub fn build(b: *Builder) void {
5 const mode = b.standardReleaseOptions();
6
7 const test_step = b.step("test", "Test");
8 test_step.dependOn(b.getInstallStep());
9
10 const exe = b.addExecutable("main", null);
11 exe.setBuildMode(mode);
12 exe.addCSourceFile("main.c", &.{});
13 exe.linkLibC();
14 exe.headerpad_size = 0x10000;
15
16 const check = exe.checkObject(.macho);
17 check.checkStart("sectname __text");
18 check.checkNext("offset {offset}");
19 check.checkComputeCompare("offset", .{ .op = .gte, .value = .{ .literal = 0x10000 } });
20
21 test_step.dependOn(&check.step);
22
23 const run = exe.run();
24 test_step.dependOn(&run.step);
25}
test/link/macho/headerpad_size/main.c created+3
......@@ -0,0 +1,3 @@
1int main(int argc, char* argv[]) {
2 return 0;
3}