zig/test/link/wasm/extern/build.zig
Luuk de Gram 8627858bbc
test/link: add test for extern resolution
Adds a linker tests to verify extern/undefined symbols
representing non-functions are being resolved correctly.
2022-08-30 18:32:08 +02:00

18 lines
526 B
Zig

const std = @import("std");
pub fn build(b: *std.build.Builder) void {
const mode = b.standardReleaseOptions();
const exe = b.addExecutable("extern", "main.zig");
exe.setTarget(.{ .cpu_arch = .wasm32, .os_tag = .wasi });
exe.setBuildMode(mode);
exe.addCSourceFile("foo.c", &.{});
exe.use_llvm = false;
exe.use_lld = false;
const run = exe.runEmulatable();
run.expectStdOutEqual("Result: 30");
const test_step = b.step("test", "Run linker test");
test_step.dependOn(&run.step);
}