1 /* Test C11 alignment support.  Test valid code.  */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c11 -pedantic-errors" } */
4 
5 #include <stddef.h>
6 
7 _Alignas (_Alignof (max_align_t)) char c;
8 extern _Alignas (max_align_t) char c;
9 extern char c;
10 
11 extern _Alignas (max_align_t) short s;
12 _Alignas (max_align_t) short s;
13 
14 _Alignas (int) int i;
15 extern int i;
16 
17 _Alignas (max_align_t) long l;
18 
19 _Alignas (max_align_t) long long ll;
20 
21 _Alignas (max_align_t) float f;
22 
23 _Alignas (max_align_t) double d;
24 
25 _Alignas (max_align_t) _Complex long double cld;
26 
27 _Alignas (0) _Alignas (int) _Alignas (char) char ca[10];
28 
29 _Alignas ((int) _Alignof (max_align_t) + 0) int x;
30 
31 enum e { E = _Alignof (max_align_t) };
_Alignas(E)32 _Alignas (E) int y;
33 
34 void
35 func (void)
36 {
37   _Alignas (max_align_t) long long auto_ll;
38 }
39 
40 /* Valid, but useless.  */
41 _Alignas (0) struct s; /* { dg-warning "useless" } */
42