Skip to content

Commit beaf9d1

Browse files
committed
tests/run-make: add missing needs-llvm-components
Without suitable `needs-llvm-components` directives, these tests that rely on target-specific codegen can fail if used with a LLVM that is built without the required components.
1 parent 92b1081 commit beaf9d1

File tree

4 files changed

+32
-11
lines changed

4 files changed

+32
-11
lines changed

tests/run-make/print-cfg/rmake.rs

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
//!
66
//! It also checks that some targets have the correct set cfgs.
77
8+
// ignore-tidy-linelength
9+
//@ needs-llvm-components: arm x86
10+
// Note: without the needs-llvm-components it will fail on LLVM built without the required
11+
// components listed above.
12+
813
use std::collections::HashSet;
914
use std::iter::FromIterator;
1015
use std::path::PathBuf;

tests/run-make/print-target-list/rmake.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
// Checks that all the targets returned by `rustc --print target-list` are valid
2-
// target specifications
1+
// Checks that all the targets returned by `rustc --print target-list` are valid target
2+
// specifications.
3+
4+
// ignore-tidy-linelength
5+
//@ needs-llvm-components: aarch64 arm avr bpf csky hexagon loongarch m68k mips msp430 nvptx powerpc riscv sparc systemz webassembly x86
6+
// FIXME(jieyouxu): there has to be a better way to do this, without the needs-llvm-components it
7+
// will fail on LLVM built without all of the components listed above.
38

49
use run_make_support::bare_rustc;
510

6-
// FIXME(127877): certain experimental targets fail with creating a 'LLVM TargetMachine'
7-
// in CI, so we skip them
11+
// FIXME(#127877): certain experimental targets fail with creating a 'LLVM TargetMachine' in CI, so
12+
// we skip them.
813
const EXPERIMENTAL_TARGETS: &[&str] = &["avr", "m68k", "csky", "xtensa"];
914

1015
fn main() {

tests/run-make/print-to-output/rmake.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
//! This checks the output of some `--print` options when
2-
//! output to a file (instead of stdout)
1+
//! This checks the output of some `--print` options when output to a file (instead of stdout)
2+
3+
// ignore-tidy-linelength
4+
//@ needs-llvm-components: aarch64 arm avr bpf csky hexagon loongarch m68k mips msp430 nvptx powerpc riscv sparc systemz webassembly x86
5+
// FIXME(jieyouxu): there has to be a better way to do this, without the needs-llvm-components it
6+
// will fail on LLVM built without all of the components listed above. If adding a new target that
7+
// relies on a llvm component not listed above, it will need to be added to the required llvm
8+
// components above.
39

410
use std::path::PathBuf;
511

tests/run-make/target-without-atomic-cas/rmake.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
// ARM Cortex-M are a class of processors supported by the rust compiler. However,
2-
// they cannot support any atomic features, such as Arc. This test simply prints
3-
// the configuration details of one Cortex target, and checks that the compiler
4-
// does not falsely list atomic support.
5-
// See https://github.com/rust-lang/rust/pull/36874
1+
// ARM Cortex-M are a class of processors supported by the rust compiler. However, they cannot
2+
// support any atomic features, such as Arc. This test simply prints the configuration details of
3+
// one Cortex target, and checks that the compiler does not falsely list atomic support.
4+
// See <https://github.com/rust-lang/rust/pull/36874>.
5+
6+
// ignore-tidy-linelength
7+
//@ needs-llvm-components: arm
8+
// Note: without the needs-llvm-components it will fail on LLVM built without all of the components
9+
// listed above. If any new targets are added, please double-check their respective llvm components
10+
// are specified above.
611

712
use run_make_support::rustc;
813

0 commit comments

Comments
 (0)