Normalize FileCheck directives #789
Labels
major-change
A proposal to make a major change to rustc
T-compiler
Add this label so rfcbot knows to poll the compiler team
Proposal
Background
LLVM FileCheck is a LLVM bin tool is that used in our
tests/{assembly,codegen}
test suites. FileCheck directives are not handledby compiletest (which uses
//@
prefixes).Currently, assembly and codegen tests ("tests") uses the following syntax:
Default FileCheck directives
Without specifying revisions, or in the case of revisions specified but you want
unconditionally checked FileCheck directives, FileCheck will look for
COM
(which are comment directives that are ignored) and
CHECK
-prefixed directives(default). Example matching directives:
Revisioned FileCheck directives
When you specify revisions, i.e.
//@ revisions: a b c
, compiletest will passthe revision names to FileCheck as
--check-prefixes=a,b,c
, which will modifyhow FileCheck matches directives. Namely, FileCheck will now look for
directives with matching prefixes in addition to the default
CHECK
prefix.Example matching directives:
Proposed changes
FIXME-CHECK:
) toCOM:
so we can eventually check for invalid prefixes.e.g.
x86_64-NOT:
vsX86_64-NOT:
orfoo-not:
vsFOO-NOT:
. If so,enforce that they are used consistency.
CHECK-
,i.e. instead of
foo-NOT:
we will always writeCHECK-foo-NOT;
. If so,enforce it.
@tgross35 has a prototype PR at rust-lang/rust#128018
for how some of the changes might look like (subject to changes as the
unresolved questions getting resolved).
Unresolved questions
revision
name capitalization?
be uppercase? Always lowercase?
CHECK
? I.e. if we have arevisions: foo
, instead offoo:
orfoo-NOT:
we would haveCHECK-foo:
and
CHECK-foo-NOT:
.Remarks
:
:Lint on FileCheck directives with missing colon rust#130981
CHECK
:Deny special FileCheck prefixes being used as revision names. rust#130982
Mentors or Reviewers
Anyone who writes a lot of assembly and codegen tests for UX feedback in both
reading and writing. cc @scottmcm, @workingjubilee, @saethlin, @RalfJung,
@DianQK, @nikic, @rust-lang/wg-llvm for advice and preferences.
Process
The main points of the Major Change Process are as follows:
second by writing
@rustbot second
.proposing a new public-facing feature, such as a
-C flag
, then full teamcheck-off is required.
@rfcbot fcp merge
oneither the MCP or the PR.
are raised after 10 days, the MCP is considered approved.
You can read more about Major Change Proposals on forge.
Comments
This issue is not meant to be used for technical discussion. There is a Zulip
stream for that. Use this issue to leave procedural comments, such as
volunteering to review, indicating that you second the proposal (or third, etc),
or raising a concern that you would like to be addressed.
The text was updated successfully, but these errors were encountered: