Mercurial > hg > CbC > CbC_gcc
view 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 |
line wrap: on
line source
/* PR c++/65690 */ /* { dg-do run } */ typedef double T[4][4] __attribute__((aligned (2 * __alignof__ (double)))); void foo (const T); struct S { T s; }; int main () { if (__alignof__ (struct S) != 2 * __alignof__ (double) || __alignof__ (T) != 2 * __alignof__ (double) || __alignof__ (const struct S) != 2 * __alignof__ (double) || __alignof__ (const T) != 2 * __alignof__ (double)) __builtin_abort (); return 0; } #if defined(__cplusplus) && __cplusplus >= 201103L static_assert (alignof (S) == 2 * __alignof__ (double), "alignment of S"); static_assert (alignof (T) == 2 * __alignof__ (double), "alignment of T"); static_assert (alignof (const S) == 2 * __alignof__ (double), "alignment of const S"); static_assert (alignof (const T) == 2 * __alignof__ (double), "alignment of const T"); #endif