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