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