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