2022-04-22 14:11:38 -05:00
|
|
|
#!/usr/bin/env bash
|
2021-03-29 03:45:09 -05:00
|
|
|
set -e
|
|
|
|
|
|
|
|
cd $(dirname "$0")/../
|
|
|
|
|
|
|
|
source ./scripts/setup_rust_fork.sh
|
|
|
|
|
|
|
|
echo "[TEST] Test suite of rustc"
|
|
|
|
pushd rust
|
|
|
|
|
2022-02-23 04:49:34 -06:00
|
|
|
command -v rg >/dev/null 2>&1 || cargo install ripgrep
|
2021-03-29 03:45:09 -05:00
|
|
|
|
2024-04-11 05:42:48 -05:00
|
|
|
rm -r tests/ui/{unsized-locals/,lto/,linkage*} || true
|
|
|
|
for test in $(rg --files-with-matches "lto" tests/{codegen-units,ui,incremental}); do
|
2024-03-08 14:41:29 -06:00
|
|
|
rm $test
|
|
|
|
done
|
|
|
|
|
2024-04-11 05:42:48 -05:00
|
|
|
# should-fail tests don't work when compiletest is compiled with panic=abort
|
|
|
|
for test in $(rg --files-with-matches "//@ should-fail" tests/{codegen-units,ui,incremental}); do
|
2021-03-29 03:45:09 -05:00
|
|
|
rm $test
|
|
|
|
done
|
|
|
|
|
2024-03-08 14:41:29 -06:00
|
|
|
for test in $(rg -i --files-with-matches "//(\[\w+\])?~[^\|]*\s*ERR|//@ error-pattern:|//@(\[.*\])? build-fail|//@(\[.*\])? run-fail|-Cllvm-args" tests/ui); do
|
2021-03-29 03:45:09 -05:00
|
|
|
rm $test
|
|
|
|
done
|
|
|
|
|
2023-01-05 02:45:44 -06:00
|
|
|
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-10-09 03:52:46 -05:00
|
|
|
git checkout -- tests/ui/entry-point/auxiliary/bad_main_functions.rs
|
2023-03-15 09:41:48 -05:00
|
|
|
rm tests/ui/parser/unclosed-delimiter-in-dep.rs # submodule contains //~ERROR
|
2021-03-29 03:45:09 -05:00
|
|
|
|
2022-03-20 10:55:21 -05:00
|
|
|
# missing features
|
|
|
|
# ================
|
|
|
|
|
|
|
|
# vendor intrinsics
|
2024-03-08 14:41:29 -06:00
|
|
|
rm tests/ui/asm/x86_64/evex512-implicit-feature.rs # unimplemented AVX512 x86 vendor intrinsic
|
2024-07-13 13:39:03 -05:00
|
|
|
rm tests/ui/simd/dont-invalid-bitcast-x86_64.rs # unimplemented llvm.x86.sse41.round.ps
|
2022-03-20 10:55:21 -05:00
|
|
|
|
|
|
|
# exotic linkages
|
2024-06-30 06:28:14 -05:00
|
|
|
rm tests/incremental/hashes/function_interfaces.rs
|
|
|
|
rm tests/incremental/hashes/statics.rs
|
2024-08-09 12:18:46 -05:00
|
|
|
rm -r tests/run-make/naked-symbol-visibility
|
2022-03-20 10:55:21 -05:00
|
|
|
|
|
|
|
# variadic arguments
|
2023-01-05 02:45:44 -06:00
|
|
|
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
|
2023-04-29 07:00:43 -05:00
|
|
|
rm -r tests/run-make/c-link-to-rust-va-list-fn # requires callee side vararg support
|
2024-05-13 08:26:33 -05:00
|
|
|
rm tests/ui/delegation/fn-header.rs
|
2022-03-20 10:55:21 -05:00
|
|
|
|
|
|
|
# unsized locals
|
2023-01-05 02:45:44 -06:00
|
|
|
rm -r tests/run-pass-valgrind/unsized-locals
|
2022-03-20 10:55:21 -05:00
|
|
|
|
|
|
|
# misc unimplemented things
|
2023-01-05 02:45:44 -06:00
|
|
|
rm tests/ui/target-feature/missing-plusminus.rs # error not implemented
|
|
|
|
rm -r tests/run-make/repr128-dwarf # debuginfo test
|
2023-04-29 07:00:43 -05:00
|
|
|
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-09 03:52:46 -05:00
|
|
|
rm tests/ui/asm/x86_64/issue-96797.rs # const and sym inline asm operands don't work entirely correctly
|
2024-03-16 12:23:11 -05:00
|
|
|
rm tests/ui/asm/x86_64/goto.rs # inline asm labels not supported
|
2024-07-13 13:39:03 -05:00
|
|
|
rm tests/ui/simd/simd-bitmask-notpow2.rs # non-pow-of-2 simd vector sizes
|
2024-09-23 06:20:46 -05:00
|
|
|
rm -r tests/run-make/embed-source-dwarf # embedding sources in debuginfo
|
2023-04-29 07:00:43 -05:00
|
|
|
|
|
|
|
# requires LTO
|
|
|
|
rm -r tests/run-make/cdylib
|
|
|
|
rm -r tests/run-make/codegen-options-parsing
|
|
|
|
rm -r tests/run-make/lto-*
|
|
|
|
rm -r tests/run-make/reproducible-build-2
|
2023-12-24 08:35:19 -06:00
|
|
|
rm -r tests/run-make/no-builtins-lto
|
2024-06-30 06:28:14 -05:00
|
|
|
rm -r tests/run-make/reachable-extern-fn-available-lto
|
|
|
|
|
|
|
|
# coverage instrumentation
|
|
|
|
rm tests/ui/consts/precise-drop-with-coverage.rs
|
|
|
|
rm tests/ui/issues/issue-85461.rs
|
|
|
|
rm -r tests/ui/instrument-coverage/
|
|
|
|
|
|
|
|
# missing f16/f128 support
|
|
|
|
rm tests/ui/half-open-range-patterns/half-open-range-pats-semantics.rs
|
2024-09-23 06:20:46 -05:00
|
|
|
rm tests/ui/asm/aarch64/type-f16.rs
|
|
|
|
rm tests/ui/float/conv-bits-runtime-const.rs
|
2022-03-20 10:55:21 -05:00
|
|
|
|
|
|
|
# optimization tests
|
|
|
|
# ==================
|
2023-01-05 02:45:44 -06:00
|
|
|
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
|
2024-06-30 06:28:14 -05:00
|
|
|
rm tests/ui/statics/const_generics.rs # same
|
2022-03-20 10:55:21 -05:00
|
|
|
|
|
|
|
# backend specific tests
|
|
|
|
# ======================
|
2023-01-05 02:45:44 -06:00
|
|
|
rm tests/incremental/thinlto/cgu_invalidated_when_import_{added,removed}.rs # requires LLVM
|
2023-04-29 07:00:43 -05:00
|
|
|
rm -r tests/run-make/cross-lang-lto # 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 08:32:34 -05:00
|
|
|
rm -r tests/run-make/llvm-ident # same
|
|
|
|
rm -r tests/run-make/no-builtins-attribute # same
|
2024-06-30 06:28:14 -05:00
|
|
|
rm -r tests/run-make/pgo-gen-no-imp-symbols # same
|
2023-01-05 02:45:44 -06:00
|
|
|
rm tests/ui/abi/stack-protector.rs # requires stack protector support
|
2023-04-29 07:00:43 -05:00
|
|
|
rm -r tests/run-make/emit-stack-sizes # requires support for -Z emit-stack-sizes
|
2023-07-22 08:32:34 -05:00
|
|
|
rm -r tests/run-make/optimization-remarks-dir # remarks are LLVM specific
|
2024-05-13 08:26:33 -05:00
|
|
|
rm -r tests/run-make/print-to-output # requires --print relocation-models
|
2022-03-20 10:55:21 -05:00
|
|
|
|
2024-03-28 06:43:35 -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/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
|
2024-06-30 06:28:14 -05:00
|
|
|
rm -r tests/run-make/notify-all-emit-artifacts
|
|
|
|
rm -r tests/run-make/reset-codegen-1
|
|
|
|
rm -r tests/run-make/inline-always-many-cgu
|
2024-07-13 13:39:03 -05:00
|
|
|
rm -r tests/run-make/intrinsic-unreachable
|
2024-03-28 06:43:35 -05:00
|
|
|
|
2022-03-20 10:55:21 -05:00
|
|
|
# giving different but possibly correct results
|
|
|
|
# =============================================
|
2023-01-05 02:45:44 -06:00
|
|
|
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 12:23:11 -05:00
|
|
|
rm tests/ui/consts/const-mut-refs-crate.rs # same
|
2024-08-09 12:18:46 -05:00
|
|
|
rm tests/ui/abi/large-byval-align.rs # exceeds implementation limit of Cranelift
|
2021-03-29 03:45:09 -05:00
|
|
|
|
2022-03-20 10:55:21 -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
|
|
|
|
# ============================================================
|
2023-01-05 02:45:44 -06:00
|
|
|
rm -r tests/run-make/remap-path-prefix-dwarf # requires llvm-dwarfdump
|
2024-03-28 06:43:35 -05:00
|
|
|
rm -r tests/run-make/compiler-builtins # Expects lib/rustlib/src/rust to contains the standard library source
|
2021-03-29 03:45:09 -05:00
|
|
|
|
2022-03-20 10:55:21 -05:00
|
|
|
# genuine bugs
|
|
|
|
# ============
|
2023-07-22 08:32:34 -05:00
|
|
|
rm -r tests/run-make/extern-fn-explicit-align # argument alignment not yet supported
|
2024-03-28 06:43:35 -05:00
|
|
|
rm -r tests/run-make/panic-abort-eh_frame # .eh_frame emitted with panic=abort
|
2024-06-30 06:28:14 -05:00
|
|
|
rm tests/ui/deprecation/deprecated_inline_threshold.rs # missing deprecation warning for -Cinline-threshold
|
2023-10-09 03:52:46 -05:00
|
|
|
|
2022-03-20 10:55:21 -05:00
|
|
|
# bugs in the test suite
|
|
|
|
# ======================
|
2023-01-05 02:45:44 -06:00
|
|
|
rm tests/ui/process/nofile-limit.rs # TODO some AArch64 linking issue
|
2024-08-09 12:18:46 -05:00
|
|
|
rm tests/ui/backtrace/synchronized-panic-handler.rs # missing needs-unwind annotation
|
2024-09-23 06:20:46 -05:00
|
|
|
rm tests/ui/lint/non-snake-case/lint-non-snake-case-crate.rs # same
|
2024-08-09 12:18:46 -05:00
|
|
|
rm -r tests/ui/codegen/equal-pointers-unequal # make incorrect assumptions about the location of stack variables
|
2021-12-30 07:53:41 -06:00
|
|
|
|
2023-01-05 02:45:44 -06:00
|
|
|
rm tests/ui/stdio-is-blocking.rs # really slow with unoptimized libstd
|
2024-09-23 06:20:46 -05:00
|
|
|
rm tests/ui/intrinsics/panic-uninitialized-zeroed.rs # same
|
|
|
|
rm tests/ui/process/process-panic-after-fork.rs # same
|
2022-10-23 09:22:55 -05:00
|
|
|
|
2023-04-29 07:00:43 -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
|
2024-09-23 06:20:46 -05:00
|
|
|
# FIXME remove the bootstrap changes once it is no longer necessary to revert rust-lang/rust#130642
|
|
|
|
# to avoid building rustc when testing stage0 run-make.
|
2023-04-29 07:00:43 -05:00
|
|
|
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 13:20:12 -05:00
|
|
|
RUSTC := \$(BARE_RUSTC) --out-dir \$(TMPDIR) -L \$(TMPDIR) \$(RUSTFLAGS) -Ainternal_features
|
2023-04-29 07:00:43 -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:43:35 -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
|
2024-08-09 12:18:46 -05:00
|
|
|
--- a/src/tools/run-make-support/src/external_deps/rustdoc.rs
|
|
|
|
+++ b/src/tools/run-make-support/src/external_deps/rustdoc.rs
|
2024-03-28 06:43:35 -05:00
|
|
|
@@ -34,8 +34,6 @@ pub fn bare() -> Self {
|
2024-06-30 06:28:14 -05:00
|
|
|
#[track_caller]
|
2024-03-28 06:43:35 -05:00
|
|
|
pub fn new() -> Self {
|
|
|
|
let mut cmd = setup_common();
|
2024-06-30 06:28:14 -05:00
|
|
|
- let target_rpath_dir = env_var_os("TARGET_RPATH_DIR");
|
2024-03-28 06:43:35 -05:00
|
|
|
- cmd.arg(format!("-L{}", target_rpath_dir.to_string_lossy()));
|
2024-06-30 06:28:14 -05:00
|
|
|
Self { cmd }
|
2024-03-28 06:43:35 -05:00
|
|
|
}
|
|
|
|
|
2024-09-23 06:20:46 -05:00
|
|
|
diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs
|
|
|
|
index 2047345d78a..a7e9352bb1c 100644
|
|
|
|
--- a/src/bootstrap/src/core/build_steps/test.rs
|
|
|
|
+++ b/src/bootstrap/src/core/build_steps/test.rs
|
|
|
|
@@ -1733,11 +1733,6 @@ fn run(self, builder: &Builder<'_>) {
|
|
|
|
|
|
|
|
let is_rustdoc = suite.ends_with("rustdoc-ui") || suite.ends_with("rustdoc-js");
|
|
|
|
|
|
|
|
- if mode == "run-make" {
|
|
|
|
- let cargo = builder.ensure(tool::Cargo { compiler, target: compiler.host });
|
|
|
|
- cmd.arg("--cargo-path").arg(cargo);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// Avoid depending on rustdoc when we don't need it.
|
|
|
|
if mode == "rustdoc"
|
|
|
|
|| mode == "run-make"
|
|
|
|
diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs
|
|
|
|
index 414f9f3a7f1..5c18179b6fe 100644
|
|
|
|
--- a/src/tools/compiletest/src/common.rs
|
|
|
|
+++ b/src/tools/compiletest/src/common.rs
|
|
|
|
@@ -183,9 +183,6 @@ pub struct Config {
|
|
|
|
/// The rustc executable.
|
|
|
|
pub rustc_path: PathBuf,
|
|
|
|
|
|
|
|
- /// The cargo executable.
|
|
|
|
- pub cargo_path: Option<PathBuf>,
|
|
|
|
-
|
|
|
|
/// The rustdoc executable.
|
|
|
|
pub rustdoc_path: Option<PathBuf>,
|
|
|
|
|
|
|
|
diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs
|
|
|
|
index 3339116d542..250b5084d13 100644
|
|
|
|
--- a/src/tools/compiletest/src/lib.rs
|
|
|
|
+++ b/src/tools/compiletest/src/lib.rs
|
|
|
|
@@ -47,7 +47,6 @@ pub fn parse_config(args: Vec<String>) -> Config {
|
|
|
|
opts.reqopt("", "compile-lib-path", "path to host shared libraries", "PATH")
|
|
|
|
.reqopt("", "run-lib-path", "path to target shared libraries", "PATH")
|
|
|
|
.reqopt("", "rustc-path", "path to rustc to use for compiling", "PATH")
|
|
|
|
- .optopt("", "cargo-path", "path to cargo to use for compiling", "PATH")
|
|
|
|
.optopt("", "rustdoc-path", "path to rustdoc to use for compiling", "PATH")
|
|
|
|
.optopt("", "coverage-dump-path", "path to coverage-dump to use in tests", "PATH")
|
|
|
|
.reqopt("", "python", "path to python to use for doc tests", "PATH")
|
|
|
|
@@ -261,7 +260,6 @@ fn make_absolute(path: PathBuf) -> PathBuf {
|
|
|
|
compile_lib_path: make_absolute(opt_path(matches, "compile-lib-path")),
|
|
|
|
run_lib_path: make_absolute(opt_path(matches, "run-lib-path")),
|
|
|
|
rustc_path: opt_path(matches, "rustc-path"),
|
|
|
|
- cargo_path: matches.opt_str("cargo-path").map(PathBuf::from),
|
|
|
|
rustdoc_path: matches.opt_str("rustdoc-path").map(PathBuf::from),
|
|
|
|
coverage_dump_path: matches.opt_str("coverage-dump-path").map(PathBuf::from),
|
|
|
|
python: matches.opt_str("python").unwrap(),
|
|
|
|
@@ -366,7 +364,6 @@ pub fn log_config(config: &Config) {
|
|
|
|
logv(c, format!("compile_lib_path: {:?}", config.compile_lib_path));
|
|
|
|
logv(c, format!("run_lib_path: {:?}", config.run_lib_path));
|
|
|
|
logv(c, format!("rustc_path: {:?}", config.rustc_path.display()));
|
|
|
|
- logv(c, format!("cargo_path: {:?}", config.cargo_path));
|
|
|
|
logv(c, format!("rustdoc_path: {:?}", config.rustdoc_path));
|
|
|
|
logv(c, format!("src_base: {:?}", config.src_base.display()));
|
|
|
|
logv(c, format!("build_base: {:?}", config.build_base.display()));
|
|
|
|
diff --git a/src/tools/compiletest/src/runtest/run_make.rs b/src/tools/compiletest/src/runtest/run_make.rs
|
|
|
|
index 75fe6a6baaf..852568ae925 100644
|
|
|
|
--- a/src/tools/compiletest/src/runtest/run_make.rs
|
|
|
|
+++ b/src/tools/compiletest/src/runtest/run_make.rs
|
|
|
|
@@ -61,10 +61,6 @@ fn run_rmake_legacy_test(&self) {
|
|
|
|
.env_remove("MFLAGS")
|
|
|
|
.env_remove("CARGO_MAKEFLAGS");
|
|
|
|
|
|
|
|
- if let Some(ref cargo) = self.config.cargo_path {
|
|
|
|
- cmd.env("CARGO", cwd.join(cargo));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if let Some(ref rustdoc) = self.config.rustdoc_path {
|
|
|
|
cmd.env("RUSTDOC", cwd.join(rustdoc));
|
|
|
|
}
|
|
|
|
@@ -413,10 +409,6 @@ fn run_rmake_v2_test(&self) {
|
|
|
|
// through a specific CI runner).
|
|
|
|
.env("LLVM_COMPONENTS", &self.config.llvm_components);
|
|
|
|
|
|
|
|
- if let Some(ref cargo) = self.config.cargo_path {
|
|
|
|
- cmd.env("CARGO", source_root.join(cargo));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if let Some(ref rustdoc) = self.config.rustdoc_path {
|
|
|
|
cmd.env("RUSTDOC", source_root.join(rustdoc));
|
|
|
|
}
|
2023-04-29 07:00:43 -05:00
|
|
|
EOF
|
|
|
|
|
2021-03-29 03:45:09 -05:00
|
|
|
echo "[TEST] rustc test suite"
|
2023-04-29 07:00:43 -05:00
|
|
|
COMPILETEST_FORCE_STAGE0=1 ./x.py test --stage 0 --test-args=--nocapture tests/{codegen-units,run-make,run-pass-valgrind,ui,incremental}
|
2021-03-29 03:45:09 -05:00
|
|
|
popd
|