]> git.lizzy.rs Git - rust.git/blob - src/test/ui/repr/repr-align.rs
Override rustc version in ui and mir-opt tests to get stable hashes
[rust.git] / src / test / ui / repr / repr-align.rs
1 #![allow(dead_code)]
2
3 #[repr(align(16.0))] //~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer
4                      //~| ERROR: invalid `repr(align)` attribute: not an unsuffixed integer
5 struct S0(i32);
6
7 #[repr(align(15))] //~ ERROR: invalid `repr(align)` attribute: not a power of two
8                    //~| ERROR: invalid `repr(align)` attribute: not a power of two
9 struct S1(i32);
10
11 #[repr(align(4294967296))] //~ ERROR: invalid `repr(align)` attribute: larger than 2^29
12                            //~| ERROR: invalid `repr(align)` attribute: larger than 2^29
13 struct S2(i32);
14
15 #[repr(align(536870912))] // ok: this is the largest accepted alignment
16 struct S3(i32);
17
18 #[repr(align(16.0))] //~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer
19                      //~| ERROR: invalid `repr(align)` attribute: not an unsuffixed integer
20 enum E0 { A, B }
21
22 #[repr(align(15))] //~ ERROR: invalid `repr(align)` attribute: not a power of two
23                    //~| ERROR: invalid `repr(align)` attribute: not a power of two
24 enum E1 { A, B }
25
26 #[repr(align(4294967296))] //~ ERROR: invalid `repr(align)` attribute: larger than 2^29
27                            //~| ERROR: invalid `repr(align)` attribute: larger than 2^29
28 enum E2 { A, B }
29
30 #[repr(align(536870912))] // ok: this is the largest accepted alignment
31 enum E3 { A, B }
32
33 fn main() {}