diff --git a/src/test/assembly/asm/mips-types.rs b/src/test/assembly/asm/mips-types.rs index 60cfebdd992..9ec7ba83c42 100644 --- a/src/test/assembly/asm/mips-types.rs +++ b/src/test/assembly/asm/mips-types.rs @@ -2,8 +2,9 @@ // revisions: mips32 mips64 // assembly-output: emit-asm //[mips32] compile-flags: --target mips-unknown-linux-gnu +//[mips32] needs-llvm-components: mips //[mips64] compile-flags: --target mips64-unknown-linux-gnuabi64 -// needs-llvm-components: mips +//[mips64] needs-llvm-components: mips #![feature(no_core, lang_items, rustc_attrs, repr_simd)] #![crate_type = "rlib"] diff --git a/src/test/assembly/asm/powerpc-types.rs b/src/test/assembly/asm/powerpc-types.rs index 742e4ddaed6..1e263649e86 100644 --- a/src/test/assembly/asm/powerpc-types.rs +++ b/src/test/assembly/asm/powerpc-types.rs @@ -2,8 +2,9 @@ // revisions: powerpc powerpc64 // assembly-output: emit-asm //[powerpc] compile-flags: --target powerpc-unknown-linux-gnu +//[powerpc] needs-llvm-components: powerpc //[powerpc64] compile-flags: --target powerpc64-unknown-linux-gnu -// needs-llvm-components: powerpc +//[powerpc64] needs-llvm-components: powerpc #![feature(no_core, lang_items, rustc_attrs, repr_simd)] #![crate_type = "rlib"] diff --git a/src/test/assembly/asm/riscv-types.rs b/src/test/assembly/asm/riscv-types.rs index 1ba73fcac9d..e62a6197b9a 100644 --- a/src/test/assembly/asm/riscv-types.rs +++ b/src/test/assembly/asm/riscv-types.rs @@ -2,9 +2,10 @@ // revisions: riscv64 riscv32 // assembly-output: emit-asm //[riscv64] compile-flags: --target riscv64imac-unknown-none-elf +//[riscv64] needs-llvm-components: riscv //[riscv32] compile-flags: --target riscv32imac-unknown-none-elf +//[riscv32] needs-llvm-components: riscv // compile-flags: -C target-feature=+d -// needs-llvm-components: riscv // min-system-llvm-version: 12.0 #![feature(no_core, lang_items, rustc_attrs)] diff --git a/src/test/assembly/asm/x86-modifiers.rs b/src/test/assembly/asm/x86-modifiers.rs index da2dc51d69e..c926fd7b3f5 100644 --- a/src/test/assembly/asm/x86-modifiers.rs +++ b/src/test/assembly/asm/x86-modifiers.rs @@ -3,7 +3,9 @@ // assembly-output: emit-asm // compile-flags: -O //[x86_64] compile-flags: --target x86_64-unknown-linux-gnu +//[x86_64] needs-llvm-components: x86 //[i686] compile-flags: --target i686-unknown-linux-gnu +//[i686] needs-llvm-components: x86 // compile-flags: -C llvm-args=--x86-asm-syntax=intel // compile-flags: -C target-feature=+avx512bw diff --git a/src/test/assembly/asm/x86-types.rs b/src/test/assembly/asm/x86-types.rs index b65b727d225..d25f3a03777 100644 --- a/src/test/assembly/asm/x86-types.rs +++ b/src/test/assembly/asm/x86-types.rs @@ -2,7 +2,9 @@ // revisions: x86_64 i686 // assembly-output: emit-asm //[x86_64] compile-flags: --target x86_64-unknown-linux-gnu +//[x86_64] needs-llvm-components: x86 //[i686] compile-flags: --target i686-unknown-linux-gnu +//[i686] needs-llvm-components: x86 // compile-flags: -C llvm-args=--x86-asm-syntax=intel // compile-flags: -C target-feature=+avx512bw diff --git a/src/test/assembly/static-relocation-model.rs b/src/test/assembly/static-relocation-model.rs index 2cd74a01c84..b331d45668a 100644 --- a/src/test/assembly/static-relocation-model.rs +++ b/src/test/assembly/static-relocation-model.rs @@ -1,10 +1,12 @@ // min-llvm-version: 12.0.0 -// needs-llvm-components: aarch64 x86 powerpc // revisions: x64 A64 ppc64le // assembly-output: emit-asm // [x64] compile-flags: --target x86_64-unknown-linux-gnu -Crelocation-model=static +// [x64] needs-llvm-components: x86 // [A64] compile-flags: --target aarch64-unknown-linux-gnu -Crelocation-model=static +// [A64] needs-llvm-components: aarch64 // [ppc64le] compile-flags: --target powerpc64le-unknown-linux-gnu -Crelocation-model=static +// [ppc64le] needs-llvm-components: powerpc #![feature(no_core, lang_items)] #![no_core] diff --git a/src/test/codegen/abi-efiapi.rs b/src/test/codegen/abi-efiapi.rs index 613b0bf50e5..b4fda5f8c84 100644 --- a/src/test/codegen/abi-efiapi.rs +++ b/src/test/codegen/abi-efiapi.rs @@ -1,13 +1,16 @@ // Checks if the correct annotation for the efiapi ABI is passed to llvm. // revisions:x86_64 i686 aarch64 arm riscv -// needs-llvm-components: aarch64 arm riscv - //[x86_64] compile-flags: --target x86_64-unknown-uefi +//[x86_64] needs-llvm-components: aarch64 arm riscv //[i686] compile-flags: --target i686-unknown-linux-musl +//[i686] needs-llvm-components: aarch64 arm riscv //[aarch64] compile-flags: --target aarch64-unknown-none +//[aarch64] needs-llvm-components: aarch64 arm riscv //[arm] compile-flags: --target armv7r-none-eabi +//[arm] needs-llvm-components: aarch64 arm riscv //[riscv] compile-flags: --target riscv64gc-unknown-none-elf +//[riscv] needs-llvm-components: aarch64 arm riscv // compile-flags: -C no-prepopulate-passes #![crate_type = "lib"] diff --git a/src/test/codegen/asm-sanitize-llvm.rs b/src/test/codegen/asm-sanitize-llvm.rs index fe09caa6973..135177016bf 100644 --- a/src/test/codegen/asm-sanitize-llvm.rs +++ b/src/test/codegen/asm-sanitize-llvm.rs @@ -1,5 +1,6 @@ -// FIXME(nagisa): remove the flags here once all targets support `asm!`. +// FIXME(nagisa): remove the flags below once all targets support `asm!`. // compile-flags: --target x86_64-unknown-linux-gnu +// needs-llvm-components: x86 // Verify we sanitize the special tokens for the LLVM inline-assembly, ensuring people won't // inadvertently rely on the LLVM-specific syntax and features. diff --git a/src/test/codegen/default-requires-uwtable.rs b/src/test/codegen/default-requires-uwtable.rs index d4c4200c5d2..5d77d3f14bb 100644 --- a/src/test/codegen/default-requires-uwtable.rs +++ b/src/test/codegen/default-requires-uwtable.rs @@ -1,8 +1,9 @@ // revisions: WINDOWS ANDROID -// needs-llvm-components: x86 arm // compile-flags: -C panic=abort // [WINDOWS] compile-flags: --target=x86_64-pc-windows-msvc +// [WINDOWS] needs-llvm-components: x86 // [ANDROID] compile-flags: --target=armv7-linux-androideabi +// [ANDROID] needs-llvm-components: arm #![feature(no_core, lang_items)] #![crate_type = "lib"] diff --git a/src/test/codegen/i686-macosx-deployment-target.rs b/src/test/codegen/i686-macosx-deployment-target.rs index dad376d6677..17258a264a5 100644 --- a/src/test/codegen/i686-macosx-deployment-target.rs +++ b/src/test/codegen/i686-macosx-deployment-target.rs @@ -3,6 +3,7 @@ // See issue #60235. // compile-flags: -O --target=i686-apple-darwin --crate-type=rlib +// needs-llvm-components: x86 // rustc-env:MACOSX_DEPLOYMENT_TARGET=10.9 #![feature(no_core, lang_items)] #![no_core] diff --git a/src/test/codegen/i686-no-macosx-deployment-target.rs b/src/test/codegen/i686-no-macosx-deployment-target.rs index 1cebc49236f..043040a95e3 100644 --- a/src/test/codegen/i686-no-macosx-deployment-target.rs +++ b/src/test/codegen/i686-no-macosx-deployment-target.rs @@ -3,6 +3,7 @@ // See issue #60235. // compile-flags: -O --target=i686-apple-darwin --crate-type=rlib +// needs-llvm-components: x86 // unset-rustc-env:MACOSX_DEPLOYMENT_TARGET #![feature(no_core, lang_items)] #![no_core] diff --git a/src/test/codegen/sparc-struct-abi.rs b/src/test/codegen/sparc-struct-abi.rs index 78e5b14a212..f228d7c5500 100644 --- a/src/test/codegen/sparc-struct-abi.rs +++ b/src/test/codegen/sparc-struct-abi.rs @@ -1,9 +1,8 @@ -// // Checks that we correctly codegen extern "C" functions returning structs. // See issue #52638. -// only-sparc64 // compile-flags: -O --target=sparc64-unknown-linux-gnu --crate-type=rlib +// needs-llvm-components: sparc #![feature(no_core, lang_items)] #![no_core] diff --git a/src/test/codegen/x86_64-macosx-deployment-target.rs b/src/test/codegen/x86_64-macosx-deployment-target.rs index 8e291b7b298..8e673d11d98 100644 --- a/src/test/codegen/x86_64-macosx-deployment-target.rs +++ b/src/test/codegen/x86_64-macosx-deployment-target.rs @@ -3,6 +3,7 @@ // See issue #60235. // compile-flags: -O --target=x86_64-apple-darwin --crate-type=rlib +// needs-llvm-components: x86 // rustc-env:MACOSX_DEPLOYMENT_TARGET=10.9 #![feature(no_core, lang_items)] #![no_core] diff --git a/src/test/codegen/x86_64-no-macosx-deployment-target.rs b/src/test/codegen/x86_64-no-macosx-deployment-target.rs index c5ac73b54e1..25ae6924de0 100644 --- a/src/test/codegen/x86_64-no-macosx-deployment-target.rs +++ b/src/test/codegen/x86_64-no-macosx-deployment-target.rs @@ -3,6 +3,7 @@ // See issue #60235. // compile-flags: -O --target=x86_64-apple-darwin --crate-type=rlib +// needs-llvm-components: x86 // unset-rustc-env:MACOSX_DEPLOYMENT_TARGET #![feature(no_core, lang_items)] #![no_core] diff --git a/src/test/ui/asm/inline-syntax.rs b/src/test/ui/asm/inline-syntax.rs index 2d54ef7bd6b..481990398f4 100644 --- a/src/test/ui/asm/inline-syntax.rs +++ b/src/test/ui/asm/inline-syntax.rs @@ -1,11 +1,13 @@ -// needs-llvm-components: arm // revisions: x86_64 arm //[x86_64] compile-flags: --target x86_64-unknown-linux-gnu //[x86_64] check-pass +//[x86_64] needs-llvm-components: x86 //[x86_64_allowed] compile-flags: --target x86_64-unknown-linux-gnu //[x86_64_allowed] check-pass +//[x86_64_allowed] needs-llvm-components: x86 //[arm] compile-flags: --target armv7-unknown-linux-gnueabihf //[arm] build-fail +//[arm] needs-llvm-components: arm #![feature(no_core, lang_items, rustc_attrs)] #![crate_type = "rlib"] diff --git a/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/params-on-registers.rs b/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/params-on-registers.rs index b09ea06c8f3..247efc055d9 100644 --- a/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/params-on-registers.rs +++ b/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/params-on-registers.rs @@ -1,6 +1,6 @@ // build-pass // compile-flags: --target thumbv8m.main-none-eabi --crate-type lib -// only-thumbv8m.main-none-eabi +// needs-llvm-components: arm #![feature(abi_c_cmse_nonsecure_call)] #![no_std] diff --git a/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/params-on-stack.rs b/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/params-on-stack.rs index cfdce4f4e92..52c0e3a2165 100644 --- a/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/params-on-stack.rs +++ b/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/params-on-stack.rs @@ -1,7 +1,16 @@ // compile-flags: --target thumbv8m.main-none-eabi --crate-type lib -// only-thumbv8m.main-none-eabi -#![feature(abi_c_cmse_nonsecure_call)] -#![no_std] +// needs-llvm-components: arm +// min-llvm-version: 11.0 +#![feature(abi_c_cmse_nonsecure_call, no_core, lang_items, intrinsics)] +#![no_core] +#[lang="sized"] +pub trait Sized { } +#[lang="copy"] +pub trait Copy { } + +extern "rust-intrinsic" { + pub fn transmute(e: T) -> U; +} #[no_mangle] pub fn test(a: u32, b: u32, c: u32, d: u32, e: u32) -> u32 { diff --git a/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-1.rs b/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-1.rs index 17117301fef..a838d34a118 100644 --- a/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-1.rs +++ b/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-1.rs @@ -1,5 +1,5 @@ // compile-flags: --target thumbv8m.main-none-eabi --crate-type lib -// only-thumbv8m.main-none-eabi +// needs-llvm-components: arm #![feature(abi_c_cmse_nonsecure_call)] #![no_std] diff --git a/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-2.rs b/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-2.rs index 78f553d747c..15bb618f6ad 100644 --- a/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-2.rs +++ b/src/test/ui/cmse-nonsecure/cmse-nonsecure-call/wrong-abi-location-2.rs @@ -1,5 +1,5 @@ // compile-flags: --target thumbv8m.main-none-eabi --crate-type lib -// only-thumbv8m.main-none-eabi +// needs-llvm-components: arm #![feature(abi_c_cmse_nonsecure_call)] #![no_std] diff --git a/src/test/ui/cmse-nonsecure/cmse-nonsecure-entry/params-on-registers.rs b/src/test/ui/cmse-nonsecure/cmse-nonsecure-entry/params-on-registers.rs index a723eb73473..866f5416ad4 100644 --- a/src/test/ui/cmse-nonsecure/cmse-nonsecure-entry/params-on-registers.rs +++ b/src/test/ui/cmse-nonsecure/cmse-nonsecure-entry/params-on-registers.rs @@ -1,6 +1,6 @@ // build-pass // compile-flags: --target thumbv8m.main-none-eabi --crate-type lib -// only-thumbv8m.main-none-eabi +// needs-llvm-components: arm #![feature(cmse_nonsecure_entry)] #![no_std] diff --git a/src/test/ui/cmse-nonsecure/cmse-nonsecure-entry/params-on-stack.rs b/src/test/ui/cmse-nonsecure/cmse-nonsecure-entry/params-on-stack.rs index 553d3a8cb0b..b01031f035e 100644 --- a/src/test/ui/cmse-nonsecure/cmse-nonsecure-entry/params-on-stack.rs +++ b/src/test/ui/cmse-nonsecure/cmse-nonsecure-entry/params-on-stack.rs @@ -1,10 +1,15 @@ // compile-flags: --target thumbv8m.main-none-eabi --crate-type lib -// only-thumbv8m.main-none-eabi -#![feature(cmse_nonsecure_entry)] -#![no_std] +// needs-llvm-components: arm +// min-llvm-version: 11.0 +#![feature(cmse_nonsecure_entry, no_core, lang_items)] +#![no_core] +#[lang="sized"] +trait Sized { } +#[lang="copy"] +trait Copy { } #[no_mangle] #[cmse_nonsecure_entry] -pub extern "C" fn entry_function(a: u32, b: u32, c: u32, d: u32, e: u32) -> u32 { //~ ERROR - a + b + c + d + e +pub extern "C" fn entry_function(_: u32, _: u32, _: u32, _: u32, e: u32) -> u32 { + e } diff --git a/src/test/ui/cmse-nonsecure/cmse-nonsecure-entry/wrong-abi.rs b/src/test/ui/cmse-nonsecure/cmse-nonsecure-entry/wrong-abi.rs index 611c8643dcb..da8abe77777 100644 --- a/src/test/ui/cmse-nonsecure/cmse-nonsecure-entry/wrong-abi.rs +++ b/src/test/ui/cmse-nonsecure/cmse-nonsecure-entry/wrong-abi.rs @@ -1,5 +1,5 @@ // compile-flags: --target thumbv8m.main-none-eabi --crate-type lib -// only-thumbv8m.main-none-eabi +// needs-llvm-components: arm #![feature(cmse_nonsecure_entry)] #![no_std] diff --git a/src/test/ui/crate-loading/missing-std.rs b/src/test/ui/crate-loading/missing-std.rs index 442a7c01e5a..de4ccc18560 100644 --- a/src/test/ui/crate-loading/missing-std.rs +++ b/src/test/ui/crate-loading/missing-std.rs @@ -1,4 +1,5 @@ // compile-flags: --target x86_64-unknown-uefi +// needs-llvm-components: x86 // rustc-env:CARGO=/usr/bin/cargo // rustc-env:RUSTUP_HOME=/home/bors/.rustup #![no_core] diff --git a/src/test/ui/sanitize/crt-static.rs b/src/test/ui/sanitize/crt-static.rs index f5dd2a40cc4..7a6b9eda3fa 100644 --- a/src/test/ui/sanitize/crt-static.rs +++ b/src/test/ui/sanitize/crt-static.rs @@ -1,4 +1,5 @@ // compile-flags: -Z sanitizer=address -C target-feature=+crt-static --target x86_64-unknown-linux-gnu +// needs-llvm-components: x86 #![feature(no_core)] #![no_core] diff --git a/src/test/ui/sanitize/incompatible.rs b/src/test/ui/sanitize/incompatible.rs index 4947f3b3d8b..bcafc2891fd 100644 --- a/src/test/ui/sanitize/incompatible.rs +++ b/src/test/ui/sanitize/incompatible.rs @@ -1,4 +1,5 @@ // compile-flags: -Z sanitizer=address -Z sanitizer=memory --target x86_64-unknown-linux-gnu +// needs-llvm-components: x86 // error-pattern: error: `-Zsanitizer=address` is incompatible with `-Zsanitizer=memory` #![feature(no_core)] diff --git a/src/test/ui/sanitize/unsupported-target.rs b/src/test/ui/sanitize/unsupported-target.rs index 3fb749815f7..9f29c76353b 100644 --- a/src/test/ui/sanitize/unsupported-target.rs +++ b/src/test/ui/sanitize/unsupported-target.rs @@ -1,4 +1,5 @@ // compile-flags: -Z sanitizer=leak --target i686-unknown-linux-gnu +// needs-llvm-components: x86 // error-pattern: error: leak sanitizer is not supported for this target #![feature(no_core)] #![no_core]