-
Notifications
You must be signed in to change notification settings - Fork 13.3k
organize and extend forbidden target feature tests #140395
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
base: master
Are you sure you want to change the base?
Conversation
rustbot has assigned @petrochenkov. Use |
This comment has been minimized.
This comment has been minimized.
r=me with tidy fixed. |
Reminder, once the PR becomes ready for a review, use |
1b9008f
to
240cc10
Compare
This comment has been minimized.
This comment has been minimized.
| | ||
= note: this feature is not stably supported; its behavior can change in the future | ||
|
||
warning: both target-abi and the triple-implied ABI are invalid, ignoring and using feature-implied ABI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heiher any idea what this warning is about? Does it come from LLVM?
For riscv it says
Hard-float 'd' ABI can't be used for a target that doesn't support the D instruction set extension (ignoring target-abi)
which is a lot more clear. Is this trying to say the same thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they are quite similar. The LoongArch backend attempts to compute the ABI based on the target-abi
and triple-name
. If there’s a conflict between the resulting ABI and the target features, the final ABI will be determined by the target features.
Fore more details:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. I find the LoongArch error quite unclear compared to the RISC-V error... but anyway it should be impossible to trigger this warning from rustc without also triggering "target feature d
must be enabled to ensure that the ABI of the current target can be implemented correctly" so users will hopefully understand what the problem is.
So somehow on CI we get a bunch of extra warnings:
I don't get those when running the test locally. Is that an LLVM version thing? Does |
Thank you for everything you've done. IIRC, when the LLVM backend doesn't support target features listed in Would it be possible to add a diff --git a/tests/ui/target-feature/abi-required-target-feature-flag-disable.rs b/tests/ui/target-feature/abi-required-target-feature-flag-disable.rs
index 02841b6690a..5b0d7b7b252 100644
--- a/tests/ui/target-feature/abi-required-target-feature-flag-disable.rs
+++ b/tests/ui/target-feature/abi-required-target-feature-flag-disable.rs
@@ -12,6 +12,7 @@
//@[riscv] needs-llvm-components: riscv
//@[loongarch] compile-flags: --target=loongarch64-unknown-none -Ctarget-feature=-d
//@[loongarch] needs-llvm-components: loongarch
+//@[loongarch] min-llvm-version: 20
// For now this is just a warning.
//@ build-pass It would also be useful for the warning: |
I'm surprised by this. I thought the warning should should only show up when the target feature is actually used, but I did a quick test and you are right. I hope these warnings do not show up on stable? We may have to come up with a better way to deal with target features that are not supported by all of the LLVM versions we support, the current approach feels fragile.
I don't think so, that warning appears consistently for all LLVM versions it seems (so it's not a problem). |
This comment has been minimized.
This comment has been minimized.
Oh I see what you mean, that RISCV error didn't yet show in LLVM 19. |
f78cc1b
to
5b7e669
Compare
@bors r=petrochenkov |
…etrochenkov organize and extend forbidden target feature tests In particular this adds some loongarch tests for rust-lang#135015, Cc `@heiher` Seems like the tests change so much git does not detect the renames; a commit-by-commit review should help.
Rollup of 6 pull requests Successful merges: - rust-lang#139883 (crashes: more tests) - rust-lang#140312 (Improve pretty-printing of braces) - rust-lang#140392 (compiletest: Remove the libtest-based executor and its dependency) - rust-lang#140395 (organize and extend forbidden target feature tests) - rust-lang#140422 (unwind: bump `unwinding` dependency to 0.2.6) - rust-lang#140432 (Update documentation for `fn target_config`) r? `@ghost` `@rustbot` modify labels: rollup
In particular this adds some loongarch tests for #135015, Cc @heiher
Seems like the tests change so much git does not detect the renames; a commit-by-commit review should help.