1 // bindgen-flags: --raw-line '#![cfg(feature = "nightly")]' --rust-target 1.33
2 
3 /// This should not be opaque; we can see the attributes and can pack the
4 /// struct.
5 struct AlignedToOne {
6     int i;
7 } __attribute__ ((packed,aligned(1)));
8 
9 /// This should be be packed because Rust 1.33 has `#[repr(packed(N))]`.
10 struct AlignedToTwo {
11     int i;
12 } __attribute__ ((packed,aligned(2)));
13 
14 #pragma pack(1)
15 
16 /// This should not be opaque because although `libclang` doesn't give us the
17 /// `#pragma pack(1)`, we can detect that alignment is 1 and add
18 /// `#[repr(packed)]` to the struct ourselves.
19 struct PackedToOne {
20     int x;
21     int y;
22 };
23 
24 #pragma pack()
25 
26 #pragma pack(2)
27 
28 /// This should be be packed because Rust 1.33 has `#[repr(packed(N))]`.
29 struct PackedToTwo {
30     int x;
31     int y;
32 };
33 
34 #pragma pack()
35