]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/repr-transparent-aggregates-1.rs
Rollup merge of #61389 - Zoxc:arena-cleanup, r=eddyb
[rust.git] / src / test / codegen / repr-transparent-aggregates-1.rs
1 // compile-flags: -C no-prepopulate-passes
2
3 // ignore-arm
4 // ignore-mips
5 // ignore-mips64
6 // ignore-powerpc
7 // ignore-powerpc64
8 // See repr-transparent.rs
9
10 #![crate_type="lib"]
11
12
13 #[repr(C)]
14 pub struct Big([u32; 16]);
15
16 #[repr(transparent)]
17 pub struct BigW(Big);
18
19 // CHECK: define void @test_Big(%Big* [[BIG_RET_ATTRS:.*]], %Big* [[BIG_ARG_ATTRS:.*]])
20 #[no_mangle]
21 pub extern fn test_Big(_: Big) -> Big { loop {} }
22
23 // CHECK: define void @test_BigW(%BigW* [[BIG_RET_ATTRS]], %BigW* [[BIG_ARG_ATTRS]])
24 #[no_mangle]
25 pub extern fn test_BigW(_: BigW) -> BigW { loop {} }
26
27
28 #[repr(C)]
29 pub union BigU {
30     foo: [u32; 16],
31 }
32
33 #[repr(transparent)]
34 pub struct BigUw(BigU);
35
36 // CHECK: define void @test_BigU(%BigU* [[BIGU_RET_ATTRS:.*]], %BigU* [[BIGU_ARG_ATTRS:.*]])
37 #[no_mangle]
38 pub extern fn test_BigU(_: BigU) -> BigU { loop {} }
39
40 // CHECK: define void @test_BigUw(%BigUw* [[BIGU_RET_ATTRS]], %BigUw* [[BIGU_ARG_ATTRS]])
41 #[no_mangle]
42 pub extern fn test_BigUw(_: BigUw) -> BigUw { loop {} }