Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / c11-align-1.c
blobe0058c3800760dbdcbbc9dcf78799f66f230634b
1 /* Test C11 alignment support. Test valid code. */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c11 -pedantic-errors" } */
5 #include <stddef.h>
7 _Alignas (_Alignof (max_align_t)) char c;
8 extern _Alignas (max_align_t) char c;
9 extern char c;
11 extern _Alignas (max_align_t) short s;
12 _Alignas (max_align_t) short s;
14 _Alignas (int) int i;
15 extern int i;
17 _Alignas (max_align_t) long l;
19 _Alignas (max_align_t) long long ll;
21 _Alignas (max_align_t) float f;
23 _Alignas (max_align_t) double d;
25 _Alignas (max_align_t) _Complex long double cld;
27 _Alignas (0) _Alignas (int) _Alignas (char) char ca[10];
29 _Alignas ((int) _Alignof (max_align_t) + 0) int x;
31 enum e { E = _Alignof (max_align_t) };
32 _Alignas (E) int y;
34 void
35 func (void)
37 _Alignas (max_align_t) long long auto_ll;
40 /* Valid, but useless. */
41 _Alignas (0) struct s; /* { dg-warning "useless" } */