Skip to content

Commit 8bab3be

Browse files
author
The rustc-josh-sync Cronjob Bot
committed
Merge ref 'f53b654a8882' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: rust-lang/rust@f53b654 Filtered ref: 854e053 Upstream diff: rust-lang/rust@ca9a134...f53b654 This merge was created using https://github.com/rust-lang/josh-sync.
2 parents 9a4f64b + 854e053 commit 8bab3be

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

src/tests/compiletest.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,17 @@ See also the [codegen tests](#codegen-tests) for a similar set of tests.
346346
If you need to work with `#![no_std]` cross-compiling tests, consult the
347347
[`minicore` test auxiliary](./minicore.md) chapter.
348348

349+
#### Conditional assembly tests based on instruction support
350+
351+
Tests that depend on specific assembly instructions being available can use the
352+
`//@ needs-asm-mnemonic: <MNEMONIC>` directive. This will skip the test if the
353+
target backend does not support the specified instruction mnemonic.
354+
355+
For example, a test that requires the `RET` instruction:
356+
```rust,ignore
357+
//@ needs-asm-mnemonic: RET
358+
```
359+
349360
[`tests/assembly-llvm`]: https://github.com/rust-lang/rust/tree/HEAD/tests/assembly-llvm
350361

351362

src/tests/directives.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ The following directives will check rustc build settings and target settings:
163163
For tests that cross-compile to explicit targets
164164
via `--target`, use `needs-llvm-components` instead to ensure the appropriate
165165
backend is available.
166+
- `needs-asm-mnemonic: <MNEMONIC>` — ignores if the target backend does not
167+
support the specified assembly mnemonic (e.g., `RET`, `NOP`).
168+
Only supported with the LLVM backend.
166169
- `needs-profiler-runtime` — ignores the test if the profiler runtime was not
167170
enabled for the target (`build.profiler = true` in `bootstrap.toml`)
168171
- `needs-sanitizer-support` — ignores if the sanitizer support was not enabled

0 commit comments

Comments
 (0)