1- //@ revisions: arm mips thumb wasm32
1+ //@ revisions: arm-linux arm-android armv7-linux armv7-android mips thumb sparc
22//@ compile-flags: -C no-prepopulate-passes
3- //
4- //@[arm] only-arm
5- //@[mips] only-mips
6- //@[thumb] only-thumb
7- //@[wasm32] only-wasm32
8- //@ ignore-emscripten
3+
4+ //@[arm-linux] compile-flags: --target arm-unknown-linux-gnueabi
5+ //@[arm-linux] needs-llvm-components: arm
6+ //@[arm-android] compile-flags: --target arm-linux-androideabi
7+ //@[arm-android] needs-llvm-components: arm
8+ //@[armv7-linux] compile-flags: --target armv7-unknown-linux-gnueabi
9+ //@[armv7-linux] needs-llvm-components: arm
10+ //@[armv7-android] compile-flags: --target armv7-linux-androideabi
11+ //@[armv7-android] needs-llvm-components: arm
12+ //@[mips] compile-flags: --target mips-unknown-linux-gnu
13+ //@[mips] needs-llvm-components: mips
14+ //@[thumb] compile-flags: --target thumbv7neon-linux-androideabi
15+ //@[thumb] needs-llvm-components: arm
16+ //@[sparc] compile-flags: --target sparc-unknown-linux-gnu
17+ //@[sparc] needs-llvm-components: sparc
18+
919// See ./transparent.rs
1020// Some platforms pass large aggregates using immediate arrays in LLVMIR
1121// Other platforms pass large aggregates using struct pointer in LLVMIR
1222// This covers the "immediate array" case.
1323
14- #![ feature( transparent_unions) ]
24+ #![ feature( no_core, lang_items, transparent_unions) ]
25+ #![ crate_type = "lib" ]
26+ #![ no_std]
27+ #![ no_core]
28+
29+ #[ lang="sized" ] trait Sized { }
30+ #[ lang="freeze" ] trait Freeze { }
31+ #[ lang="copy" ] trait Copy { }
1532
16- #![ crate_type="lib" ]
33+ impl Copy for [ u32 ; 16 ] { }
34+ impl Copy for BigS { }
35+ impl Copy for BigU { }
1736
1837
19- #[ derive( Clone , Copy ) ]
2038#[ repr( C ) ]
2139pub struct BigS ( [ u32 ; 16 ] ) ;
2240
@@ -33,24 +51,23 @@ pub enum TeBigS {
3351 Variant ( BigS ) ,
3452}
3553
36- // CHECK: define void @test_BigS(ptr [[BIGS_RET_ATTRS1:.*]] sret(%BigS ) [[BIGS_RET_ATTRS2:.*]], [16 x i32]
54+ // CHECK: define void @test_BigS(ptr [[BIGS_RET_ATTRS1:.*]] sret([64 x i8] ) [[BIGS_RET_ATTRS2:.*]], [16 x i32]
3755#[ no_mangle]
3856pub extern fn test_BigS ( _: BigS ) -> BigS { loop { } }
3957
40- // CHECK: define void @test_TsBigS(ptr [[BIGS_RET_ATTRS1]] sret(%TsBigS ) [[BIGS_RET_ATTRS2]], [16 x i32]
58+ // CHECK: define void @test_TsBigS(ptr [[BIGS_RET_ATTRS1]] sret([64 x i8] ) [[BIGS_RET_ATTRS2]], [16 x i32]
4159#[ no_mangle]
4260pub extern fn test_TsBigS ( _: TsBigS ) -> TsBigS { loop { } }
4361
44- // CHECK: define void @test_TuBigS(ptr [[BIGS_RET_ATTRS1]] sret(%TuBigS ) [[BIGS_RET_ATTRS2]], [16 x i32]
62+ // CHECK: define void @test_TuBigS(ptr [[BIGS_RET_ATTRS1]] sret([64 x i8] ) [[BIGS_RET_ATTRS2]], [16 x i32]
4563#[ no_mangle]
4664pub extern fn test_TuBigS ( _: TuBigS ) -> TuBigS { loop { } }
4765
48- // CHECK: define void @test_TeBigS(ptr [[BIGS_RET_ATTRS1]] sret(%"TeBigS::Variant" ) [[BIGS_RET_ATTRS2]], [16 x i32]
66+ // CHECK: define void @test_TeBigS(ptr [[BIGS_RET_ATTRS1]] sret([64 x i8] ) [[BIGS_RET_ATTRS2]], [16 x i32]
4967#[ no_mangle]
5068pub extern fn test_TeBigS ( _: TeBigS ) -> TeBigS { loop { } }
5169
5270
53- #[ derive( Clone , Copy ) ]
5471#[ repr( C ) ]
5572pub union BigU {
5673 foo : [ u32 ; 16 ] ,
@@ -69,18 +86,18 @@ pub enum TeBigU {
6986 Variant ( BigU ) ,
7087}
7188
72- // CHECK: define void @test_BigU(ptr [[BIGU_RET_ATTRS1:.*]] sret(%BigU ) [[BIGU_RET_ATTRS2:.*]], [16 x i32]
89+ // CHECK: define void @test_BigU(ptr [[BIGU_RET_ATTRS1:.*]] sret([64 x i8] ) [[BIGU_RET_ATTRS2:.*]], [16 x i32]
7390#[ no_mangle]
7491pub extern fn test_BigU ( _: BigU ) -> BigU { loop { } }
7592
76- // CHECK: define void @test_TsBigU(ptr [[BIGU_RET_ATTRS1]] sret(%TsBigU ) [[BIGU_RET_ATTRS2]], [16 x i32]
93+ // CHECK: define void @test_TsBigU(ptr [[BIGU_RET_ATTRS1]] sret([64 x i8] ) [[BIGU_RET_ATTRS2]], [16 x i32]
7794#[ no_mangle]
7895pub extern fn test_TsBigU ( _: TsBigU ) -> TsBigU { loop { } }
7996
80- // CHECK: define void @test_TuBigU(ptr [[BIGU_RET_ATTRS1]] sret(%TuBigU ) [[BIGU_RET_ATTRS2]], [16 x i32]
97+ // CHECK: define void @test_TuBigU(ptr [[BIGU_RET_ATTRS1]] sret([64 x i8] ) [[BIGU_RET_ATTRS2]], [16 x i32]
8198#[ no_mangle]
8299pub extern fn test_TuBigU ( _: TuBigU ) -> TuBigU { loop { } }
83100
84- // CHECK: define void @test_TeBigU(ptr [[BIGU_RET_ATTRS1]] sret(%"TeBigU::Variant" ) [[BIGU_RET_ATTRS2]], [16 x i32]
101+ // CHECK: define void @test_TeBigU(ptr [[BIGU_RET_ATTRS1]] sret([64 x i8] ) [[BIGU_RET_ATTRS2]], [16 x i32]
85102#[ no_mangle]
86103pub extern fn test_TeBigU ( _: TeBigU ) -> TeBigU { loop { } }
0 commit comments