- `needs-unwind` — ignores if the target does not support unwinding
- `needs-rust-lld` — ignores if the rust lld support is not enabled (`rust.lld =
true` in `bootstrap.toml`)
- `needs-threads` — ignores if the target does not have threading support
- `needs-subprocess` — ignores if the target does not have subprocess support
- `needs-symlink` — ignores if the target does not support symlinks. This can be
the case on Windows if the developer did not enable privileged symlink
permissions.
- `ignore-std-debug-assertions` — ignores if std was built with debug
assertions.
- `needs-std-debug-assertions` — ignores if std was not built with debug
assertions.
- `ignore-rustc-debug-assertions` — ignores if rustc was built with debug
assertions.
- `needs-rustc-debug-assertions` — ignores if rustc was not built with debug
assertions.
- `needs-target-has-atomic` — ignores if target does not have support for all
specified atomic widths, e.g. the test with `//@ needs-target-has-atomic: 8,
16, ptr` will only run if it supports the comma-separated list of atomic
widths.
- `needs-dynamic-linking` — ignores if target does not support dynamic linking
(which is orthogonal to it being unable to create `dylib` and `cdylib` crate types)
- `needs-crate-type` — ignores if target platform does not support one or more
of the comma-delimited list of specified crate types. For example,
`//@ needs-crate-type: cdylib, proc-macro` will cause the test to be ignored
on `wasm32-unknown-unknown` target because the target does not support the
`proc-macro` crate type.
The following directives will check LLVM support:
- `exact-llvm-major-version: 19` — ignores if the llvm major version does not
match the specified llvm major version.
- `min-llvm-version: 13.0` — ignored if the LLVM version is less than the given
value
- `min-system-llvm-version: 12.0` — ignored if using a system LLVM and its
version is less than the given value
- `max-llvm-major-version: 19` — ignored if the LLVM major version is higher
than the given major version
- `ignore-llvm-version: 9.0` — ignores a specific LLVM version
- `ignore-llvm-version: 7.0 - 9.9.9` — ignores LLVM versions in a range
(inclusive)
- `needs-llvm-components: powerpc` — ignores if the specific LLVM component was
not built. Note: The test will fail on CI (when
`COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS` is set) if the component does not
exist.
- `needs-forced-clang-based-tests` — test is ignored unless the environment
variable `RUSTBUILD_FORCE_CLANG_BASED_TESTS` is set, which enables building
clang alongside LLVM
- This is only set in two CI jobs ([`x86_64-gnu-debug`] and
[`aarch64-gnu-debug`]), which only runs a
subset of `run-make` tests. Other tests with this directive will not
run at all, which is usually not what you want.
See also [Debuginfo tests](compiletest.md#debuginfo-tests) for directives for
ignoring debuggers.
### Affecting how tests are built
| Directive | Explanation | Supported test suites | Possible values |
|---------------------|----------------------------------------------------------------------------------------------|---------------------------|--------------------------------------------------------------------------------------------|
| `compile-flags` | Flags passed to `rustc` when building the test or aux file | All except for `run-make` | Any valid `rustc` flags, e.g. `-Awarnings -Dfoo`. Cannot be `-Cincremental` or `--edition` |
| `edition` | The edition used to build the test | All except for `run-make` | Any valid `--edition` value |
| `rustc-env` | Env var to set when running `rustc` | All except for `run-make` | `<KEY>=<VALUE>` |