Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/tools/compiletest/src/runtest/run_make.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ impl TestCx<'_> {
// through a specific CI runner).
.env("LLVM_COMPONENTS", &self.config.llvm_components);

if let Some(codegen_backend) = &self.config.override_codegen_backend {
// In case it's a different codegen backend than LLVM.
cmd.env("RUSTC_CODEGEN_BACKEND", codegen_backend.as_str());
}

// The `run-make-cargo` and `build-std` suites need an in-tree `cargo`, `run-make` does not.
if matches!(self.config.suite, TestSuite::RunMakeCargo | TestSuite::BuildStd) {
cmd.env(
Expand Down
3 changes: 3 additions & 0 deletions src/tools/run-make-support/src/external_deps/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ pub fn rustc_path() -> String {
fn setup_common() -> Command {
let mut cmd = Command::new(rustc_path());
set_host_compiler_dylib_path(&mut cmd);
if let Ok(codegen_backend) = std::env::var("RUSTC_CODEGEN_BACKEND") {
cmd.arg(format!("-Zcodegen-backend={codegen_backend}"));
}
cmd
}

Expand Down
1 change: 1 addition & 0 deletions tests/run-make/amdgpu-kd/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

//@ needs-llvm-components: amdgpu
//@ needs-rust-lld
//@ ignore-backends: gcc

use run_make_support::targets::is_windows_gnu;
use run_make_support::{llvm_readobj, rustc};
Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/atomic-lock-free/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// guaranteed to be lock-free.

//@ only-linux
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{llvm_components_contain, llvm_readobj, rustc};

Expand Down
1 change: 1 addition & 0 deletions tests/run-make/avr-custom-target-missing-cpu/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Make sure that reports the normal missing-CPU diagnostic instead of ICEing
//
//@ needs-llvm-components: avr
//@ ignore-backends: gcc

use run_make_support::rustc;

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/avr-rjmp-offset/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//@ needs-llvm-components: avr
//@ needs-rust-lld
//@ ignore-backends: gcc

//! Regression test for #129301/llvm-project#106722 within `rustc`.
//!
//! Some LLVM-versions had wrong offsets in the local labels, causing the first
Expand Down
1 change: 1 addition & 0 deletions tests/run-make/branch-protection-check-IBT/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
// FIXME(#93754): increase the test coverage of this test.
//@ only-x86_64-unknown-linux-gnu
//@ ignore-cross-compile
//@ ignore-backends: gcc

use run_make_support::{bare_rustc, llvm_readobj};

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/c-link-to-rust-va-list-fn/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
//@ ignore-sgx: (x86 machine code cannot be directly executed)
//@ ignore-pauthtest: (it requires non-trivial compilation of c sources, and only supports dynamic
// linking, ignore the test).
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{cc, extra_c_flags, run, rustc, static_lib_name};

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/cdylib/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
// - `bar()` which implements basic addition.

//@ ignore-cross-compile
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{cc, cwd, dynamic_lib_name, is_windows_msvc, rfs, run, rustc};

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/codegen-options-parsing/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// contain specific helpful indications.

//@ ignore-cross-compile
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::regex::Regex;
use run_make_support::rustc;
Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/compressed-debuginfo/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

//@ only-linux
//@ ignore-cross-compile
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

// FIXME: This test isn't comprehensive and isn't covering all possible combinations.

Expand Down
4 changes: 3 additions & 1 deletion tests/run-make/const-destruct-stable-toolchain/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//@ needs-target-std
//
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

// Test that the suggestion to constrain a type parameter that is dropped in a const
// function with a `[const] Destruct` bound is only offered on nightly, since the bound
// requires an unstable feature.
Expand Down
4 changes: 3 additions & 1 deletion tests/run-make/const-trait-stable-toolchain/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//@ needs-target-std
//
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

// Test output of const super trait errors in both stable and nightly.
// We don't want to provide suggestions on stable that only make sense in nightly.

Expand Down
4 changes: 3 additions & 1 deletion tests/run-make/cross-lang-lto-upstream-rlibs/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//@ needs-target-std
//
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

// When using the flag -C linker-plugin-lto, static libraries could lose their upstream object
// files during compilation. This bug was fixed in #53031, and this test compiles a staticlib
// dependent on upstream, checking that the upstream object file still exists after no LTO and
Expand Down
4 changes: 3 additions & 1 deletion tests/run-make/cross-lang-lto/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//@ needs-target-std
//
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

// This test checks that the object files we generate are actually
// LLVM bitcode files (as used by linker LTO plugins) when compiling with
// -Clinker-plugin-lto.
Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/embed-source-dwarf/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
//@ ignore-apple
//@ ignore-wasm (`object` doesn't handle wasm object files)
//@ ignore-cross-compile
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

// This test should be replaced with one in tests/debuginfo once we can easily
// tell via GDB or LLDB if debuginfo contains source code. Cheap tricks in LLDB
Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/emit-stack-sizes/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
//@ only-elf
// Reason: this feature only works when the output object format is ELF.
// This won't be the case on Windows/OSX - for example, OSX produces a Mach-O binary.
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{llvm_readobj, rustc};

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/extern-fn-explicit-align/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

//@ ignore-cross-compile
// Reason: the compiled binary is executed
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{build_native_static_lib, run, rustc};

Expand Down
3 changes: 3 additions & 0 deletions tests/run-make/fat-lto-module-summary/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{llvm_bcanalyzer, rustc};

fn main() {
Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/fat-then-thin-lto/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// and allowing users to build with lto=thin.

//@ only-x86_64-unknown-linux-gnu
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{dynamic_lib_name, llvm_objdump, rustc};

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/forced-unwind-terminate-pof/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//@ ignore-cross-compile
//@ ignore-windows
//Reason: pthread (POSIX threads) is not available on Windows
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{run, rustc};

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/issue-149402-suggest-unresolve/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
//!
//@ only-nightly
//@ needs-target-std
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{diff, rustc, similar};

Expand Down
1 change: 1 addition & 0 deletions tests/run-make/link-cfg/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
//@ ignore-cross-compile
// Reason: the compiled binary is executed
//@ needs-llvm-components: x86
//@ ignore-backends: gcc

use run_make_support::{bare_rustc, build_native_dynamic_lib, build_native_static_lib, run, rustc};

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/link-eh-frame-terminator/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
// Reason: the usage of a large array in the test causes an out-of-memory
// error on 32 bit systems.
//@ ignore-cross-compile
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{bin_name, llvm_objdump, run, rustc};

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/linker-plugin-lto-fat/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

//@ only-x86_64-unknown-linux-gnu
//@ needs-rust-lld
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{dynamic_lib_name, llvm_as, llvm_objdump, rustc};

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/llvm-ident/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//@ only-linux
//@ ignore-cross-compile
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::llvm::llvm_bin_dir;
use run_make_support::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
//@ ignore-cross-compile
//@ needs-dynamic-linking
//@ only-nightly (requires unstable rustc flag)
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

// This test trips a check in the MSVC linker for an outdated processor:
// "LNK1322: cannot avoid potential ARM hazard (Cortex-A53 MPCore processor bug #843419)"
Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/lto-avoid-object-duplication/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// Only checking on Unix platforms should suffice.
//FIXME(Oneirical): This could be adapted to work on Windows by checking how
// that output differs.
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{llvm_objdump, regex, rust_lib_name, rustc, static_lib_name};

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/lto-empty/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// See https://github.com/rust-lang/rust/issues/63349

//@ ignore-cross-compile
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::rustc;

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/lto-linkage-used-attr/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

//@ only-x86_64-unknown-linux-gnu
// Reason: some of the inline assembly directives are architecture-specific.
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::rustc;

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/lto-long-filenames/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
// See https://github.com/rust-lang/rust/issues/49914

//@ ignore-cross-compile
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{rfs, rustc};

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/lto-long-filenames_cn/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// as this is not something rustc can fix by itself,
// we just skip the test on windows-gnu for now. Hence:
//@ ignore-windows-gnu
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{rfs, rustc};

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/lto-no-link-whole-rlib/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

//@ ignore-cross-compile
// Reason: the compiled binary is executed
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{build_native_static_lib, run, rustc};

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/lto-readonly-lib/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// See https://github.com/rust-lang/rust/pull/17619

//@ ignore-cross-compile
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{run, rust_lib_name, rustc, test_while_readonly};

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/lto-smoke-c/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

//@ ignore-cross-compile
// Reason: the compiled binary is executed
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib_name};

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/lto-smoke/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// See https://github.com/rust-lang/rust/issues/10741

//@ ignore-cross-compile
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::rustc;

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/min-global-align/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//@ only-linux
// Reason: this test is specific to linux, considering compilation is targeted
// towards linux architectures only.
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{assert_count_is, llvm_components_contain, rfs, rustc};

Expand Down
1 change: 1 addition & 0 deletions tests/run-make/mismatching-target-triples/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// error message is used.
// See https://github.com/rust-lang/rust/issues/10814
//@ needs-llvm-components: x86
//@ ignore-backends: gcc

use run_make_support::rustc;

Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/missing-unstable-trait-bound/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//@ ignore-wasm32
//@ ignore-wasm64
// ignore-tidy-linelength
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

// Ensure that on stable we don't suggest restricting with an unsafe trait and we continue
// mentioning the rest of the obligation chain.
Expand Down
1 change: 1 addition & 0 deletions tests/run-make/musl-default-linking/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use run_make_support::{rustc, serde_json};
// we should be trying to move these targets to dynamically link
// musl libc by default.
//@ needs-llvm-components: aarch64 arm powerpc x86
//@ ignore-backends: gcc
static LEGACY_STATIC_LINKING_TARGETS: &[&'static str] = &[
"aarch64-unknown-linux-musl",
"arm-unknown-linux-musleabi",
Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/naked-symbol-visibility/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//@ only-x86_64
//@ needs-target-std
//@ needs-crate-type: dylib
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::object::ObjectSymbol;
use run_make_support::object::read::{File, Object, Symbol};
Expand Down
3 changes: 3 additions & 0 deletions tests/run-make/no-builtins-attribute/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
//@ needs-target-std
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

// `no_builtins` is an attribute related to LLVM's optimizations. In order to ensure that it has an
// effect on link-time optimizations (LTO), it should be added to function declarations in a crate.
// This test uses the `llvm-filecheck` tool to determine that this attribute is successfully
Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/no-builtins-linker-plugin-lto/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//@ only-x86_64-unknown-linux-gnu
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use std::fs;
use std::path::Path;
Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/no-builtins-lto/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//@ ignore-cross-compile
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

// The rlib produced by a no_builtins crate should be explicitly linked
// during compilation, and as a result be present in the linker arguments.
Expand Down
2 changes: 2 additions & 0 deletions tests/run-make/optimization-remarks-dir-pgo/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

//@ needs-profiler-runtime
//@ ignore-cross-compile
// FIXME: Once GCC backend is fixed, remove this `ignore-backends`.
//@ ignore-backends: gcc

use run_make_support::{
has_extension, has_prefix, invalid_utf8_contains, llvm_profdata, run, rustc, shallow_find_files,
Expand Down
Loading
Loading