2017-01-14 22:49:29 +00:00
|
|
|
#![allow(dead_code)]
|
|
|
|
|
2017-03-25 08:00:49 +00:00
|
|
|
#[repr(align(16.0))] //~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer
|
2020-01-08 17:02:10 +00:00
|
|
|
//~| ERROR: invalid `repr(align)` attribute: not an unsuffixed integer
|
2019-05-27 05:35:48 +00:00
|
|
|
struct S0(i32);
|
2017-01-14 22:49:29 +00:00
|
|
|
|
2017-03-25 08:00:49 +00:00
|
|
|
#[repr(align(15))] //~ ERROR: invalid `repr(align)` attribute: not a power of two
|
2020-01-08 17:02:10 +00:00
|
|
|
//~| ERROR: invalid `repr(align)` attribute: not a power of two
|
2019-05-27 05:35:48 +00:00
|
|
|
struct S1(i32);
|
2017-01-14 22:49:29 +00:00
|
|
|
|
2018-05-01 20:26:23 +00:00
|
|
|
#[repr(align(4294967296))] //~ ERROR: invalid `repr(align)` attribute: larger than 2^29
|
2020-01-08 17:02:10 +00:00
|
|
|
//~| ERROR: invalid `repr(align)` attribute: larger than 2^29
|
2019-05-27 05:35:48 +00:00
|
|
|
struct S2(i32);
|
2017-01-14 22:49:29 +00:00
|
|
|
|
2018-05-01 20:26:23 +00:00
|
|
|
#[repr(align(536870912))] // ok: this is the largest accepted alignment
|
2019-05-27 05:35:48 +00:00
|
|
|
struct S3(i32);
|
|
|
|
|
2024-03-24 01:03:39 +00:00
|
|
|
#[repr(align(0))] //~ ERROR: invalid `repr(align)` attribute: not a power of two
|
|
|
|
//~| ERROR: invalid `repr(align)` attribute: not a power of two
|
|
|
|
struct S4(i32);
|
|
|
|
|
2019-05-27 05:35:48 +00:00
|
|
|
#[repr(align(16.0))] //~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer
|
2020-01-08 17:02:10 +00:00
|
|
|
//~| ERROR: invalid `repr(align)` attribute: not an unsuffixed integer
|
2019-05-27 05:35:48 +00:00
|
|
|
enum E0 { A, B }
|
2018-05-01 20:26:23 +00:00
|
|
|
|
2019-01-31 13:18:31 +00:00
|
|
|
#[repr(align(15))] //~ ERROR: invalid `repr(align)` attribute: not a power of two
|
2020-01-08 17:02:10 +00:00
|
|
|
//~| ERROR: invalid `repr(align)` attribute: not a power of two
|
2019-05-27 05:35:48 +00:00
|
|
|
enum E1 { A, B }
|
|
|
|
|
|
|
|
#[repr(align(4294967296))] //~ ERROR: invalid `repr(align)` attribute: larger than 2^29
|
2020-01-08 17:02:10 +00:00
|
|
|
//~| ERROR: invalid `repr(align)` attribute: larger than 2^29
|
2019-05-27 05:35:48 +00:00
|
|
|
enum E2 { A, B }
|
|
|
|
|
|
|
|
#[repr(align(536870912))] // ok: this is the largest accepted alignment
|
|
|
|
enum E3 { A, B }
|
2019-01-31 13:18:31 +00:00
|
|
|
|
2024-03-24 01:03:39 +00:00
|
|
|
#[repr(align(0))] //~ ERROR: invalid `repr(align)` attribute: not a power of two
|
|
|
|
//~| ERROR: invalid `repr(align)` attribute: not a power of two
|
|
|
|
enum E4 { A, B }
|
|
|
|
|
2017-01-14 22:49:29 +00:00
|
|
|
fn main() {}
|