File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -346,6 +346,17 @@ See also the [codegen tests](#codegen-tests) for a similar set of tests.
346346If 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments