diff options
Diffstat (limited to 'test/Headers/c11.c')
-rw-r--r-- | test/Headers/c11.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Headers/c11.c b/test/Headers/c11.c index f65164d1..21f2e4f 100644 --- a/test/Headers/c11.c +++ b/test/Headers/c11.c @@ -1,5 +1,6 @@ // RUN: %clang -fsyntax-only -Xclang -verify -std=c11 %s // RUN: %clang -fsyntax-only -Xclang -verify -std=c11 -fmodules %s +// RUN: %clang -fsyntax-only -Xclang -verify -std=c11 -ffreestanding %s noreturn int f(); // expected-error 1+{{}} @@ -17,3 +18,15 @@ _Static_assert(__alignas_is_defined, ""); _Static_assert(__alignof_is_defined, ""); alignas(alignof(int)) char c[4]; _Static_assert(__alignof(c) == 4, ""); + +#define __STDC_WANT_LIB_EXT1__ 1 +#include <stddef.h> +rsize_t x = 0; + +// If we are freestanding, then also check RSIZE_MAX (in a hosted implementation +// we will use the host stdint.h, which may not yet have C11 support). +#ifndef __STDC_HOSTED__ +#include <stdint.h> +rsize_t x2 = RSIZE_MAX; +#endif + |