]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | // run-pass |
0bf4aa26 | 2 | #![allow(dead_code)] |
b7449926 XL |
3 | #![allow(deprecated)] |
4 | ||
85aaf69f | 5 | use std::mem; |
223e47cc | 6 | |
b039eaaf | 7 | #[derive(PartialEq, Debug)] |
85aaf69f SL |
8 | enum Foo { |
9 | A(u32), | |
10 | Bar([u16; 4]), | |
11 | C | |
12 | } | |
223e47cc | 13 | |
85aaf69f SL |
14 | // NOTE(eddyb) Don't make this a const, needs to be a static |
15 | // so it is always instantiated as a LLVM constant value. | |
16 | static FOO: Foo = Foo::C; | |
223e47cc LB |
17 | |
18 | fn main() { | |
85aaf69f SL |
19 | assert_eq!(FOO, Foo::C); |
20 | assert_eq!(mem::size_of::<Foo>(), 12); | |
21 | assert_eq!(mem::min_align_of::<Foo>(), 4); | |
223e47cc | 22 | } |