[WebAssembly] Move test to cross-project-tests#200046
Conversation
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.
|
@llvm/pr-subscribers-llvm-binary-utilities Author: Aiden Grossman (boomanaiden154) Changeswasm-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:
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")
|
|
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. |
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
…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
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.