This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
src/doc/rustc-dev-guide/src/tests Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -598,6 +598,21 @@ fn test_foo() {
598598}
599599```
600600
601+ In test suites that use the LLVM [ FileCheck] tool, the current revision name is
602+ also registered as an additional prefix for FileCheck directives:
603+
604+ ``` rust,ignore
605+ //@ revisions: NORMAL COVERAGE
606+ //@ [COVERAGE] compile-flags: -Cinstrument-coverage
607+ //@ [COVERAGE] needs-profiler-support
608+
609+ // COVERAGE: @__llvm_coverage_mapping
610+ // NORMAL-NOT: @__llvm_coverage_mapping
611+
612+ // CHECK: main
613+ fn main() {}
614+ ```
615+
601616Note that not all headers have meaning when customized to a revision.
602617For example, the ` ignore-test ` header (and all "ignore" headers)
603618currently only apply to the test as a whole, not to particular
@@ -609,6 +624,7 @@ Following is classes of tests that support revisions:
609624- UI
610625- assembly
611626- codegen
627+ - coverage
612628- debuginfo
613629- rustdoc UI tests
614630- incremental (these are special in that they inherently cannot be run in parallel)
Original file line number Diff line number Diff line change @@ -95,6 +95,9 @@ found in [`header.rs`] from the compiletest source.
9595 for a known bug that has not yet been fixed
9696* [ Assembly] ( compiletest.md#assembly-tests ) headers
9797 * ` assembly-output ` — the type of assembly output to check
98+ * [ Tool-specific headers] ( #tool-specific-headers )
99+ * ` filecheck-flags ` - passes extra flags to the ` FileCheck ` tool
100+ * ` llvm-cov-flags ` - passes extra flags to the ` llvm-cov ` tool
98101
99102
100103### Ignoring tests
@@ -231,6 +234,19 @@ test suites.
231234 to be loaded by the host compiler.
232235
233236
237+ ### Tool-specific headers
238+
239+ The following headers affect how certain command-line tools are invoked,
240+ in test suites that use those tools:
241+
242+ * ` filecheck-flags ` adds extra flags when running LLVM's ` FileCheck ` tool.
243+ - Used by [ codegen tests] ( compiletest.md#codegen-tests ) ,
244+ [ assembly tests] ( compiletest.md#assembly-tests ) , and
245+ [ MIR-opt tests] ( compiletest.md#mir-opt-tests ) .
246+ * ` llvm-cov-flags ` adds extra flags when running LLVM's ` llvm-cov ` tool.
247+ - Used by [ coverage tests] ( compiletest.md#coverage-tests ) in ` coverage-run ` mode.
248+
249+
234250## Substitutions
235251
236252Headers values support substituting a few variables which will be replaced
You can’t perform that action at this time.
0 commit comments