Rename tests/codegen into tests/codegen-llvm

This commit is contained in:
Guillaume Gomez
2025-07-21 14:34:12 +02:00
parent ed93c1783b
commit a27f3e3fd1
676 changed files with 41 additions and 36 deletions

View File

@@ -869,7 +869,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
let ltext = bx.zext(is_lt, bx.type_i8()); let ltext = bx.zext(is_lt, bx.type_i8());
bx.unchecked_ssub(gtext, ltext) bx.unchecked_ssub(gtext, ltext)
} else { } else {
// These operations are those expected by `tests/codegen/integer-cmp.rs`, // These operations are those expected by `tests/codegen-llvm/integer-cmp.rs`,
// from <https://github.com/rust-lang/rust/pull/63767>. // from <https://github.com/rust-lang/rust/pull/63767>.
let is_lt = bx.icmp(pred(mir::BinOp::Lt), lhs, rhs); let is_lt = bx.icmp(pred(mir::BinOp::Lt), lhs, rhs);
let is_ne = bx.icmp(pred(mir::BinOp::Ne), lhs, rhs); let is_ne = bx.icmp(pred(mir::BinOp::Ne), lhs, rhs);

View File

@@ -75,7 +75,7 @@ fn remove_successors_from_switch<'tcx>(
let is_unreachable = |bb| unreachable_blocks.contains(&bb); let is_unreachable = |bb| unreachable_blocks.contains(&bb);
// If there are multiple targets, we want to keep information about reachability for codegen. // If there are multiple targets, we want to keep information about reachability for codegen.
// For example (see tests/codegen/match-optimizes-away.rs) // For example (see tests/codegen-llvm/match-optimizes-away.rs)
// //
// pub enum Two { A, B } // pub enum Two { A, B }
// pub fn identity(x: Two) -> Two { // pub fn identity(x: Two) -> Two {

View File

@@ -192,7 +192,7 @@ impl<T, A: Allocator> Drop for Drain<'_, T, A> {
// this branch is never taken. // this branch is never taken.
// We use `#[cold]` instead of `#[inline(never)]`, because inlining this // We use `#[cold]` instead of `#[inline(never)]`, because inlining this
// function into the general case (`.drain(n..m)`) is fine. // function into the general case (`.drain(n..m)`) is fine.
// See `tests/codegen/vecdeque-drain.rs` for a test. // See `tests/codegen-llvm/vecdeque-drain.rs` for a test.
#[cold] #[cold]
fn join_head_and_tail_wrapping<T, A: Allocator>( fn join_head_and_tail_wrapping<T, A: Allocator>(
source_deque: &mut VecDeque<T, A>, source_deque: &mut VecDeque<T, A>,

View File

@@ -761,7 +761,7 @@ impl<A: Allocator> RawVecInner<A> {
} }
// not marked inline(never) since we want optimizers to be able to observe the specifics of this // not marked inline(never) since we want optimizers to be able to observe the specifics of this
// function, see tests/codegen/vec-reserve-extend.rs. // function, see tests/codegen-llvm/vec-reserve-extend.rs.
#[cold] #[cold]
fn finish_grow<A>( fn finish_grow<A>(
new_layout: Layout, new_layout: Layout,

View File

@@ -14,7 +14,7 @@ ignore = [
"/vendor/", "/vendor/",
# Some tests are not formatted, for various reasons. # Some tests are not formatted, for various reasons.
"/tests/codegen/simd-intrinsic/", # Many types like `u8x64` are better hand-formatted. "/tests/codegen-llvm/simd-intrinsic/", # Many types like `u8x64` are better hand-formatted.
"/tests/crashes/", # Many of these tests contain syntax errors. "/tests/crashes/", # Many of these tests contain syntax errors.
"/tests/debuginfo/", # These tests are somewhat sensitive to source code layout. "/tests/debuginfo/", # These tests are somewhat sensitive to source code layout.
"/tests/incremental/", # These tests are somewhat sensitive to source code layout. "/tests/incremental/", # These tests are somewhat sensitive to source code layout.
@@ -58,5 +58,5 @@ ignore = [
# Rustfmt doesn't support use closures yet # Rustfmt doesn't support use closures yet
"tests/mir-opt/ergonomic-clones/closure.rs", "tests/mir-opt/ergonomic-clones/closure.rs",
"tests/codegen/ergonomic-clones/closure.rs", "tests/codegen-llvm/ergonomic-clones/closure.rs",
] ]

View File

@@ -1342,7 +1342,12 @@ test!(Ui { path: "tests/ui", mode: "ui", suite: "ui", default: true });
test!(Crashes { path: "tests/crashes", mode: "crashes", suite: "crashes", default: true }); test!(Crashes { path: "tests/crashes", mode: "crashes", suite: "crashes", default: true });
test!(Codegen { path: "tests/codegen", mode: "codegen", suite: "codegen", default: true }); test!(CodegenLlvm {
path: "tests/codegen-llvm",
mode: "codegen",
suite: "codegen-llvm",
default: true
});
test!(CodegenUnits { test!(CodegenUnits {
path: "tests/codegen-units", path: "tests/codegen-units",
@@ -1620,7 +1625,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
let suite_path = self.path; let suite_path = self.path;
// Skip codegen tests if they aren't enabled in configuration. // Skip codegen tests if they aren't enabled in configuration.
if !builder.config.codegen_tests && suite == "codegen" { if !builder.config.codegen_tests && mode == "codegen" {
return; return;
} }
@@ -1817,7 +1822,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
let mut flags = if is_rustdoc { Vec::new() } else { vec!["-Crpath".to_string()] }; let mut flags = if is_rustdoc { Vec::new() } else { vec!["-Crpath".to_string()] };
flags.push(format!( flags.push(format!(
"-Cdebuginfo={}", "-Cdebuginfo={}",
if suite == "codegen" { if mode == "codegen" {
// codegen tests typically check LLVM IR and are sensitive to additional debuginfo. // codegen tests typically check LLVM IR and are sensitive to additional debuginfo.
// So do not apply `rust.debuginfo-level-tests` for codegen tests. // So do not apply `rust.debuginfo-level-tests` for codegen tests.
if builder.config.rust_debuginfo_level_tests if builder.config.rust_debuginfo_level_tests

View File

@@ -412,7 +412,7 @@ const PATH_REMAP: &[(&str, &[&str])] = &[
&[ &[
// tidy-alphabetical-start // tidy-alphabetical-start
"tests/assembly-llvm", "tests/assembly-llvm",
"tests/codegen", "tests/codegen-llvm",
"tests/codegen-units", "tests/codegen-units",
"tests/coverage", "tests/coverage",
"tests/coverage-run-rustdoc", "tests/coverage-run-rustdoc",
@@ -1049,7 +1049,7 @@ impl<'a> Builder<'a> {
test::Crashes, test::Crashes,
test::Coverage, test::Coverage,
test::MirOpt, test::MirOpt,
test::Codegen, test::CodegenLlvm,
test::CodegenUnits, test::CodegenUnits,
test::AssemblyLlvm, test::AssemblyLlvm,
test::Incremental, test::Incremental,

View File

@@ -65,7 +65,7 @@ ENV WASM_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $WASM_T
tests/ui \ tests/ui \
tests/mir-opt \ tests/mir-opt \
tests/codegen-units \ tests/codegen-units \
tests/codegen \ tests/codegen-llvm \
tests/assembly-llvm \ tests/assembly-llvm \
library/core library/core

View File

@@ -157,7 +157,7 @@ Various tests for inline assembly are available:
- `tests/assembly-llvm/asm` - `tests/assembly-llvm/asm`
- `tests/ui/asm` - `tests/ui/asm`
- `tests/codegen/asm-*` - `tests/codegen-llvm/asm-*`
Every architecture supported by inline assembly must have exhaustive tests in Every architecture supported by inline assembly must have exhaustive tests in
`tests/assembly-llvm/asm` which test all combinations of register classes and types. `tests/assembly-llvm/asm` which test all combinations of register classes and types.

View File

@@ -25,7 +25,7 @@ rustup toolchain install nightly # enables -Z unstable-options
You can then run our test cases: You can then run our test cases:
```bash ```bash
./x test --stage 1 tests/codegen/autodiff ./x test --stage 1 tests/codegen-llvm/autodiff
./x test --stage 1 tests/pretty/autodiff ./x test --stage 1 tests/pretty/autodiff
./x test --stage 1 tests/ui/autodiff ./x test --stage 1 tests/ui/autodiff
./x test --stage 1 tests/ui/feature-gates/feature-gate-autodiff.rs ./x test --stage 1 tests/ui/feature-gates/feature-gate-autodiff.rs

View File

@@ -117,7 +117,7 @@ human-readable coverage report.
> directive, so they will be skipped if the profiler runtime has not been > directive, so they will be skipped if the profiler runtime has not been
> [enabled in `bootstrap.toml`](#recommended-configtoml-settings). > [enabled in `bootstrap.toml`](#recommended-configtoml-settings).
Finally, the [`tests/codegen/instrument-coverage/testprog.rs`] test compiles a simple Rust program Finally, the [`tests/codegen-llvm/instrument-coverage/testprog.rs`] test compiles a simple Rust program
with `-C instrument-coverage` and compares the compiled program's LLVM IR to with `-C instrument-coverage` and compares the compiled program's LLVM IR to
expected LLVM IR instructions and structured data for a coverage-enabled expected LLVM IR instructions and structured data for a coverage-enabled
program, including various checks for Coverage Map-related metadata and the LLVM program, including various checks for Coverage Map-related metadata and the LLVM
@@ -136,4 +136,4 @@ and `mir-opt` tests can be refreshed by running:
[`tests/coverage`]: https://github.com/rust-lang/rust/tree/master/tests/coverage [`tests/coverage`]: https://github.com/rust-lang/rust/tree/master/tests/coverage
[`src/tools/coverage-dump`]: https://github.com/rust-lang/rust/tree/master/src/tools/coverage-dump [`src/tools/coverage-dump`]: https://github.com/rust-lang/rust/tree/master/src/tools/coverage-dump
[`tests/coverage-run-rustdoc`]: https://github.com/rust-lang/rust/tree/master/tests/coverage-run-rustdoc [`tests/coverage-run-rustdoc`]: https://github.com/rust-lang/rust/tree/master/tests/coverage-run-rustdoc
[`tests/codegen/instrument-coverage/testprog.rs`]: https://github.com/rust-lang/rust/blob/master/tests/mir-opt/coverage/instrument_coverage.rs [`tests/codegen-llvm/instrument-coverage/testprog.rs`]: https://github.com/rust-lang/rust/blob/master/tests/mir-opt/coverage/instrument_coverage.rs

View File

@@ -40,7 +40,7 @@ This gives you a working LLVM build.
## Testing ## Testing
run run
``` ```
./x test --stage 1 tests/codegen/gpu_offload ./x test --stage 1 tests/codegen-llvm/gpu_offload
``` ```
## Usage ## Usage

View File

@@ -132,7 +132,7 @@ There is also a [codegen test][codegen-test] that checks that some expected
instrumentation artifacts show up in LLVM IR. instrumentation artifacts show up in LLVM IR.
[rmake-tests]: https://github.com/rust-lang/rust/tree/master/tests/run-make [rmake-tests]: https://github.com/rust-lang/rust/tree/master/tests/run-make
[codegen-test]: https://github.com/rust-lang/rust/blob/master/tests/codegen/pgo-instrumentation.rs [codegen-test]: https://github.com/rust-lang/rust/blob/master/tests/codegen-llvm/pgo-instrumentation.rs
## Additional information ## Additional information

View File

@@ -76,7 +76,7 @@ implementation:
## Testing sanitizers ## Testing sanitizers
Sanitizers are validated by code generation tests in Sanitizers are validated by code generation tests in
[`tests/codegen/sanitize*.rs`][test-cg] and end-to-end functional tests in [`tests/codegen-llvm/sanitize*.rs`][test-cg] and end-to-end functional tests in
[`tests/ui/sanitizer/`][test-ui] directory. [`tests/ui/sanitizer/`][test-ui] directory.
Testing sanitizer functionality requires the sanitizer runtimes (built when Testing sanitizer functionality requires the sanitizer runtimes (built when
@@ -85,7 +85,7 @@ sanitizer. When sanitizer is unsupported on given target, sanitizers tests will
be ignored. This behaviour is controlled by compiletest `needs-sanitizer-*` be ignored. This behaviour is controlled by compiletest `needs-sanitizer-*`
directives. directives.
[test-cg]: https://github.com/rust-lang/rust/tree/master/tests/codegen [test-cg]: https://github.com/rust-lang/rust/tree/master/tests/codegen-llvm
[test-ui]: https://github.com/rust-lang/rust/tree/master/tests/ui/sanitizer [test-ui]: https://github.com/rust-lang/rust/tree/master/tests/ui/sanitizer
## Enabling sanitizer on a new target ## Enabling sanitizer on a new target

View File

@@ -68,7 +68,7 @@ The following test suites are available, with links for more information:
| [`pretty`](#pretty-printer-tests) | Check pretty printing | | [`pretty`](#pretty-printer-tests) | Check pretty printing |
| [`incremental`](#incremental-tests) | Check incremental compilation behavior | | [`incremental`](#incremental-tests) | Check incremental compilation behavior |
| [`debuginfo`](#debuginfo-tests) | Check debuginfo generation running debuggers | | [`debuginfo`](#debuginfo-tests) | Check debuginfo generation running debuggers |
| [`codegen`](#codegen-tests) | Check code generation | | [`codegen-*`](#codegen-tests) | Check code generation |
| [`codegen-units`](#codegen-units-tests) | Check codegen unit partitioning | | [`codegen-units`](#codegen-units-tests) | Check codegen unit partitioning |
| [`assembly`](#assembly-tests) | Check assembly output | | [`assembly`](#assembly-tests) | Check assembly output |
| [`mir-opt`](#mir-opt-tests) | Check MIR generation and optimizations | | [`mir-opt`](#mir-opt-tests) | Check MIR generation and optimizations |
@@ -290,7 +290,7 @@ For example, `./x test tests/debuginfo -- --debugger gdb` will only test GDB com
### Codegen tests ### Codegen tests
The tests in [`tests/codegen`] test LLVM code generation. They compile the test The tests in [`tests/codegen-llvm`] test LLVM code generation. They compile the test
with the `--emit=llvm-ir` flag to emit LLVM IR. They then run the LLVM with the `--emit=llvm-ir` flag to emit LLVM IR. They then run the LLVM
[FileCheck] tool. The test is annotated with various `// CHECK` comments to [FileCheck] tool. The test is annotated with various `// CHECK` comments to
check the generated code. See the [FileCheck] documentation for a tutorial and check the generated code. See the [FileCheck] documentation for a tutorial and
@@ -301,7 +301,7 @@ See also the [assembly tests](#assembly-tests) for a similar set of tests.
If you need to work with `#![no_std]` cross-compiling tests, consult the If you need to work with `#![no_std]` cross-compiling tests, consult the
[`minicore` test auxiliary](./minicore.md) chapter. [`minicore` test auxiliary](./minicore.md) chapter.
[`tests/codegen`]: https://github.com/rust-lang/rust/tree/master/tests/codegen [`tests/codegen-llvm`]: https://github.com/rust-lang/rust/tree/master/tests/codegen-llvm
[FileCheck]: https://llvm.org/docs/CommandGuide/FileCheck.html [FileCheck]: https://llvm.org/docs/CommandGuide/FileCheck.html

View File

@@ -101,7 +101,7 @@ llvm-config = "{llvm_config}"
"--stage", "--stage",
"0", "0",
"tests/assembly-llvm", "tests/assembly-llvm",
"tests/codegen", "tests/codegen-llvm",
"tests/codegen-units", "tests/codegen-units",
"tests/incremental", "tests/incremental",
"tests/mir-opt", "tests/mir-opt",

View File

@@ -15,7 +15,7 @@
// > LLVM ERROR: Cannot select: 0x7f00f400c010: i32,i32,ch = X86ISD::RDSEED 0x7f00f400bfa8:2 // > LLVM ERROR: Cannot select: 0x7f00f400c010: i32,i32,ch = X86ISD::RDSEED 0x7f00f400bfa8:2
// > In function: foo // > In function: foo
// //
// See also tests/codegen/target-feature-overrides.rs // See also tests/codegen-llvm/target-feature-overrides.rs
#![feature(no_core, lang_items, link_llvm_intrinsics, abi_unadjusted)] #![feature(no_core, lang_items, link_llvm_intrinsics, abi_unadjusted)]
#![crate_type = "lib"] #![crate_type = "lib"]
#![no_core] #![no_core]

Some files were not shown because too many files have changed in this diff Show More