]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/sparc-struct-abi.rs
Rollup merge of #87385 - Aaron1011:final-enable-semi, r=petrochenkov
[rust.git] / src / test / codegen / sparc-struct-abi.rs
1 // Checks that we correctly codegen extern "C" functions returning structs.
2 // See issue #52638.
3
4 // compile-flags: -O --target=sparc64-unknown-linux-gnu --crate-type=rlib
5 // needs-llvm-components: sparc
6 #![feature(no_core, lang_items)]
7 #![no_core]
8
9 #[lang="sized"]
10 trait Sized { }
11 #[lang="freeze"]
12 trait Freeze { }
13 #[lang="copy"]
14 trait Copy { }
15
16 #[repr(C)]
17 pub struct Bool {
18     b: bool,
19 }
20
21 // CHECK: define i64 @structbool()
22 // CHECK-NEXT: start:
23 // CHECK-NEXT: ret i64 72057594037927936
24 #[no_mangle]
25 pub extern "C" fn structbool() -> Bool {
26     Bool { b: true }
27 }