annotate gcc/testsuite/g++.dg/ext/attrib5.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // There were two related problems here, depending on the vintage. At
kono
parents:
diff changeset
2 // one time:
kono
parents:
diff changeset
3 //
kono
parents:
diff changeset
4 // typedef struct A { ... } A __attribute__ ((aligned (16)));
kono
parents:
diff changeset
5 //
kono
parents:
diff changeset
6 // would cause original_types to go into an infinite loop. At other
kono
parents:
diff changeset
7 // times, the attributes applied to an explicit typedef would be lost
kono
parents:
diff changeset
8 // (check_b3 would have a negative size).
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 // First check that the declaration is accepted and has an effect.
kono
parents:
diff changeset
11 typedef struct A { int i; } A __attribute__ ((aligned (16)));
kono
parents:
diff changeset
12 int check_A[__alignof__ (A) >= 16 ? 1 : -1];
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 // Check that the alignment is only applied to the typedef.
kono
parents:
diff changeset
15 struct B { int i; };
kono
parents:
diff changeset
16 struct B b1;
kono
parents:
diff changeset
17 typedef struct B B __attribute__((aligned (16)));
kono
parents:
diff changeset
18 struct B b2;
kono
parents:
diff changeset
19 B b3;
kono
parents:
diff changeset
20 int check_b1[__alignof__ (b1) == __alignof__ (b2) ? 1 : -1];
kono
parents:
diff changeset
21 int check_b3[__alignof__ (b3) >= 16 ? 1 : -1];