]>
Commit | Line | Data |
---|---|---|
0531ce1d | 1 | // compile-flags: -C no-prepopulate-passes |
cdc7bbd5 | 2 | // |
0531ce1d XL |
3 | |
4 | // only-mips64 | |
5 | // See repr-transparent.rs | |
6 | ||
dfeec247 | 7 | #![feature(transparent_unions)] |
dc9dc135 | 8 | |
0531ce1d | 9 | #![crate_type="lib"] |
0531ce1d XL |
10 | |
11 | ||
dc9dc135 | 12 | #[derive(Clone, Copy)] |
0531ce1d | 13 | #[repr(C)] |
dc9dc135 XL |
14 | pub struct BigS([u32; 16]); |
15 | ||
16 | #[repr(transparent)] | |
17 | pub struct TsBigS(BigS); | |
18 | ||
19 | #[repr(transparent)] | |
20 | pub union TuBigS { | |
21 | field: BigS, | |
22 | } | |
0531ce1d XL |
23 | |
24 | #[repr(transparent)] | |
dc9dc135 XL |
25 | pub enum TeBigS { |
26 | Variant(BigS), | |
27 | } | |
28 | ||
6a06907d | 29 | // CHECK: define void @test_BigS(%BigS* [[BIGS_RET_ATTRS1:.*]] sret(%BigS) [[BIGS_RET_ATTRS2:.*]], [8 x i64] |
dc9dc135 XL |
30 | #[no_mangle] |
31 | pub extern fn test_BigS(_: BigS) -> BigS { loop {} } | |
32 | ||
6a06907d | 33 | // CHECK: define void @test_TsBigS(%TsBigS* [[BIGS_RET_ATTRS1]] sret(%TsBigS) [[BIGS_RET_ATTRS2]], [8 x i64] |
dc9dc135 XL |
34 | #[no_mangle] |
35 | pub extern fn test_TsBigS(_: TsBigS) -> TsBigS { loop {} } | |
0531ce1d | 36 | |
6a06907d | 37 | // CHECK: define void @test_TuBigS(%TuBigS* [[BIGS_RET_ATTRS1]] sret(%TuBigS) [[BIGS_RET_ATTRS2]], [8 x i64] |
0531ce1d | 38 | #[no_mangle] |
dc9dc135 | 39 | pub extern fn test_TuBigS(_: TuBigS) -> TuBigS { loop {} } |
0531ce1d | 40 | |
6a06907d | 41 | // CHECK: define void @test_TeBigS(%"TeBigS::Variant"* [[BIGS_RET_ATTRS1]] sret(%"TeBigS::Variant") [[BIGS_RET_ATTRS2]], [8 x i64] |
0531ce1d | 42 | #[no_mangle] |
dc9dc135 | 43 | pub extern fn test_TeBigS(_: TeBigS) -> TeBigS { loop {} } |
0531ce1d XL |
44 | |
45 | ||
dc9dc135 | 46 | #[derive(Clone, Copy)] |
0531ce1d XL |
47 | #[repr(C)] |
48 | pub union BigU { | |
49 | foo: [u32; 16], | |
50 | } | |
51 | ||
52 | #[repr(transparent)] | |
dc9dc135 XL |
53 | pub struct TsBigU(BigU); |
54 | ||
55 | #[repr(transparent)] | |
56 | pub union TuBigU { | |
57 | field: BigU, | |
58 | } | |
59 | ||
60 | #[repr(transparent)] | |
61 | pub enum TeBigU { | |
62 | Variant(BigU), | |
63 | } | |
0531ce1d | 64 | |
6a06907d | 65 | // CHECK: define void @test_BigU(%BigU* [[BIGU_RET_ATTRS1:.*]] sret(%BigU) [[BIGU_RET_ATTRS2:.*]], [8 x i64] |
0531ce1d XL |
66 | #[no_mangle] |
67 | pub extern fn test_BigU(_: BigU) -> BigU { loop {} } | |
68 | ||
6a06907d | 69 | // CHECK: define void @test_TsBigU(%TsBigU* [[BIGU_RET_ATTRS1]] sret(%TsBigU) [[BIGU_RET_ATTRS2]], [8 x i64] |
dc9dc135 XL |
70 | #[no_mangle] |
71 | pub extern fn test_TsBigU(_: TsBigU) -> TsBigU { loop {} } | |
72 | ||
6a06907d | 73 | // CHECK: define void @test_TuBigU(%TuBigU* [[BIGU_RET_ATTRS1]] sret(%TuBigU) [[BIGU_RET_ATTRS2]], [8 x i64] |
dc9dc135 XL |
74 | #[no_mangle] |
75 | pub extern fn test_TuBigU(_: TuBigU) -> TuBigU { loop {} } | |
76 | ||
6a06907d | 77 | // CHECK: define void @test_TeBigU(%"TeBigU::Variant"* [[BIGU_RET_ATTRS1]] sret(%"TeBigU::Variant") [[BIGU_RET_ATTRS2]], [8 x i64] |
0531ce1d | 78 | #[no_mangle] |
dc9dc135 | 79 | pub extern fn test_TeBigU(_: TeBigU) -> TeBigU { loop {} } |