annotate gcc/testsuite/c-c++-common/attr-aligned-1.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 /* PR c++/65690 */
kono
parents:
diff changeset
2 /* { dg-do run } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 typedef double T[4][4] __attribute__((aligned (2 * __alignof__ (double))));
kono
parents:
diff changeset
5 void foo (const T);
kono
parents:
diff changeset
6 struct S { T s; };
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 int
kono
parents:
diff changeset
9 main ()
kono
parents:
diff changeset
10 {
kono
parents:
diff changeset
11 if (__alignof__ (struct S) != 2 * __alignof__ (double)
kono
parents:
diff changeset
12 || __alignof__ (T) != 2 * __alignof__ (double)
kono
parents:
diff changeset
13 || __alignof__ (const struct S) != 2 * __alignof__ (double)
kono
parents:
diff changeset
14 || __alignof__ (const T) != 2 * __alignof__ (double))
kono
parents:
diff changeset
15 __builtin_abort ();
kono
parents:
diff changeset
16 return 0;
kono
parents:
diff changeset
17 }
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 #if defined(__cplusplus) && __cplusplus >= 201103L
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
20 static_assert (alignof (S) == 2 * __alignof__ (double), "alignment of S");
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
21 static_assert (alignof (T) == 2 * __alignof__ (double), "alignment of T");
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
22 static_assert (alignof (const S) == 2 * __alignof__ (double), "alignment of const S");
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
23 static_assert (alignof (const T) == 2 * __alignof__ (double), "alignment of const T");
111
kono
parents:
diff changeset
24 #endif