mirror of
https://github.com/ziglang/zig.git
synced 2026-03-11 21:59:52 +00:00
Certain symbols were left unmarked, meaning they would not be emit into the final binary incorrectly. We now mark the synthetic symbols to ensure they are emit as they are already created under the circumstance they're needed for. This also re-enables disabled tests that were left disabled in a previous merge conflict. Lastly, this adds the shared-memory test to the test harnass as it was previously forgotten and therefore regressed.
37 lines
1.1 KiB
Zig
37 lines
1.1 KiB
Zig
const std = @import("std");
|
|
|
|
pub const requires_stage2 = true;
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const test_step = b.step("test", "Test it");
|
|
b.default_step = test_step;
|
|
|
|
add(b, test_step, .Debug);
|
|
add(b, test_step, .ReleaseFast);
|
|
add(b, test_step, .ReleaseSmall);
|
|
add(b, test_step, .ReleaseSafe);
|
|
}
|
|
|
|
fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.OptimizeMode) void {
|
|
// The code in question will pull-in compiler-rt,
|
|
// and therefore link with its archive file.
|
|
const lib = b.addExecutable(.{
|
|
.name = "main",
|
|
.root_source_file = .{ .path = "main.zig" },
|
|
.optimize = optimize,
|
|
.target = b.resolveTargetQuery(.{ .cpu_arch = .wasm32, .os_tag = .freestanding }),
|
|
.strip = false,
|
|
});
|
|
lib.entry = .disabled;
|
|
lib.use_llvm = false;
|
|
lib.use_lld = false;
|
|
lib.root_module.export_symbol_names = &.{"foo"};
|
|
|
|
const check = lib.checkObject();
|
|
check.checkInHeaders();
|
|
check.checkExact("Section custom");
|
|
check.checkExact("name __trunch"); // Ensure it was imported and resolved
|
|
|
|
test_step.dependOn(&check.step);
|
|
}
|