Skip to content

Make //@ skip-filecheck a normal compiletest directive#155630

Open
Zalathar wants to merge 2 commits intorust-lang:mainfrom
Zalathar:skip-filecheck
Open

Make //@ skip-filecheck a normal compiletest directive#155630
Zalathar wants to merge 2 commits intorust-lang:mainfrom
Zalathar:skip-filecheck

Conversation

@Zalathar
Copy link
Copy Markdown
Member

The skip-filecheck directive is currently used by mir-opt tests, to suppress the default behaviour of running LLVM's FileCheck tool to check MIR output against FileCheck rules in the test file.

The skip-filecheck directive was not included in the big migration to //@ directive syntax (#121370), perhaps because it was parsed and processed in the miropt-test-tools helper crate, not in compiletest itself.

Recently I noticed that a small number of codegen-llvm tests were using the //@ build-pass directive, which has the non-obvious effect of skipping FileCheck in codegen tests. That's quite confusing, so I decided to have the mir-opt tests migrate over to a proper //@ skip-filecheck directive, which could then be used by codegen tests as well.

(I also added skip-filecheck support to assembly tests, which are very similar to codegen tests, though there are currently no assembly tests that actually use //@ skip-filecheck.)


Support for using //@ build-pass in codegen tests to skip FileCheck was introduced in #113603. With hindsight, I think doing things that way was pretty clearly a mistake, and we'll be better off with //@ skip-filecheck.

r? jieyouxu

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 22, 2026

The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes.

cc @BoxyUwU, @tshepang

Some changes occurred in src/tools/compiletest

cc @jieyouxu

compiletest directives have been modified. Please add or update docs for the
new or modified directive in src/doc/rustc-dev-guide/.

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 22, 2026
@jieyouxu
Copy link
Copy Markdown
Member

Oh nice yes, this is something that was mildly annoying to me 👍 I'll take a look soon

@Zalathar
Copy link
Copy Markdown
Member Author

Non-blocking cc @davidtwco on the fact that tests/codegen-llvm/scalable-vectors/tuple-intrinsics.rs was actually skipping FileCheck, due to its use of //@ build-pass, despite containing several FileCheck assertions.

In that test, skipping FileCheck seems to have been unintentional.

Unfortunately we can't just re-enable FileCheck for that test, because the current FileCheck assertions appear to be broken.

Skipping FileCheck in codegen/assembly tests is normally not very useful, but a
small number of existing tests were using `//@ build-pass` to do so anyway, so
it's clearer for them to explicitly use `//@ skip-filecheck` instead.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 22, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants