Skip to content
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

sparc ABI issue - structure returning from function is returned in 64bit registers #52730

Closed
wants to merge 1 commit into from

Conversation

psumbera
Copy link
Contributor

Fixes: #52638

@rust-highfive
Copy link
Collaborator

r? @cramertj

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 26, 2018
@nagisa
Copy link
Member

nagisa commented Jul 26, 2018

r? @nagisa

@psumbera do you want to try and write up a test, or should I do it?

@rust-highfive rust-highfive assigned nagisa and unassigned cramertj Jul 26, 2018
@nagisa
Copy link
Member

nagisa commented Jul 26, 2018

It should be a codegen test, something along the lines of

// license here
// compile-flags: --target=sparc64-unknown-linux-gnu
#![feature(no_core, lang_items)]
#![no_core]

#[lang="sized"]
trait Sized { }
#[lang="freeze"]
trait Freeze { }
#[lang="copy"]
trait Copy { }
#[repr(C)]
pub struct Bool {
    b: bool,
}
#[no_mangle]
// CHECK: define i64 @structbool()
// CHECK-NEXT: start:
// CHECK-NEXT: ret i64 72057594037927936
pub extern "C" fn structbool() -> Bool {
    Bool { b: true }
}

@psumbera
Copy link
Contributor Author

Can you please do tests for me? I'm afraid that tests on Solaris are not at good conditions. Plus I'm still fighting to get build of Rust 1.27 on sparc.

@nagisa
Copy link
Member

nagisa commented Jul 26, 2018

I added a tests and put up a PR with the tests included at #52734.

@nagisa nagisa closed this Jul 26, 2018
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jul 26, 2018
sparc ABI issue - structure returning from function is returned in 64bit registers (with tests)

Fixes rust-lang#52638

Supersedes rust-lang#52730

cc @psumbera
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants