]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/repr-transparent-aggregates-3.rs
Enable emission of alignment attrs for pointer params
[rust.git] / src / test / codegen / repr-transparent-aggregates-3.rs
1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // compile-flags: -C no-prepopulate-passes
12
13 // only-mips64
14 // See repr-transparent.rs
15
16 #![crate_type="lib"]
17
18
19 #[repr(C)]
20 pub struct Big([u32; 16]);
21
22 #[repr(transparent)]
23 pub struct BigW(Big);
24
25 // CHECK: define void @test_Big(%Big* [[BIG_RET_ATTRS:.*]], [8 x i64]
26 #[no_mangle]
27 pub extern fn test_Big(_: Big) -> Big { loop {} }
28
29 // CHECK: define void @test_BigW(%BigW* [[BIG_RET_ATTRS]], [8 x i64]
30 #[no_mangle]
31 pub extern fn test_BigW(_: BigW) -> BigW { loop {} }
32
33
34 #[repr(C)]
35 pub union BigU {
36     foo: [u32; 16],
37 }
38
39 #[repr(transparent)]
40 pub struct BigUw(BigU);
41
42 // CHECK: define void @test_BigU(%BigU* [[BIGU_RET_ATTRS:.*]], [8 x i64]
43 #[no_mangle]
44 pub extern fn test_BigU(_: BigU) -> BigU { loop {} }
45
46 // CHECK: define void @test_BigUw(%BigUw* [[BIGU_RET_ATTRS]], [8 x i64]
47 #[no_mangle]
48 pub extern fn test_BigUw(_: BigUw) -> BigUw { loop {} }