112a9d9c8Sopenharmony_ci// bindgen-flags: --raw-line '#![cfg(feature = "nightly")]' --rust-target 1.33
212a9d9c8Sopenharmony_ci
312a9d9c8Sopenharmony_ci/// This should not be opaque; we can see the attributes and can pack the
412a9d9c8Sopenharmony_ci/// struct.
512a9d9c8Sopenharmony_cistruct AlignedToOne {
612a9d9c8Sopenharmony_ci    int i;
712a9d9c8Sopenharmony_ci} __attribute__ ((packed,aligned(1)));
812a9d9c8Sopenharmony_ci
912a9d9c8Sopenharmony_ci/// This should be be packed because Rust 1.33 has `#[repr(packed(N))]`.
1012a9d9c8Sopenharmony_cistruct AlignedToTwo {
1112a9d9c8Sopenharmony_ci    int i;
1212a9d9c8Sopenharmony_ci} __attribute__ ((packed,aligned(2)));
1312a9d9c8Sopenharmony_ci
1412a9d9c8Sopenharmony_ci#pragma pack(1)
1512a9d9c8Sopenharmony_ci
1612a9d9c8Sopenharmony_ci/// This should not be opaque because although `libclang` doesn't give us the
1712a9d9c8Sopenharmony_ci/// `#pragma pack(1)`, we can detect that alignment is 1 and add
1812a9d9c8Sopenharmony_ci/// `#[repr(packed)]` to the struct ourselves.
1912a9d9c8Sopenharmony_cistruct PackedToOne {
2012a9d9c8Sopenharmony_ci    int x;
2112a9d9c8Sopenharmony_ci    int y;
2212a9d9c8Sopenharmony_ci};
2312a9d9c8Sopenharmony_ci
2412a9d9c8Sopenharmony_ci#pragma pack()
2512a9d9c8Sopenharmony_ci
2612a9d9c8Sopenharmony_ci#pragma pack(2)
2712a9d9c8Sopenharmony_ci
2812a9d9c8Sopenharmony_ci/// This should be be packed because Rust 1.33 has `#[repr(packed(N))]`.
2912a9d9c8Sopenharmony_cistruct PackedToTwo {
3012a9d9c8Sopenharmony_ci    int x;
3112a9d9c8Sopenharmony_ci    int y;
3212a9d9c8Sopenharmony_ci};
3312a9d9c8Sopenharmony_ci
3412a9d9c8Sopenharmony_ci#pragma pack()
35