-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow tests to specify a //@ filecheck-flags:
header
#120656
Conversation
r? @wesleywiser (rustbot has picked a reviewer for you, use r? to override) |
f67fa80
to
478de04
Compare
☔ The latest upstream changes (presumably #120881) made this pull request unmergeable. Please resolve the merge conflicts. |
478de04
to
d2b1f61
Compare
☔ 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
Updated for #121370. |
// filecheck-flags:
header//@ filecheck-flags:
header
Awesome, always nice to see @bors r+ rollup |
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.
💔 Test failed - checks-actions |
A job failed! Check out the build log: (web) (plain) Click to see the possible cause of the failure (guessed by this bot)
|
Looks like this got caught up in whatever CI failure has the tree closed at the moment. |
@bors retry ghcr.io network error |
…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
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.
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
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 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 afilecheck-flags
header might be useful for other purposes as well.