Skip to content

tests: FiveU16s extern ABI test fails on big endian PPC64 ELFv2 (musl) #128579

Closed
@awilfox

Description

@awilfox

I tried this code:

        RUST_BACKTRACE=1 \   
        python3 x.py test -j 64 tests/ui

I expected to see this happen: test suite passing

Instead, this happened:

failures:
    [ui] tests/ui/abi/extern/extern-return-FiveU16s.rs
    [ui] tests/ui/abi/extern/extern-pass-FiveU16s.rs

The return failure is:

thread 'main' panicked at /home/awilcox/Code/contrib/rust/tests/ui/abi/extern/extern-return-FiveU16s.rs:20:9:
assertion `left == right` failed
  left: 40
 right: 10
stack backtrace:
   0: rust_begin_unwind
             at /home/awilcox/Code/contrib/rust/library/std/src/panicking.rs:662:5
   1: core::panicking::panic_fmt
             at /home/awilcox/Code/contrib/rust/library/core/src/panicking.rs:74:14
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
   4: extern_return_FiveU16s::main

The pass failure is:

thread 'main' panicked at /home/awilcox/Code/contrib/rust/tests/ui/abi/extern/extern-pass-FiveU16s.rs:28:9:
assertion `left == right` failed
  left: FiveU16s { one: 22, two: 23, three: 24, four: 25, five: 26 }
 right: FiveU16s { one: 25, two: 26, three: 0, four: 0, five: 0 }
stack backtrace:
   0: rust_begin_unwind
             at /home/awilcox/Code/contrib/rust/library/std/src/panicking.rs:662:5
   1: core::panicking::panic_fmt
             at /home/awilcox/Code/contrib/rust/library/core/src/panicking.rs:74:14
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
   4: extern_pass_FiveU16s::main

Meta

rustc --version --verbose:

rustc 1.82.0-nightly (249cf71f1 2024-07-30) (Adélie 1.82.0 EXPERIMENTAL)
binary: rustc
commit-hash: 249cf71f11a29b3fb68e8a35969569d8bb7958ee
commit-date: 2024-07-30
host: powerpc64-foxkit-linux-musl
release: 1.82.0-nightly
LLVM version: 18.1.8

This occurs in every version since the test was added. I see this with 1.79.0 and 1.80.0 as well as my 1.81.0 beta build (rustc 1.81.0-beta.2 (08328a323 2024-07-25) (Adelie 1.81.0_beta20240730-r0 [BETA])).

I haven't dug in to all of the nitty-gritty yet, but I have a feeling

let unit = if cx.data_layout().endian == Endian::Big {
Reg { kind: RegKind::Integer, size }
may be potentially incorrect?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ABIArea: Concerning the application binary interface (ABI)A-testsuiteArea: The testsuite used to check the correctness of rustcC-bugCategory: This is a bug.O-PowerPCTarget: PowerPC processorsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions