Skip to content

Commit a7a1618

Browse files
committed
Auto merge of #144249 - GuillaumeGomez:asm-tests, r=jieyouxu
Rename `tests/{assembly,codegen}` into `tests/{assembly,codegen}-llvm` and ignore these testsuites if configured backend doesn't match Follow-up of #144125. This PR changes `compiletest` so that `asm` tests are only run if they match the current codegen backend. To better reflect it, I renamed the `tests/ui/asm` folder into `tests/ui/asm-llvm`. Like that, we can add new asm tests for other backends if we want without needing to add extra code to `compiletest`. Next step will be to use the new code annotations added in #144125 to ignore ui tests failing in cg_gcc until it's fixed on our side. cc `@antoyo` `@oli-obk` r? `@Kobzol`
2 parents 2e53675 + 6bfa008 commit a7a1618

File tree

793 files changed

+83
-56
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

793 files changed

+83
-56
lines changed

compiler/rustc_codegen_gcc/build_system/src/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ fn asm_tests(env: &Env, args: &TestArg) -> Result<(), String> {
588588
&"always",
589589
&"--stage",
590590
&"0",
591-
&"tests/assembly/asm",
591+
&"tests/assembly-llvm/asm",
592592
&"--compiletest-rustc-args",
593593
&rustc_args,
594594
],

