Skip to content

Commit 3914c53

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 rust-lang/rust#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 rust-lang/rust#144125 to ignore ui tests failing in cg_gcc until it's fixed on our side. cc `@antoyo` `@oli-obk` r? `@Kobzol`
2 parents a2288c4 + 0da1244 commit 3914c53

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

src/asm.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ can't know ahead of time whether a function will require a frame/base pointer.
155155

156156
Various tests for inline assembly are available:
157157

158-
- `tests/assembly/asm`
158+
- `tests/assembly-llvm/asm`
159159
- `tests/ui/asm`
160-
- `tests/codegen/asm-*`
160+
- `tests/codegen-llvm/asm-*`
161161

162162
Every architecture supported by inline assembly must have exhaustive tests in
163-
`tests/assembly/asm` which test all combinations of register classes and types.
163+
`tests/assembly-llvm/asm` which test all combinations of register classes and types.

src/autodiff/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ rustup toolchain install nightly # enables -Z unstable-options
2525
You can then run our test cases:
2626

2727
```bash
28-
./x test --stage 1 tests/codegen/autodiff
28+
./x test --stage 1 tests/codegen-llvm/autodiff
2929
./x test --stage 1 tests/pretty/autodiff
3030
./x test --stage 1 tests/ui/autodiff
3131
./x test --stage 1 tests/ui/feature-gates/feature-gate-autodiff.rs

src/llvm-coverage-instrumentation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ human-readable coverage report.
117117
> directive, so they will be skipped if the profiler runtime has not been
118118
> [enabled in `bootstrap.toml`](#recommended-configtoml-settings).
119119
120-
Finally, the [`tests/codegen/instrument-coverage/testprog.rs`] test compiles a simple Rust program
120+
Finally, the [`tests/codegen-llvm/instrument-coverage/testprog.rs`] test compiles a simple Rust program
121121
with `-C instrument-coverage` and compares the compiled program's LLVM IR to
122122
expected LLVM IR instructions and structured data for a coverage-enabled
123123
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:
136136
[`tests/coverage`]: https://github.com/rust-lang/rust/tree/master/tests/coverage
137137
[`src/tools/coverage-dump`]: https://github.com/rust-lang/rust/tree/master/src/tools/coverage-dump
138138
[`tests/coverage-run-rustdoc`]: https://github.com/rust-lang/rust/tree/master/tests/coverage-run-rustdoc
139-
[`tests/codegen/instrument-coverage/testprog.rs`]: https://github.com/rust-lang/rust/blob/master/tests/mir-opt/coverage/instrument_coverage.rs
139+
[`tests/codegen-llvm/instrument-coverage/testprog.rs`]: https://github.com/rust-lang/rust/blob/master/tests/mir-opt/coverage/instrument_coverage.rs

src/offload/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This gives you a working LLVM build.
4040
## Testing
4141
run
4242
```
43-
./x test --stage 1 tests/codegen/gpu_offload
43+
./x test --stage 1 tests/codegen-llvm/gpu_offload
4444
```
4545

4646
## Usage

src/profile-guided-optimization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ There is also a [codegen test][codegen-test] that checks that some expected
132132
instrumentation artifacts show up in LLVM IR.
133133

134134
[rmake-tests]: https://github.com/rust-lang/rust/tree/master/tests/run-make
135-
[codegen-test]: https://github.com/rust-lang/rust/blob/master/tests/codegen/pgo-instrumentation.rs
135+
[codegen-test]: https://github.com/rust-lang/rust/blob/master/tests/codegen-llvm/pgo-instrumentation.rs
136136

137137
## Additional information
138138

src/sanitizers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ implementation:
7676
## Testing sanitizers
7777

7878
Sanitizers are validated by code generation tests in
79-
[`tests/codegen/sanitize*.rs`][test-cg] and end-to-end functional tests in
79+
[`tests/codegen-llvm/sanitize*.rs`][test-cg] and end-to-end functional tests in
8080
[`tests/ui/sanitizer/`][test-ui] directory.
8181

8282
Testing sanitizer functionality requires the sanitizer runtimes (built when
@@ -85,7 +85,7 @@ sanitizer. When sanitizer is unsupported on given target, sanitizers tests will
8585
be ignored. This behaviour is controlled by compiletest `needs-sanitizer-*`
8686
directives.
8787

88-
[test-cg]: https://github.com/rust-lang/rust/tree/master/tests/codegen
88+
[test-cg]: https://github.com/rust-lang/rust/tree/master/tests/codegen-llvm
8989
[test-ui]: https://github.com/rust-lang/rust/tree/master/tests/ui/sanitizer
9090

9191
## Enabling sanitizer on a new target

src/tests/compiletest.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ The following test suites are available, with links for more information:
6868
| [`pretty`](#pretty-printer-tests) | Check pretty printing |
6969
| [`incremental`](#incremental-tests) | Check incremental compilation behavior |
7070
| [`debuginfo`](#debuginfo-tests) | Check debuginfo generation running debuggers |
71-
| [`codegen`](#codegen-tests) | Check code generation |
71+
| [`codegen-*`](#codegen-tests) | Check code generation |
7272
| [`codegen-units`](#codegen-units-tests) | Check codegen unit partitioning |
7373
| [`assembly`](#assembly-tests) | Check assembly output |
7474
| [`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
290290
291291
### Codegen tests
292292

293-
The tests in [`tests/codegen`] test LLVM code generation. They compile the test
293+
The tests in [`tests/codegen-llvm`] test LLVM code generation. They compile the test
294294
with the `--emit=llvm-ir` flag to emit LLVM IR. They then run the LLVM
295295
[FileCheck] tool. The test is annotated with various `// CHECK` comments to
296296
check the generated code. See the [FileCheck] documentation for a tutorial and
@@ -301,13 +301,13 @@ See also the [assembly tests](#assembly-tests) for a similar set of tests.
301301
If you need to work with `#![no_std]` cross-compiling tests, consult the
302302
[`minicore` test auxiliary](./minicore.md) chapter.
303303

304-
[`tests/codegen`]: https://github.com/rust-lang/rust/tree/master/tests/codegen
304+
[`tests/codegen-llvm`]: https://github.com/rust-lang/rust/tree/master/tests/codegen-llvm
305305
[FileCheck]: https://llvm.org/docs/CommandGuide/FileCheck.html
306306

307307

308308
### Assembly tests
309309

310-
The tests in [`tests/assembly`] test LLVM assembly output. They compile the test
310+
The tests in [`tests/assembly-llvm`] test LLVM assembly output. They compile the test
311311
with the `--emit=asm` flag to emit a `.s` file with the assembly output. They
312312
then run the LLVM [FileCheck] tool.
313313

@@ -324,7 +324,7 @@ See also the [codegen tests](#codegen-tests) for a similar set of tests.
324324
If you need to work with `#![no_std]` cross-compiling tests, consult the
325325
[`minicore` test auxiliary](./minicore.md) chapter.
326326

327-
[`tests/assembly`]: https://github.com/rust-lang/rust/tree/master/tests/assembly
327+
[`tests/assembly-llvm`]: https://github.com/rust-lang/rust/tree/master/tests/assembly-llvm
328328

329329

330330
### Codegen-units tests

0 commit comments

Comments
 (0)