From 50d053f31c8fc391be613b27e4971ee85a418e5b Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 14 Jan 2025 20:31:39 -0800 Subject: [PATCH] test/wasm/infer-features: update to expected behavior I intentionally simplified the target features functionality to use the target features that are explicitly specified to the linker and ignore the "tooling conventions" this makes the wasm linker behave the same as ELF, COFF, and MachO. --- test/link/wasm/infer-features/build.zig | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/test/link/wasm/infer-features/build.zig b/test/link/wasm/infer-features/build.zig index 83aab77841..8e70fbc42c 100644 --- a/test/link/wasm/infer-features/build.zig +++ b/test/link/wasm/infer-features/build.zig @@ -37,27 +37,10 @@ pub fn build(b: *std.Build) void { lib.use_lld = false; lib.root_module.addObject(c_obj); - // Verify the result contains the features from the C Object file. - const check = lib.checkObject(); - check.checkInHeaders(); - check.checkExact("name target_features"); - check.checkExact("features 14"); - check.checkExact("+ atomics"); - check.checkExact("+ bulk-memory"); - check.checkExact("+ exception-handling"); - check.checkExact("+ extended-const"); - check.checkExact("+ half-precision"); - check.checkExact("+ multimemory"); - check.checkExact("+ multivalue"); - check.checkExact("+ mutable-globals"); - check.checkExact("+ nontrapping-fptoint"); - check.checkExact("+ reference-types"); - check.checkExact("+ relaxed-simd"); - check.checkExact("+ sign-ext"); - check.checkExact("+ simd128"); - check.checkExact("+ tail-call"); + lib.expect_errors = .{ .contains = "error: object requires atomics but specified target features exclude atomics" }; + _ = lib.getEmittedBin(); const test_step = b.step("test", "Run linker test"); - test_step.dependOn(&check.step); + test_step.dependOn(&lib.step); b.default_step = test_step; }