Skip to content

Fix RISC-V Test Failures in ./x test for Multiple Codegen Cases #144567

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

CaiWeiran
Copy link

@CaiWeiran CaiWeiran commented Jul 28, 2025

This PR resolves several test failures encountered when running ./x test on the RISC-V architecture. These failures were caused by platform-specific behavior, ABI differences, or codegen inconsistencies unique to RISC-V.

The following test cases have been fixed to ensure compatibility with RISC-V:

  • codegen-llvm/enum/enum-match.rs
  • codegen-llvm/enum/enum-transparent-extract.rs
  • codegen-llvm/repeat-operand-zero-len.rs
  • codegen-llvm/enum/enum-aggregate.rs
  • codegen-llvm/uninhabited-transparent-return-abi.rs

In addition, this PR adjusts tests/codegen-llvm/transmute-scalar.rs to explicitly specify the target architecture:

//@ compile-flags: --target=x86_64-unknown-linux-gnu
//@ needs-llvm-components: x86

As suggested by @nikic, this test is not target-specific and already uses minicore, implying it is meant to run against a stable triple regardless of the host architecture. Explicitly setting the target ensures consistent codegen behavior, particularly when testing on non-x86 platforms such as riscv64.

All changes have been tested locally on a RISC-V target and now pass as expected.

Notes:

@rustbot
Copy link
Collaborator

rustbot commented Jul 28, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 28, 2025
@Mark-Simulacrum
Copy link
Member

r=me with commits squashed

@CaiWeiran CaiWeiran requested a review from nikic August 4, 2025 00:58
@CaiWeiran CaiWeiran changed the title Fix tests/codegen-llvm/transmute-scalar.rs test failure on riscv64 Fix RISC-V Test Failures in ./x test for Multiple Codegen Cases Aug 4, 2025
@CaiWeiran
Copy link
Author

r=me with commits squashedr=me,提交被压缩

@Mark-Simulacrum Thanks! Commits squashed as requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants