Commit 50d053f31c

Andrew Kelley <andrew@ziglang.org>
2025-01-15 05:31:39
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.
1 parent 9ddb1c5
Changed files (1)
test
link
wasm
infer-features
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;
 }