]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/const_allocation3.rs
Rollup merge of #107465 - WaffleLapkin:has_allow_dead_code_or_lang_attr, r=Nilstrieb
[rust.git] / tests / mir-opt / const_allocation3.rs
1 // unit-test: ConstProp
2 // ignore-endian-big
3 // EMIT_MIR_FOR_EACH_BIT_WIDTH
4 // EMIT_MIR const_allocation3.main.ConstProp.after.mir
5 fn main() {
6     FOO;
7 }
8
9 #[repr(packed)]
10 struct Packed {
11     a: [u8; 28],
12     b: &'static i32,
13     c: u32,
14     d: [u8; 102],
15     e: fn(),
16     f: u16,
17     g: &'static u8,
18     h: [u8; 20],
19 }
20
21 static FOO: &Packed = &Packed {
22     a: [0xAB; 28],
23     b: &42,
24     c: 0xABCD_EF01,
25     d: [0; 102],
26     e: main,
27     f: 0,
28     g: &[0; 100][99],
29     h: [0; 20],
30 };