| 1 |
/* Test C11 alignment support. Test code valid after the resolution |
| 2 |
of DR#444: alignment specifiers for struct and union members and |
| 3 |
compound literals. */ |
| 4 |
/* { dg-do compile } */ |
| 5 |
/* { dg-options "-std=c11 -pedantic-errors" } */ |
| 6 |
|
| 7 |
#include <stddef.h> |
| 8 |
|
| 9 |
struct s |
| 10 |
{ |
| 11 |
_Alignas (_Alignof (max_align_t)) char c; |
| 12 |
}; |
| 13 |
|
| 14 |
union u |
| 15 |
{ |
| 16 |
_Alignas (_Alignof (max_align_t)) char c; |
| 17 |
}; |
| 18 |
|
| 19 |
char *p = &(_Alignas (_Alignof (max_align_t)) char) { 1 }; |
| 20 |
size_t size = sizeof (_Alignas (_Alignof (max_align_t)) char) { 1 }; |