Skip to content

Commit 854e053

Browse files
committed
Auto merge of #155941 - JonathanBrouwer:rollup-Ak66iXR, r=JonathanBrouwer
Rollup of 15 pull requests Successful merges: - rust-lang/rust#155923 (Subtree sync for rustc_codegen_cranelift) - rust-lang/rust#155930 (Sync from portable simd 2026 04 28) - rust-lang/rust#155850 (Only exclude the rust-lang/rust#155473 change for 1-byte bool-likes) - rust-lang/rust#151994 (switch to v0 mangling by default on stable) - rust-lang/rust#154325 (Tweak irrefutable let else warning output) - rust-lang/rust#155273 (Lock stable_crate_ids once in create_crate_num) - rust-lang/rust#155361 (Document that CFI diverges from Rust wrt. ABI-compatibility rules) - rust-lang/rust#155692 (disable naked-dead-code-elimination test if no RET mnemonic is available) - rust-lang/rust#155747 (Update documentation for `wasm32-wali-linux-musl` after integrating n…) - rust-lang/rust#155768 (compiletest: Overhaul the code for running an incremental test revision) - rust-lang/rust#155907 (Handle hkl const closures) - rust-lang/rust#155910 (misc stuff from reading borrowck again :)) - rust-lang/rust#155913 (Delete the 12 year old fixme) - rust-lang/rust#155920 (remove review queue triagebot mentions) - rust-lang/rust#155936 (Rename `SharedContext::emit_dyn_lint*` into `emit_lint*`)
2 parents 49cdb3d + 310d1d8 commit 854e053

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)