mirror of
https://github.com/ziglang/zig.git
synced 2025-12-17 03:33:06 +00:00
* Sema: implement linksection on functions * Implement function linksection in Sema. * Don't clobber function linksection/align/addrspace in Sema. * Fix copy-paste typo in tests. * Add a bunch of missing test_step.dependOn. * Fix checkInSymtab match. Closes #12546
29 lines
796 B
Zig
29 lines
796 B
Zig
const std = @import("std");
|
|
|
|
pub fn build(b: *std.build.Builder) void {
|
|
const mode = b.standardReleaseOptions();
|
|
const target = std.zig.CrossTarget{ .os_tag = .macos };
|
|
|
|
const test_step = b.step("test", "Test");
|
|
test_step.dependOn(b.getInstallStep());
|
|
|
|
const obj = b.addObject("test", "main.zig");
|
|
obj.setBuildMode(mode);
|
|
obj.setTarget(target);
|
|
|
|
const check = obj.checkObject(.macho);
|
|
|
|
check.checkInSymtab();
|
|
check.checkNext("{*} (__DATA,__TestGlobal) external _test_global");
|
|
|
|
check.checkInSymtab();
|
|
check.checkNext("{*} (__TEXT,__TestFn) external _testFn");
|
|
|
|
if (mode == .Debug) {
|
|
check.checkInSymtab();
|
|
check.checkNext("{*} (__TEXT,__TestGenFnA) _main.testGenericFn__anon_{*}");
|
|
}
|
|
|
|
test_step.dependOn(&check.step);
|
|
}
|