PR tree-optimization/86401
[official-gcc.git] / gcc / testsuite / c-c++-common / attr-aligned-1.c
blob26b62393ac0a7d6ced767013bdb635f8b21db9e6
1 /* PR c++/65690 */
2 /* { dg-do run } */
4 typedef double T[4][4] __attribute__((aligned (2 * __alignof__ (double))));
5 void foo (const T);
6 struct S { T s; };
8 int
9 main ()
11 if (__alignof__ (struct S) != 2 * __alignof__ (double)
12 || __alignof__ (T) != 2 * __alignof__ (double)
13 || __alignof__ (const struct S) != 2 * __alignof__ (double)
14 || __alignof__ (const T) != 2 * __alignof__ (double))
15 __builtin_abort ();
16 return 0;
19 #if defined(__cplusplus) && __cplusplus >= 201103L
20 static_assert (alignof (S) == 2 * __alignof__ (double), "alignment of S");
21 static_assert (alignof (T) == 2 * __alignof__ (double), "alignment of T");
22 static_assert (alignof (const S) == 2 * __alignof__ (double), "alignment of const S");
23 static_assert (alignof (const T) == 2 * __alignof__ (double), "alignment of const T");
24 #endif