]> git.lizzy.rs Git - rust.git/blob - tests/codegen/repr-transparent-aggregates-3.rs
Rollup merge of #107769 - compiler-errors:pointer-like, r=eholk
[rust.git] / tests / codegen / repr-transparent-aggregates-3.rs
1 // compile-flags: -C no-prepopulate-passes
2 //
3
4 // only-mips64
5 // See repr-transparent.rs
6
7 #![feature(transparent_unions)]
8
9 #![crate_type="lib"]
10
11
12 #[derive(Clone, Copy)]
13 #[repr(C)]
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 }
23
24 #[repr(transparent)]
25 pub enum TeBigS {
26     Variant(BigS),
27 }
28
29 // CHECK: define void @test_BigS(%BigS* [[BIGS_RET_ATTRS1:.*]] sret(%BigS) [[BIGS_RET_ATTRS2:.*]], [8 x i64]
30 #[no_mangle]
31 pub extern fn test_BigS(_: BigS) -> BigS { loop {} }
32
33 // CHECK: define void @test_TsBigS(%TsBigS* [[BIGS_RET_ATTRS1]] sret(%TsBigS) [[BIGS_RET_ATTRS2]], [8 x i64]
34 #[no_mangle]
35 pub extern fn test_TsBigS(_: TsBigS) -> TsBigS { loop {} }
36
37 // CHECK: define void @test_TuBigS(%TuBigS* [[BIGS_RET_ATTRS1]] sret(%TuBigS) [[BIGS_RET_ATTRS2]], [8 x i64]
38 #[no_mangle]
39 pub extern fn test_TuBigS(_: TuBigS) -> TuBigS { loop {} }
40
41 // CHECK: define void @test_TeBigS(%"TeBigS::Variant"* [[BIGS_RET_ATTRS1]] sret(%"TeBigS::Variant") [[BIGS_RET_ATTRS2]], [8 x i64]
42 #[no_mangle]
43 pub extern fn test_TeBigS(_: TeBigS) -> TeBigS { loop {} }
44
45
46 #[derive(Clone, Copy)]
47 #[repr(C)]
48 pub union BigU {
49     foo: [u32; 16],
50 }
51
52 #[repr(transparent)]
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 }
64
65 // CHECK: define void @test_BigU(%BigU* [[BIGU_RET_ATTRS1:.*]] sret(%BigU) [[BIGU_RET_ATTRS2:.*]], [8 x i64]
66 #[no_mangle]
67 pub extern fn test_BigU(_: BigU) -> BigU { loop {} }
68
69 // CHECK: define void @test_TsBigU(%TsBigU* [[BIGU_RET_ATTRS1]] sret(%TsBigU) [[BIGU_RET_ATTRS2]], [8 x i64]
70 #[no_mangle]
71 pub extern fn test_TsBigU(_: TsBigU) -> TsBigU { loop {} }
72
73 // CHECK: define void @test_TuBigU(%TuBigU* [[BIGU_RET_ATTRS1]] sret(%TuBigU) [[BIGU_RET_ATTRS2]], [8 x i64]
74 #[no_mangle]
75 pub extern fn test_TuBigU(_: TuBigU) -> TuBigU { loop {} }
76
77 // CHECK: define void @test_TeBigU(%"TeBigU::Variant"* [[BIGU_RET_ATTRS1]] sret(%"TeBigU::Variant") [[BIGU_RET_ATTRS2]], [8 x i64]
78 #[no_mangle]
79 pub extern fn test_TeBigU(_: TeBigU) -> TeBigU { loop {} }