Allow tests to specify a //@ filecheck-flags: header#120656
Merged
bors merged 6 commits intorust-lang:masterfrom Feb 26, 2024
Merged
Allow tests to specify a //@ filecheck-flags: header#120656bors merged 6 commits intorust-lang:masterfrom
//@ filecheck-flags: header#120656bors merged 6 commits intorust-lang:masterfrom
Conversation
Collaborator
|
r? @wesleywiser (rustbot has picked a reviewer for you, use r? to override) |
f67fa80 to
478de04
Compare
Collaborator
|
☔ The latest upstream changes (presumably #120881) made this pull request unmergeable. Please resolve the merge conflicts. |
478de04 to
d2b1f61
Compare
Collaborator
|
☔ The latest upstream changes (presumably #121370) made this pull request unmergeable. Please resolve the merge conflicts. |
This removes a version check for LLVM >=13, and specifies prefixes as a series of independent `--check-prefix` flags instead of a single `--check-prefixes`.
Any flags specified here will be passed to LLVM's `filecheck` tool, in tests that use that tool.
This makes room for migrating over `tests/run-make/instrument-coverage`, without increasing the number of top-level items in the codegen test directory.
This test was already very close to being an ordinary codegen test, except that it needed some extra logic to set a few variables based on (target) platform characteristics. Now that we have support for `//@ filecheck-flags:`, we can instead set those variables using the normal test revisions mechanism.
This define was copied over from the run-make version of the test, but doesn't seem to serve any useful purpose.
d2b1f61 to
e56cc84
Compare
Member
Author
|
Updated for #121370. |
// filecheck-flags: header//@ filecheck-flags: header
wesleywiser
approved these changes
Feb 23, 2024
Member
|
Awesome, always nice to see @bors r+ rollup |
Collaborator
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 23, 2024
Allow tests to specify a `//@ filecheck-flags:` header This allows individual codegen/assembly/mir-opt tests to pass extra flags to the LLVM `filecheck` tool as needed. --- The original motivation was noticing that `tests/run-make/instrument-coverage` was very close to being an ordinary codegen test, except that it needs some extra logic to set up platform-specific variables to be passed into filecheck. I then saw the comment in `verify_with_filecheck` indicating that a `filecheck-flags` header might be useful for other purposes as well.
Collaborator
|
💔 Test failed - checks-actions |
Collaborator
|
A job failed! Check out the build log: (web) (plain) Click to see the possible cause of the failure (guessed by this bot) |
Member
Author
|
Looks like this got caught up in whatever CI failure has the tree closed at the moment. |
Contributor
|
@bors retry ghcr.io network error |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 26, 2024
…llaumeGomez Rollup of 5 pull requests Successful merges: - rust-lang#120656 (Allow tests to specify a `//@ filecheck-flags:` header) - rust-lang#120840 (Split Diagnostics for Uncommon Codepoints: Add Individual Identifier Types) - rust-lang#121554 (Don't unnecessarily change `SIGPIPE` disposition in `unix_sigpipe` tests) - rust-lang#121590 (Correctly handle if rustdoc JS script hash changed) - rust-lang#121620 (Fix more rust-lang#121208 fallout (round 3)) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 26, 2024
Rollup merge of rust-lang#120656 - Zalathar:filecheck-flags, r=wesleywiser Allow tests to specify a `//@ filecheck-flags:` header This allows individual codegen/assembly/mir-opt tests to pass extra flags to the LLVM `filecheck` tool as needed. --- The original motivation was noticing that `tests/run-make/instrument-coverage` was very close to being an ordinary codegen test, except that it needs some extra logic to set up platform-specific variables to be passed into filecheck. I then saw the comment in `verify_with_filecheck` indicating that a `filecheck-flags` header might be useful for other purposes as well.
This was referenced Dec 18, 2024
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 18, 2024
compiletest: don't register predefined `MSVC`/`NONMSVC` FileCheck prefixes This was fragile as it was based on host target passed to compiletest, but the user could cross-compile and run test for a different target (e.g. cross from linux to msvc, but msvc won't be set on the target). Furthermore, it was also very surprising as normally revision names (other than `CHECK`) was accepted as FileCheck prefixes. This partially reverts the `MSVC`/`NONMSVC` predefined FileCheck prefix registration introduced in rust-lang#120656 for some codegen tests. This makes some codegen tests more verbose since they now need to explicitly introduce `MSVC`/`NONMSVC` revisions, but I think that's less surprising, e.g.: ```rs //@ revisions: MSVC NONMSVC //`@[MSVC]` only-msvc //`@[NONMSVC]` ignore-msvc ``` Note that revisions are not *only* FileCheck prefixes in FileCheck-based test suites, as they also can be used to conditionally apply certain compiletest directives. r? `@Zalathar` (or reroll a `r/? compiletest` reviewer) try-job: x86_64-msvc try-job: i686-msvc try-job: x86_64-mingw try-job: i686-mingw
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 18, 2024
compiletest: don't register predefined `MSVC`/`NONMSVC` FileCheck prefixes This was fragile as it was based on host target passed to compiletest, but the user could cross-compile and run test for a different target (e.g. cross from linux to msvc, but msvc won't be set on the target). Furthermore, it was also very surprising as normally revision names (other than `CHECK`) was accepted as FileCheck prefixes. This partially reverts the `MSVC`/`NONMSVC` predefined FileCheck prefix registration introduced in rust-lang#120656 for some codegen tests. This makes some codegen tests more verbose since they now need to explicitly introduce `MSVC`/`NONMSVC` revisions, but I think that's less surprising, e.g.: ```rs //@ revisions: MSVC NONMSVC //`@[MSVC]` only-msvc //`@[NONMSVC]` ignore-msvc ``` Note that revisions are not *only* FileCheck prefixes in FileCheck-based test suites, as they also can be used to conditionally apply certain compiletest directives. r? `@Zalathar` (or reroll a `r/? compiletest` reviewer) try-job: x86_64-msvc try-job: i686-msvc try-job: x86_64-mingw-1 try-job: i686-mingw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows individual codegen/assembly/mir-opt tests to pass extra flags to the LLVM
filechecktool as needed.The original motivation was noticing that
tests/run-make/instrument-coveragewas very close to being an ordinary codegen test, except that it needs some extra logic to set up platform-specific variables to be passed into filecheck.I then saw the comment in
verify_with_filecheckindicating that afilecheck-flagsheader might be useful for other purposes as well.