Debian Codegraph @

gcc/testsuite/c-c++-common/pr53037-5.c

raw
1 /* PR c/53037. */
2 /* { dg-do compile } */
3 /* { dg-options "-O0 -Wno-if-not-aligned" } */
4
5 typedef unsigned long long __u64
6 __attribute__((aligned(4),warn_if_not_aligned(8)));
7
8 struct foo1
9 {
10 int i1;
11 int i2;
12 int i3;
13 __u64 x;
14 };
15
16 struct foo2
17 {
18 int i1;
19 int i2;
20 int i3;
21 __u64 x;
22 } __attribute__((aligned(8)));
23
24 struct foo3
25 {
26 int i1;
27 int i3;
28 __u64 x;
29 };
30
31 struct foo4
32 {
33 int i1;
34 int i2;
35 __u64 x;
36 } __attribute__((aligned(8)));
37
38 struct foo5
39 {
40 int i1;
41 int x __attribute__((warn_if_not_aligned(16)));
42 };
43
44 struct foo6
45 {
46 int i1;
47 int x __attribute__((warn_if_not_aligned(16)));
48 } __attribute__((aligned(16)));
49
50 struct foo7
51 {
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)));
58
59 union bar1
60 {
61 int i1;
62 __u64 x;
63 };
64
65 union bar2
66 {
67 int i1;
68 __u64 x;
69 } __attribute__((aligned(8)));
70
71 union bar3
72 {
73 int i1;
74 int x __attribute__((warn_if_not_aligned(16)));
75 };
76
77 union bar4
78 {
79 int i1;
80 int x __attribute__((warn_if_not_aligned(16)));
81 } __attribute__((aligned(16)));