PR lto/84212 - -Wno-* does not disable warnings from -flto link stage
[official-gcc.git] / gcc / testsuite / g++.dg / pr53037-1.C
bloba3d8f99b54e2e8c0d5b5cc2e543f933650827cc9
1 /* PR c/53037.  */
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" } */
10   int i1;
11   int i2;
12   int i3;
13   __u64 x; /* { dg-warning "'foo1::x' offset 12 in 'foo1' isn't aligned to 8" } */
16 struct foo2
18   int i1;
19   int i2;
20   int i3;
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" } */
26   int i1;
27   int i3;
28   __u64 x;
31 struct foo4
33   int i1;
34   int i2;
35   __u64 x;
36 } __attribute__((aligned(8)));
38 struct foo5 /* { dg-warning "alignment 4 of 'foo5' is less than 16" } */
40   int i1;
41   int x __attribute__((warn_if_not_aligned(16))); /* { dg-warning "'foo5::x' offset 4 in 'foo5' isn't aligned to 16" } */
44 struct foo6
46   int i1;
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)));
50 struct foo7
52   int i1;
53   int i2;
54   int i3;
55   int i4;
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" } */
61   int i1;
62   __u64 x;
65 union bar2
67   int i1;
68   __u64 x;
69 } __attribute__((aligned(8)));
71 union bar3 /* { dg-warning "alignment 4 of 'bar3' is less than 16" } */
73   int i1;
74   int x __attribute__((warn_if_not_aligned(16))); 
77 union bar4
79   int i1;
80   int x __attribute__((warn_if_not_aligned(16)));
81 } __attribute__((aligned(16)));