2 /* { dg-do compile } */
3 /* { dg-options "-O0" } */
5 typedef unsigned long long __u64
6 __attribute__((aligned(4),warn_if_not_aligned(8)));
13 __u64 x
; /* { dg-warning "'x' offset 12 in 'struct foo1' isn't aligned to 8" } */
14 }; /* { dg-warning "alignment 4 of 'struct foo1' is less than 8" } */
21 __u64 x
; /* { dg-warning "'x' offset 12 in 'struct foo2' isn't aligned to 8" } */
22 } __attribute__((aligned(8)));
29 }; /* { dg-warning "alignment 4 of 'struct foo3' is less than 8" } */
36 } __attribute__((aligned(8)));
41 int x
__attribute__((warn_if_not_aligned(16))); /* { dg-warning "'x' offset 4 in 'struct foo5' isn't aligned to 16" } */
42 }; /* { dg-warning "alignment 4 of 'struct foo5' is less than 16" } */
47 int x
__attribute__((warn_if_not_aligned(16))); /* { dg-warning "'x' offset 4 in 'struct foo6' isn't aligned to 16" } */
48 } __attribute__((aligned(16)));
56 int x
__attribute__((warn_if_not_aligned(16)));
57 } __attribute__((aligned(16)));
63 }; /* { dg-warning "alignment 4 of 'union bar1' is less than 8" } */
69 } __attribute__((aligned(8)));
74 int x
__attribute__((warn_if_not_aligned(16)));
75 }; /* { dg-warning "alignment 4 of 'union bar3' is less than 16" } */
80 int x
__attribute__((warn_if_not_aligned(16)));
81 } __attribute__((aligned(16)));