Skip to content

[WebAssembly] Move test to cross-project-tests#200046

Closed
boomanaiden154 wants to merge 1 commit into
llvm:mainfrom
boomanaiden154:webassembly-cross-project-tests
Closed

[WebAssembly] Move test to cross-project-tests#200046
boomanaiden154 wants to merge 1 commit into
llvm:mainfrom
boomanaiden154:webassembly-cross-project-tests

Conversation

@boomanaiden154
Copy link
Copy Markdown
Contributor

wasm-basic.s was the only test under llvm/test (presumably) that depended on lld. That is a layering violation and causes issues (for example, after #199801 I was still seeing test failures due to lld not being automatically rebuilt). cross-project-tests is the right home for these sorts of tests and while there is some setup it is minimal, and these tests run in premerge, so there should be no major lack of coverage.

Assisted-by: Gemini in antigravity.

wasm-basic.s was the only test under llvm/test (presumably) that depended on
lld. That is a layering violation and causes issues (for example, after llvm#199801
I was still seeing test failures due to lld not being automatically rebuilt).
cross-project-tests is the right home for these sorts of tests and while there
is some setup it is minimal, and these tests run in premerge, so there should
be no major lack of coverage.
@llvmorg-github-actions
Copy link
Copy Markdown

@llvm/pr-subscribers-llvm-binary-utilities

Author: Aiden Grossman (boomanaiden154)

Changes

wasm-basic.s was the only test under llvm/test (presumably) that depended on lld. That is a layering violation and causes issues (for example, after #199801 I was still seeing test failures due to lld not being automatically rebuilt). cross-project-tests is the right home for these sorts of tests and while there is some setup it is minimal, and these tests run in premerge, so there should be no major lack of coverage.

Assisted-by: Gemini in antigravity.


Full diff: https://github.com/llvm/llvm-project/pull/200046.diff

5 Files Affected:

  • (modified) cross-project-tests/CMakeLists.txt (+2)
  • (modified) cross-project-tests/lit.cfg.py (+2-1)
  • (added) cross-project-tests/webassembly/lit.local.cfg (+8)
  • (renamed) cross-project-tests/webassembly/wasm-basic.s ()
  • (removed) llvm/test/tools/llvm-symbolizer/lit.local.cfg (-4)
diff --git a/cross-project-tests/CMakeLists.txt b/cross-project-tests/CMakeLists.txt
index 866dc98406af4..57bfb6a3ee571 100644
--- a/cross-project-tests/CMakeLists.txt
+++ b/cross-project-tests/CMakeLists.txt
@@ -26,8 +26,10 @@ set(CROSS_PROJECT_TEST_DEPS
   llvm-config
   llvm-dis
   llvm-dwarfdump
+  llvm-mc
   llvm-modextract
   llvm-objdump
+  llvm-symbolizer
   not
   obj2yaml
   split-file
diff --git a/cross-project-tests/lit.cfg.py b/cross-project-tests/lit.cfg.py
index df45221d90ef3..49511f015b023 100644
--- a/cross-project-tests/lit.cfg.py
+++ b/cross-project-tests/lit.cfg.py
@@ -96,7 +96,8 @@ def get_required_attr(config, attr_name):
 
 if not hasattr(config, "lld_src_dir"):
     config.lld_src_dir = ""
-llvm_config.use_lld(required=("lld" in config.llvm_enabled_projects))
+if llvm_config.use_lld(required=("lld" in config.llvm_enabled_projects)):
+    config.available_features.add("lld")
 
 if "compiler-rt" in config.llvm_enabled_projects:
     config.available_features.add("compiler-rt")
diff --git a/cross-project-tests/webassembly/lit.local.cfg b/cross-project-tests/webassembly/lit.local.cfg
new file mode 100644
index 0000000000000..a7797c41723be
--- /dev/null
+++ b/cross-project-tests/webassembly/lit.local.cfg
@@ -0,0 +1,8 @@
+import os
+from lit.llvm import llvm_config
+
+if "WebAssembly" not in config.targets_to_build or "lld" not in config.available_features:
+    config.unsupported = True
+
+config.suffixes.add(".s")
+
diff --git a/llvm/test/tools/llvm-symbolizer/wasm-basic.s b/cross-project-tests/webassembly/wasm-basic.s
similarity index 100%
rename from llvm/test/tools/llvm-symbolizer/wasm-basic.s
rename to cross-project-tests/webassembly/wasm-basic.s
diff --git a/llvm/test/tools/llvm-symbolizer/lit.local.cfg b/llvm/test/tools/llvm-symbolizer/lit.local.cfg
deleted file mode 100644
index 21771693b720e..0000000000000
--- a/llvm/test/tools/llvm-symbolizer/lit.local.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-from lit.llvm import llvm_config
-
-if llvm_config.use_lld(required=False):
-    config.available_features.add("lld")

@dschuff
Copy link
Copy Markdown
Member

dschuff commented May 27, 2026

I think for this test it makes more sense to just check in a prebuilt binary or YAML file, since wasm-ld isn't really what's under test here. Let me spin up a PR.

dschuff added a commit to dschuff/llvm-project that referenced this pull request May 27, 2026
Avoid using wasm-ld in LLVM tests by prebuilding the test binary
as a YAML file and using yaml2obj at test time.

This matches the approach taken in 4bce216.
Because yaml2obj always uses 5-byte LEBs, the CODE section offset
shifted from 0x37 to 0x4b, so the file offsets passed to llvm-symbolizer
were updated accordingly.

Replaces llvm#200046

Assisted-by: Gemini
dschuff added a commit that referenced this pull request May 28, 2026
…0080)

Avoid using wasm-ld in LLVM tests by prebuilding the test binary
as a YAML file and using yaml2obj at test time.

This matches the approach taken in
4bce216.
Because yaml2obj always uses 5-byte LEBs, the CODE section offset
shifted from 0x37 to 0x4b, so the file offsets passed to llvm-symbolizer
were updated accordingly.

Replaces #200046

Assisted-by: Gemini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants