-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Fix RISC-V Test Failures in ./x test for Multiple Codegen and Assembly Cases #143915
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
Fix tests/assembly/dwarf-mixed-versions-lto.rs test failure on riscv64.
Fix tests/codegen/const-vector.rs test failure on riscv64.
Fix tests/codegen/enum/enum-aggregate.rs test failure on riscv64.
Fix tests/codegen/simd/extract-insert-dyn.rs test failure on riscv64.
Fix tests/codegen/transmute-scalar.rs test failure on riscv64.
Fix tests/codegen/uninhabited-transparent-return-abi.rs test failure on riscv64.
rustbot has assigned @Mark-Simulacrum. Use |
@Mark-Simulacrum I have merged different revisions into a single file. |
This comment has been minimized.
This comment has been minimized.
Fix tidy check error.
This comment has been minimized.
This comment has been minimized.
Fix regex matching error.
@@ -114,7 +114,7 @@ fn make_uninhabited_err_indirectly(n: Never) -> Result<u32, Never> { | |||
fn make_fully_uninhabited_result(v: u32, n: Never) -> Result<(u32, Never), (Never, u32)> { | |||
// Actually reaching this would be UB, so we don't actually build a result. | |||
|
|||
// CHECK-LABEL: { i32, i32 } @make_fully_uninhabited_result(i32 %v) | |||
// CHECK-LABEL: { i32, i32 } @make_fully_uninhabited_result(i32 {{.*}}%v) |
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.
What is the actual content we're hiding here (and presumably the same elsewhere)? i.e., what attributes are unique to riscv?
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.
riscv: CHECK-LABEL: { i32, i32 } @make_fully_uninhabited_result(i32 signext %v)
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.
Hm, I guess riscv falls in the second case:
If an integer argument to a function is not marked signext/zeroext/noext, the kind of extension used is target-specific. Some targets depend for correctness on the kind of extension to be explicitly specified.
I'm not sure if this is the best way to handle this case (maybe we should have two versions of the CHECK statement) or have some normalization outside of each individual test.
cc @scottmcm (I feel like you look at codegen tests a lot)
@rustbot ping llvm
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.
I tried using #[cfg(target_arch = "xxx")], but it didn't work.
cc @nikic for whether there's a better pattern for us to follow in codegen tests to normalize/ignore the per-target ABI questions (E.g., signext above), or if we should instead retain test coverage very explicitly of them. |
@Mark-Simulacrum Ignoring ABI attributes via |
@nikic I'm not sure I understand. If I don't make any changes, running |
The test should specify
To always run against the x86 triple even if you are running on a riscv host. |
@nikic It will fail the test if I don't install the |
@CaiWeiran Using |
Resumption of #143792.
This PR addresses and resolves several test failures that occurred when running
./x test
on the RISC-V architecture. The issues were due to platform-specific behavior, ABI differences, or code generation inconsistencies specific to RISC-V.The following tests have been fixed:
assembly/dwarf-mixed-versions-lto.rs
codegen/const-vector.rs
codegen/enum/enum-aggregate.rs
codegen/simd/extract-insert-dyn.rs
codegen/transmute-scalar.rs
codegen/uninhabited-transparent-return-abi.rs
All changes have been tested locally with
./x test
on a RISC-V target and now pass as expected.Notes: