annotate gcc/testsuite/g++.dg/cpp0x/gen-attrs-5.C @ 131:84e7813d76e9

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