CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
188 lines
5.5 KiB
Python
188 lines
5.5 KiB
Python
# -*- Python -*-
|
|
|
|
import os
|
|
import platform
|
|
import re
|
|
import subprocess
|
|
import locale
|
|
|
|
import lit.formats
|
|
import lit.util
|
|
|
|
from lit.llvm import llvm_config
|
|
|
|
# Configuration file for the 'lit' test runner.
|
|
|
|
# name: The name of this test suite.
|
|
config.name = "lld"
|
|
|
|
# TODO: Consolidate the logic for turning on the internal shell by default for all LLVM test suites.
|
|
# See https://github.com/llvm/llvm-project/issues/106636 for more details.
|
|
#
|
|
# We prefer the lit internal shell which provides a better user experience on failures
|
|
# and is faster unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0
|
|
# env var.
|
|
use_lit_shell = True
|
|
lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
|
|
if lit_shell_env:
|
|
use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
|
|
|
|
# testFormat: The test format to use to interpret tests.
|
|
#
|
|
# For now we require '&&' between commands, until they get globally killed and the test runner updated.
|
|
config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
|
|
|
|
# suffixes: A list of file extensions to treat as test files.
|
|
config.suffixes = [".ll", ".s", ".test", ".yaml", ".objtxt"]
|
|
|
|
# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
|
|
# subdirectories contain auxiliary inputs for various tests in their parent
|
|
# directories.
|
|
config.excludes = ["Inputs"]
|
|
|
|
# test_source_root: The root path where tests are located.
|
|
config.test_source_root = os.path.dirname(__file__)
|
|
|
|
config.test_exec_root = os.path.join(config.lld_obj_root, "test")
|
|
|
|
llvm_config.use_default_substitutions()
|
|
llvm_config.use_lld()
|
|
config.substitutions.append(("%llvm_src_root", config.llvm_src_root))
|
|
|
|
tool_patterns = [
|
|
"llc",
|
|
"llvm-as",
|
|
"llvm-cgdata",
|
|
"llvm-mc",
|
|
"llvm-nm",
|
|
"llvm-objdump",
|
|
"llvm-otool",
|
|
"llvm-pdbutil",
|
|
"llvm-profdata",
|
|
"llvm-dwarfdump",
|
|
"llvm-readelf",
|
|
"llvm-readobj",
|
|
"obj2yaml",
|
|
"yaml2obj",
|
|
"opt",
|
|
"llvm-dis",
|
|
]
|
|
|
|
llvm_config.add_tool_substitutions(tool_patterns)
|
|
|
|
# LLD tests tend to be flaky on NetBSD, so add some retries.
|
|
# We don't do this on other platforms because it's slower.
|
|
if platform.system() in ["NetBSD"]:
|
|
config.test_retry_attempts = 2
|
|
|
|
# When running under valgrind, we mangle '-vg' onto the end of the triple so we
|
|
# can check it with XFAIL and XTARGET.
|
|
if lit_config.useValgrind:
|
|
config.target_triple += "-vg"
|
|
|
|
llvm_config.feature_config(
|
|
[
|
|
(
|
|
"--targets-built",
|
|
{
|
|
"AArch64": "aarch64",
|
|
"AMDGPU": "amdgpu",
|
|
"ARM": "arm",
|
|
"AVR": "avr",
|
|
"Hexagon": "hexagon",
|
|
"LoongArch": "loongarch",
|
|
"Mips": "mips",
|
|
"MSP430": "msp430",
|
|
"PowerPC": "ppc",
|
|
"RISCV": "riscv",
|
|
"Sparc": "sparc",
|
|
"SystemZ": "systemz",
|
|
"WebAssembly": "wasm",
|
|
"X86": "x86",
|
|
},
|
|
),
|
|
("--assertion-mode", {"ON": "asserts"}),
|
|
]
|
|
)
|
|
|
|
# Set a fake constant version so that we get consistent output.
|
|
config.environment["LLD_VERSION"] = "LLD 1.0"
|
|
|
|
# LLD_IN_TEST determines how many times `main` is run inside each process, which
|
|
# lets us test that it's cleaning up after itself and resetting global state
|
|
# correctly (which is important for usage as a library).
|
|
run_lld_main_twice = lit_config.params.get("RUN_LLD_MAIN_TWICE", False)
|
|
if not run_lld_main_twice:
|
|
config.environment["LLD_IN_TEST"] = "1"
|
|
else:
|
|
config.environment["LLD_IN_TEST"] = "2"
|
|
# Many wasm tests fail.
|
|
config.excludes.append("wasm")
|
|
# Some new Mach-O backend tests fail; give them a way to mark themselves
|
|
# unsupported in this mode.
|
|
config.available_features.add("main-run-twice")
|
|
|
|
# Indirectly check if the mt.exe Microsoft utility exists by searching for
|
|
# cvtres, which always accompanies it. Alternatively, check if we can use
|
|
# libxml2 to merge manifests.
|
|
if lit.util.which("cvtres", config.environment["PATH"]) or config.have_libxml2:
|
|
config.available_features.add("manifest_tool")
|
|
|
|
if config.enable_backtrace:
|
|
config.available_features.add("backtrace")
|
|
|
|
if config.have_libxml2:
|
|
config.available_features.add("libxml2")
|
|
|
|
if config.have_dia_sdk:
|
|
config.available_features.add("diasdk")
|
|
|
|
if config.sizeof_void_p == 8:
|
|
config.available_features.add("llvm-64-bits")
|
|
|
|
if config.has_plugins:
|
|
config.available_features.add("plugins")
|
|
|
|
if config.build_examples:
|
|
config.available_features.add("examples")
|
|
|
|
if config.linked_bye_extension:
|
|
config.substitutions.append(("%loadbye", ""))
|
|
config.substitutions.append(("%loadnewpmbye", ""))
|
|
else:
|
|
config.substitutions.append(
|
|
(
|
|
"%loadbye",
|
|
"-load={}/Bye{}".format(config.llvm_shlib_dir, config.llvm_shlib_ext),
|
|
)
|
|
)
|
|
config.substitutions.append(
|
|
(
|
|
"%loadnewpmbye",
|
|
"-load-pass-plugin={}/Bye{}".format(
|
|
config.llvm_shlib_dir, config.llvm_shlib_ext
|
|
),
|
|
)
|
|
)
|
|
|
|
tar_executable = lit.util.which("tar", config.environment["PATH"])
|
|
if tar_executable:
|
|
env = os.environ
|
|
env["LANG"] = "C"
|
|
tar_version = subprocess.Popen(
|
|
[tar_executable, "--version"],
|
|
stdout=subprocess.PIPE,
|
|
stderr=subprocess.PIPE,
|
|
env=env,
|
|
)
|
|
sout, _ = tar_version.communicate()
|
|
if "GNU tar" in sout.decode():
|
|
config.available_features.add("gnutar")
|
|
|
|
# ELF tests expect the default target for ld.lld to be ELF.
|
|
if config.ld_lld_default_mingw:
|
|
config.excludes.append("ELF")
|
|
|
|
if config.enable_threads:
|
|
config.available_features.add("thread_support")
|