compiler/rustc_codegen_ssa/src/mir/rvalue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
869869
let ltext = bx.zext(is_lt, bx.type_i8());
870870
bx.unchecked_ssub(gtext, ltext)
871871
} else {
872-
// These operations are those expected by `tests/codegen/integer-cmp.rs`,
872+
// These operations are those expected by `tests/codegen-llvm/integer-cmp.rs`,
873873
// from <https://github.com/rust-lang/rust/pull/63767>.
874874
let is_lt = bx.icmp(pred(mir::BinOp::Lt), lhs, rhs);
875875
let is_ne = bx.icmp(pred(mir::BinOp::Ne), lhs, rhs);

compiler/rustc_mir_transform/src/unreachable_prop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ fn remove_successors_from_switch<'tcx>(
7575
let is_unreachable = |bb| unreachable_blocks.contains(&bb);
7676

7777
// If there are multiple targets, we want to keep information about reachability for codegen.
78-
// For example (see tests/codegen/match-optimizes-away.rs)
78+
// For example (see tests/codegen-llvm/match-optimizes-away.rs)
7979
//
8080
// pub enum Two { A, B }
8181
// pub fn identity(x: Two) -> Two {

library/alloc/src/collections/vec_deque/drain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl<T, A: Allocator> Drop for Drain<'_, T, A> {
192192
// this branch is never taken.
193193
// We use `#[cold]` instead of `#[inline(never)]`, because inlining this
194194
// function into the general case (`.drain(n..m)`) is fine.
195-
// See `tests/codegen/vecdeque-drain.rs` for a test.
195+
// See `tests/codegen-llvm/vecdeque-drain.rs` for a test.
196196
#[cold]
197197
fn join_head_and_tail_wrapping<T, A: Allocator>(
198198
source_deque: &mut VecDeque<T, A>,

library/alloc/src/raw_vec/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ impl<A: Allocator> RawVecInner<A> {
761761
}
762762

763763
// not marked inline(never) since we want optimizers to be able to observe the specifics of this
764-
// function, see tests/codegen/vec-reserve-extend.rs.
764+
// function, see tests/codegen-llvm/vec-reserve-extend.rs.
765765
#[cold]
766766
fn finish_grow<A>(
767767
new_layout: Layout,

rustfmt.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ignore = [
1414
"/vendor/",
1515

1616
# Some tests are not formatted, for various reasons.
17-
"/tests/codegen/simd-intrinsic/", # Many types like `u8x64` are better hand-formatted.
17+
"/tests/codegen-llvm/simd-intrinsic/", # Many types like `u8x64` are better hand-formatted.
1818
"/tests/crashes/", # Many of these tests contain syntax errors.
1919
"/tests/debuginfo/", # These tests are somewhat sensitive to source code layout.
2020
"/tests/incremental/", # These tests are somewhat sensitive to source code layout.
@@ -58,5 +58,5 @@ ignore = [
5858

5959
# Rustfmt doesn't support use closures yet
6060
"tests/mir-opt/ergonomic-clones/closure.rs",
61-
"tests/codegen/ergonomic-clones/closure.rs",
61+
"tests/codegen-llvm/ergonomic-clones/closure.rs",
6262
]

src/bootstrap/src/core/build_steps/test.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,12 @@ test!(Ui { path: "tests/ui", mode: "ui", suite: "ui", default: true });
13421342

13431343
test!(Crashes { path: "tests/crashes", mode: "crashes", suite: "crashes", default: true });
13441344

1345-
test!(Codegen { path: "tests/codegen", mode: "codegen", suite: "codegen", default: true });
1345+
test!(CodegenLlvm {
1346+
path: "tests/codegen-llvm",
1347+
mode: "codegen",
1348+
suite: "codegen-llvm",
1349+
default: true
1350+
});
13461351

13471352
test!(CodegenUnits {
13481353
path: "tests/codegen-units",
@@ -1407,7 +1412,12 @@ test!(Pretty {
14071412

14081413
test!(RunMake { path: "tests/run-make", mode: "run-make", suite: "run-make", default: true });
14091414

1410-
test!(Assembly { path: "tests/assembly", mode: "assembly", suite: "assembly", default: true });
1415+
test!(AssemblyLlvm {
1416+
path: "tests/assembly-llvm",
1417+
mode: "assembly",
1418+
suite: "assembly-llvm",
1419+
default: true
1420+
});
14111421

14121422
/// Runs the coverage test suite at `tests/coverage` in some or all of the
14131423
/// coverage test modes.
@@ -1615,7 +1625,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
16151625
let suite_path = self.path;
16161626

16171627
// Skip codegen tests if they aren't enabled in configuration.
1618-
if !builder.config.codegen_tests && suite == "codegen" {
1628+
if !builder.config.codegen_tests && mode == "codegen" {
16191629
return;
16201630
}
16211631

@@ -1812,7 +1822,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
18121822
let mut flags = if is_rustdoc { Vec::new() } else { vec!["-Crpath".to_string()] };
18131823
flags.push(format!(
18141824
"-Cdebuginfo={}",
1815-
if suite == "codegen" {
1825+
if mode == "codegen" {
18161826
// codegen tests typically check LLVM IR and are sensitive to additional debuginfo.
18171827
// So do not apply `rust.debuginfo-level-tests` for codegen tests.
18181828
if builder.config.rust_debuginfo_level_tests

src/bootstrap/src/core/builder/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,8 @@ const PATH_REMAP: &[(&str, &[&str])] = &[
411411
"tests",
412412
&[
413413
// tidy-alphabetical-start
414-
"tests/assembly",
415-
"tests/codegen",
414+
"tests/assembly-llvm",
415+
"tests/codegen-llvm",
416416
"tests/codegen-units",
417417
"tests/coverage",
418418
"tests/coverage-run-rustdoc",
@@ -1049,9 +1049,9 @@ impl<'a> Builder<'a> {
10491049
test::Crashes,
10501050
test::Coverage,
10511051
test::MirOpt,
1052-
test::Codegen,
1052+
test::CodegenLlvm,
10531053
test::CodegenUnits,
1054-
test::Assembly,
1054+
test::AssemblyLlvm,
10551055
test::Incremental,
10561056
test::Debuginfo,
10571057
test::UiFullDeps,

src/ci/docker/host-x86_64/test-various/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ ENV WASM_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $WASM_T
6565
tests/ui \
6666
tests/mir-opt \
6767
tests/codegen-units \
68-
tests/codegen \
69-
tests/assembly \
68+
tests/codegen-llvm \
69+
tests/assembly-llvm \
7070
library/core
7171

7272
ENV NVPTX_TARGETS=nvptx64-nvidia-cuda
7373
ENV NVPTX_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $NVPTX_TARGETS \
7474
tests/run-make \
75-
tests/assembly
75+
tests/assembly-llvm
7676

7777
ENV MUSL_TARGETS=x86_64-unknown-linux-musl \
7878
CC_x86_64_unknown_linux_musl=x86_64-linux-musl-gcc \

src/doc/rustc-dev-guide/src/asm.md

Lines changed: 3 additions & 3 deletions

0 commit comments

Comments
 (0)