rust/scripts/test_rustc_tests.sh

166 lines
6.5 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
2021-03-15 08:49:57 -05:00
set -e
cd $(dirname "$0")/../
source ./scripts/setup_rust_fork.sh
echo "[TEST] Test suite of rustc"
pushd rust
command -v rg >/dev/null 2>&1 || cargo install ripgrep
2021-03-15 08:49:57 -05:00
# FIXME remove this workaround once ICE tests no longer emit an outdated nightly message
for test in $(rg -i --files-with-matches "//@(\[.*\])? failure-status: 101" tests/ui); do
echo "rm $test"
rm $test
done
rm -r tests/ui/{unsized-locals/,lto/,linkage*} || true
2023-10-07 06:14:24 -05:00
for test in $(rg --files-with-matches "lto" tests/{codegen-units,ui,incremental}); do
2021-03-15 08:49:57 -05:00
rm $test
done
for test in $(rg -i --files-with-matches "//(\[\w+\])?~[^\|]*\s*ERR|//@ error-pattern:|//@(\[.*\])? build-fail|//@(\[.*\])? run-fail|-Cllvm-args" tests/ui); do
2021-03-15 08:49:57 -05:00
rm $test
done
git checkout -- tests/ui/issues/auxiliary/issue-3136-a.rs # contains //~ERROR, but shouldn't be removed
git checkout -- tests/ui/proc-macro/pretty-print-hack/
2023-09-26 11:51:46 -05:00
git checkout -- tests/ui/entry-point/auxiliary/bad_main_functions.rs
2023-03-04 06:59:27 -06:00
rm tests/ui/parser/unclosed-delimiter-in-dep.rs # submodule contains //~ERROR
2021-03-15 08:49:57 -05:00
2022-03-18 10:38:28 -05:00
# missing features
# ================
# vendor intrinsics
2024-02-20 12:15:13 -06:00
rm tests/ui/asm/x86_64/evex512-implicit-feature.rs # unimplemented AVX512 x86 vendor intrinsic
2022-03-18 10:38:28 -05:00
# exotic linkages
rm tests/ui/issues/issue-33992.rs # unsupported linkages
rm tests/incremental/hashes/function_interfaces.rs # same
rm tests/incremental/hashes/statics.rs # same
2022-03-18 10:38:28 -05:00
# variadic arguments
rm tests/ui/abi/mir/mir_codegen_calls_variadic.rs # requires float varargs
rm tests/ui/abi/variadic-ffi.rs # requires callee side vararg support
rm -r tests/run-make/c-link-to-rust-va-list-fn # requires callee side vararg support
2022-03-18 10:38:28 -05:00
# unsized locals
rm -r tests/run-pass-valgrind/unsized-locals
2022-03-18 10:38:28 -05:00
# misc unimplemented things
rm tests/ui/target-feature/missing-plusminus.rs # error not implemented
rm -r tests/run-make/repr128-dwarf # debuginfo test
rm -r tests/run-make/split-debuginfo # same
rm -r tests/run-make/target-specs # i686 not supported by Cranelift
rm -r tests/run-make/mismatching-target-triples # same
2023-10-07 06:14:24 -05:00
rm tests/ui/asm/x86_64/issue-96797.rs # const and sym inline asm operands don't work entirely correctly
2024-03-09 11:35:49 -06:00
rm tests/ui/asm/x86_64/goto.rs # inline asm labels not supported
# requires LTO
rm -r tests/run-make/cdylib
rm -r tests/run-make/issue-14500
rm -r tests/run-make/issue-64153
rm -r tests/run-make/codegen-options-parsing
rm -r tests/run-make/lto-*
rm -r tests/run-make/reproducible-build-2
2023-05-12 07:58:56 -05:00
rm -r tests/run-make/issue-109934-lto-debuginfo
rm -r tests/run-make/no-builtins-lto
2022-03-18 10:38:28 -05:00
# optimization tests
# ==================
rm tests/ui/codegen/issue-28950.rs # depends on stack size optimizations
rm tests/ui/codegen/init-large-type.rs # same
rm tests/ui/issues/issue-40883.rs # same
rm -r tests/run-make/fmt-write-bloat/ # tests an optimization
2022-03-18 10:38:28 -05:00
# backend specific tests
# ======================
rm tests/incremental/thinlto/cgu_invalidated_when_import_{added,removed}.rs # requires LLVM
rm -r tests/run-make/cross-lang-lto # same
rm -r tests/run-make/issue-7349 # same
rm -r tests/run-make/sepcomp-inlining # same
rm -r tests/run-make/sepcomp-separate # same
rm -r tests/run-make/sepcomp-cci-copies # same
rm -r tests/run-make/volatile-intrinsics # same
2023-07-22 06:27:49 -05:00
rm -r tests/run-make/llvm-ident # same
rm -r tests/run-make/no-builtins-attribute # same
rm tests/ui/abi/stack-protector.rs # requires stack protector support
rm -r tests/run-make/emit-stack-sizes # requires support for -Z emit-stack-sizes
2023-07-12 09:47:23 -05:00
rm -r tests/run-make/optimization-remarks-dir # remarks are LLVM specific
2022-03-18 10:38:28 -05:00
2024-03-26 05:55:46 -05:00
# requires asm, llvm-ir and/or llvm-bc emit support
# =============================================
rm -r tests/run-make/emit-named-files
rm -r tests/run-make/issue-30063
rm -r tests/run-make/multiple-emits
rm -r tests/run-make/output-type-permutations
rm -r tests/run-make/emit-to-stdout
rm -r tests/run-make/compressed-debuginfo
rm -r tests/run-make/symbols-include-type-name
2022-03-18 10:38:28 -05:00
# giving different but possibly correct results
# =============================================
rm tests/ui/mir/mir_misc_casts.rs # depends on deduplication of constants
rm tests/ui/mir/mir_raw_fat_ptr.rs # same
rm tests/ui/consts/issue-33537.rs # same
2024-03-16 11:30:08 -05:00
rm tests/ui/consts/const-mut-refs-crate.rs # same
2021-03-15 08:49:57 -05:00
# doesn't work due to the way the rustc test suite is invoked.
# should work when using ./x.py test the way it is intended
# ============================================================
rm -r tests/run-make/remap-path-prefix-dwarf # requires llvm-dwarfdump
2024-03-25 09:29:11 -05:00
rm -r tests/run-make/compiler-builtins # Expects lib/rustlib/src/rust to contains the standard library source
2021-03-15 08:49:57 -05:00
2022-03-18 10:38:28 -05:00
# genuine bugs
# ============
rm tests/incremental/spike-neg1.rs # errors out for some reason
rm tests/incremental/spike-neg2.rs # same
2023-07-22 06:27:49 -05:00
rm -r tests/run-make/extern-fn-explicit-align # argument alignment not yet supported
2024-03-26 05:55:46 -05:00
rm -r tests/run-make/panic-abort-eh_frame # .eh_frame emitted with panic=abort
2023-07-22 06:27:49 -05:00
2022-03-18 10:38:28 -05:00
# bugs in the test suite
# ======================
rm tests/ui/process/nofile-limit.rs # TODO some AArch64 linking issue
2022-03-18 09:38:58 -05:00
rm tests/ui/stdio-is-blocking.rs # really slow with unoptimized libstd
2023-04-25 08:43:27 -05:00
cp ../dist/bin/rustdoc-clif ../dist/bin/rustdoc # some tests expect bin/rustdoc to exist
# prevent $(RUSTDOC) from picking up the sysroot built by x.py. It conflicts with the one used by
# rustdoc-clif
cat <<EOF | git apply -
diff --git a/tests/run-make/tools.mk b/tests/run-make/tools.mk
index ea06b620c4c..b969d0009c6 100644
--- a/tests/run-make/tools.mk
+++ b/tests/run-make/tools.mk
@@ -9,7 +9,7 @@ RUSTC_ORIGINAL := \$(RUSTC)
BARE_RUSTC := \$(HOST_RPATH_ENV) '\$(RUSTC)'
BARE_RUSTDOC := \$(HOST_RPATH_ENV) '\$(RUSTDOC)'
2023-08-09 05:33:57 -05:00
RUSTC := \$(BARE_RUSTC) --out-dir \$(TMPDIR) -L \$(TMPDIR) \$(RUSTFLAGS) -Ainternal_features
2023-04-25 08:43:27 -05:00
-RUSTDOC := \$(BARE_RUSTDOC) -L \$(TARGET_RPATH_DIR)
+RUSTDOC := \$(BARE_RUSTDOC)
ifdef RUSTC_LINKER
RUSTC := \$(RUSTC) -Clinker='\$(RUSTC_LINKER)'
RUSTDOC := \$(RUSTDOC) -Clinker='\$(RUSTC_LINKER)'
2024-03-28 06:38:15 -05:00
diff --git a/src/tools/run-make-support/src/rustdoc.rs b/src/tools/run-make-support/src/rustdoc.rs
index 9607ff02f96..b7d97caf9a2 100644
--- a/src/tools/run-make-support/src/rustdoc.rs
+++ b/src/tools/run-make-support/src/rustdoc.rs
@@ -34,8 +34,6 @@ pub fn bare() -> Self {
/// Construct a \`rustdoc\` invocation with \`-L \$(TARGET_RPATH_DIR)\` set.
pub fn new() -> Self {
let mut cmd = setup_common();
- let target_rpath_dir = env::var_os("TARGET_RPATH_DIR").unwrap();
- cmd.arg(format!("-L{}", target_rpath_dir.to_string_lossy()));
Self { cmd }
}
2023-04-25 08:43:27 -05:00
EOF
2021-03-15 08:49:57 -05:00
echo "[TEST] rustc test suite"
COMPILETEST_FORCE_STAGE0=1 ./x.py test --stage 0 --test-args=--nocapture tests/{codegen-units,run-make,run-pass-valgrind,ui,incremental}
2021-03-15 08:49:57 -05:00
popd