xref: /minix/external/bsd/llvm/dist/clang/test/Headers/c11.c (revision 4684ddb6)
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c11 %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -fmodules %s
3 // RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -ffreestanding %s
4 
5 noreturn int f(); // expected-error 1+{{}}
6 
7 #include <stdnoreturn.h>
8 #include <stdnoreturn.h>
9 #include <stdnoreturn.h>
10 
11 int g();
12 noreturn int g();
13 int noreturn g();
14 int g();
15 
16 #include <stdalign.h>
17 _Static_assert(__alignas_is_defined, "");
18 _Static_assert(__alignof_is_defined, "");
19 alignas(alignof(int)) char c[4];
20 _Static_assert(__alignof(c) == 4, "");
21 
22 #define __STDC_WANT_LIB_EXT1__ 1
23 #include <stddef.h>
24 rsize_t x = 0;
25 
26 // If we are freestanding, then also check RSIZE_MAX (in a hosted implementation
27 // we will use the host stdint.h, which may not yet have C11 support).
28 #ifndef __STDC_HOSTED__
29 #include <stdint.h>
30 rsize_t x2 = RSIZE_MAX;
31 #endif
32 
33