|
| 1 | +//@ revisions: win notwin |
| 2 | +//@ add-minicore |
| 3 | +//@ [win] compile-flags: --target x86_64-pc-windows-msvc |
| 4 | +//@ [win] needs-llvm-components: x86 |
| 5 | +//@ [notwin] compile-flags: --target x86_64-unknown-linux-gnu |
| 6 | +//@ [notwin] needs-llvm-components: x86 |
| 7 | + |
| 8 | +#![feature(no_core, lang_items)] |
| 9 | +#![no_core] |
1 | 10 | #![allow(dead_code)] |
| 11 | +extern crate minicore; |
| 12 | +use minicore::*; |
2 | 13 |
|
3 | | -#[repr(align(16.0))] //~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer |
| 14 | +#[repr(align(16.0))] //[notwin,win]~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer |
4 | 15 | struct S0(i32); |
5 | 16 |
|
6 | | -#[repr(align(15))] //~ ERROR: invalid `repr(align)` attribute: not a power of two |
| 17 | +#[repr(align(15))] //[notwin,win]~ ERROR: invalid `repr(align)` attribute: not a power of two |
7 | 18 | struct S1(i32); |
8 | 19 |
|
9 | | -#[repr(align(4294967296))] //~ ERROR: invalid `repr(align)` attribute: larger than 2^29 |
| 20 | +#[repr(align(4294967296))] //[notwin,win]~ ERROR: invalid `repr(align)` attribute: larger than 2^29 |
10 | 21 | struct S2(i32); |
11 | 22 |
|
12 | | -#[repr(align(536870912))] // ok: this is the largest accepted alignment |
| 23 | +#[repr(align(536870912))] //[win]~ ERROR: alignment must not be greater than 8192 bytes for COFF targets |
| 24 | + // notwin: this is the largest accepted alignment |
13 | 25 | struct S3(i32); |
14 | 26 |
|
15 | | -#[repr(align(0))] //~ ERROR: invalid `repr(align)` attribute: not a power of two |
| 27 | +#[repr(align(0))] //[notwin,win]~ ERROR: invalid `repr(align)` attribute: not a power of two |
16 | 28 | struct S4(i32); |
17 | 29 |
|
18 | | -#[repr(align(16.0))] //~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer |
| 30 | +#[repr(align(16384))] //[win]~ ERROR: alignment must not be greater than 8192 bytes for COFF targets |
| 31 | +struct S5(i32); |
| 32 | + |
| 33 | +#[repr(align(16.0))] //[notwin,win]~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer |
19 | 34 | enum E0 { A, B } |
20 | 35 |
|
21 | | -#[repr(align(15))] //~ ERROR: invalid `repr(align)` attribute: not a power of two |
| 36 | +#[repr(align(15))] //[notwin,win]~ ERROR: invalid `repr(align)` attribute: not a power of two |
22 | 37 | enum E1 { A, B } |
23 | 38 |
|
24 | | -#[repr(align(4294967296))] //~ ERROR: invalid `repr(align)` attribute: larger than 2^29 |
| 39 | +#[repr(align(4294967296))] //[notwin,win]~ ERROR: invalid `repr(align)` attribute: larger than 2^29 |
25 | 40 | enum E2 { A, B } |
26 | 41 |
|
27 | | -#[repr(align(536870912))] // ok: this is the largest accepted alignment |
| 42 | +#[repr(align(536870912))] //[win]~ ERROR: alignment must not be greater than 8192 bytes for COFF targets |
| 43 | + // notwin: this is the largest accepted alignment |
28 | 44 | enum E3 { A, B } |
29 | 45 |
|
30 | | -#[repr(align(0))] //~ ERROR: invalid `repr(align)` attribute: not a power of two |
| 46 | +#[repr(align(0))] //[notwin,win]~ ERROR: invalid `repr(align)` attribute: not a power of two |
31 | 47 | enum E4 { A, B } |
32 | 48 |
|
| 49 | +#[repr(align(16384))] //[win]~ ERROR: alignment must not be greater than 8192 bytes for COFF targets |
| 50 | +enum E5 { A, B } |
| 51 | + |
33 | 52 | fn main() {} |
0 commit comments