Skip to content

tests: debuginfo: Work around or disable broken tests on powerpc #144160

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 2 commits into
base: master
Choose a base branch
from

Conversation

Gelbpunkt
Copy link
Contributor

@Gelbpunkt Gelbpunkt commented Jul 18, 2025

f16 support for PowerPC has issues in LLVM, therefore we need a small workaround to prevent LLVM from emitting symbols that don't exist for PowerPC yet.

It also appears that #128973 applies to PowerPC targets as well, though I've only tested 64-bit Linux targets.

@rustbot
Copy link
Collaborator

rustbot commented Jul 18, 2025

r? @oli-obk

rustbot has assigned @oli-obk.
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 A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 18, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 18, 2025

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@rustbot

This comment has been minimized.

@Gelbpunkt Gelbpunkt force-pushed the debuginfo-tests-ppc branch from f90a6c1 to 9ce00f5 Compare July 18, 2025 21:33
Comment on lines 3 to 7
// Targets with broken f16 cannot link due to missing __gnu_f2h_ieee
// See https://github.com/llvm/llvm-project/issues/97981
// and https://github.com/rust-lang/compiler-builtins/issues/655
//@ ignore-powerpc
//@ ignore-powerpc64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel that we really should not have types that must be ignored in the same file as other types.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So would you suggest splitting off the f16 parts into a f16-globals-metadata test and disabling that on the affected targets?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that would be preferable. If it's powerpc, then it's likely going to be others.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, pulling f16 into its own test suddenly makes the test pass. I'm not too sure what part of the old vs new code is responsible for LLVM emitting the symbol vs not emitting it.

Copy link
Contributor Author

@Gelbpunkt Gelbpunkt Jul 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, fairly simple it turns out:

This emits __gnu_h2f_ieee

static mut F16: f16 = 1.5;
static mut F32: f16 = 2.5;

fn main() {
    _zzz(); // #break

    let a = unsafe { (F16, F32) };
}

fn _zzz() {()}

This doesn't

static mut F16: f16 = 1.5;

fn main() {
    _zzz(); // #break

    let a = unsafe { (F16,) };
}

fn _zzz() {()}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I included a workaround instead of disabling the tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...huh.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my guess is that it tries to convert the f16 to the f32 due to rules about how we represent the tuple layout

f16 support for PowerPC has issues in LLVM, therefore we need a small
workaround to prevent LLVM from emitting symbols that don't exist for
PowerPC yet.

It also appears that unused by-value non-immedate issue with gdb applies
to PowerPC targets as well, though I've only tested 64-bit Linux targets.

Signed-off-by: Jens Reidel <[email protected]>
@Gelbpunkt Gelbpunkt force-pushed the debuginfo-tests-ppc branch from 9ce00f5 to 1d0eddb Compare July 20, 2025 05:29
@Gelbpunkt Gelbpunkt changed the title tests: debuginfo: Disable broken tests on powerpc tests: debuginfo: Work around or disable broken tests on powerpc Jul 20, 2025
@Gelbpunkt Gelbpunkt requested a review from oli-obk July 21, 2025 19:57
@oli-obk
Copy link
Contributor

oli-obk commented Jul 22, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 22, 2025

📌 Commit e1b6cfe has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.

5 participants