Add a test ensuring all our targets set the features required by their ABI. #136208
Labels
A-ABI
Area: Concerning the application binary interface (ABI)
A-testsuite
Area: The testsuite used to check the correctness of rustc
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
With #136147, we emit a warning (and hopefully eventually a hard error) when a target does not enable all the target features required by the declared ABI, or when it enables a target feature incompatible with the declared ABI. Ideally, we'd ensure that all built-in targets pass this test, but that is non-trivial: we need to actually generate an LLVM TargetMachine for the target and ask LLVM about the enabled target features and then check that against our ABI compatibility list. I'm not sure how to best write such a test.
It could be a ui test compiling an empty program, with a revision for each target, but that seems annoying... I'd prefer something that iterates over all targets automatically, rather than having to list all targets in some ui test.
Cc @workingjubilee @rust-lang/wg-llvm
The text was updated successfully, but these errors were encountered: