diff options
author | dim <dim@FreeBSD.org> | 2013-06-10 20:45:12 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-06-10 20:45:12 +0000 |
commit | ea266cad53e3d49771fa38103913d3ec7a166694 (patch) | |
tree | 8f7776b7310bebaf415ac5b69e46e9f928c37144 /test/Headers | |
parent | c72c57c9e9b69944e3e009cd5e209634839581d3 (diff) | |
download | FreeBSD-src-ea266cad53e3d49771fa38103913d3ec7a166694.zip FreeBSD-src-ea266cad53e3d49771fa38103913d3ec7a166694.tar.gz |
Vendor import of clang tags/RELEASE_33/final r183502 (effectively, 3.3
release):
http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_33/final@183502
Diffstat (limited to 'test/Headers')
-rw-r--r-- | test/Headers/c11.c | 13 | ||||
-rw-r--r-- | test/Headers/cxx11.cpp | 7 | ||||
-rw-r--r-- | test/Headers/ms-wchar.c | 15 |
3 files changed, 35 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 + diff --git a/test/Headers/cxx11.cpp b/test/Headers/cxx11.cpp index 41bdc76..54fe350 100644 --- a/test/Headers/cxx11.cpp +++ b/test/Headers/cxx11.cpp @@ -13,3 +13,10 @@ static_assert(__alignas_is_defined, ""); static_assert(__alignof_is_defined, ""); + + +#include <stdint.h> + +#ifndef SIZE_MAX +#error SIZE_MAX should be defined in C++ +#endif diff --git a/test/Headers/ms-wchar.c b/test/Headers/ms-wchar.c new file mode 100644 index 0000000..f015fc7 --- /dev/null +++ b/test/Headers/ms-wchar.c @@ -0,0 +1,15 @@ +// RUN: %clang -fsyntax-only -target i386-pc-win32 %s + +#if defined(_WCHAR_T_DEFINED) +#error "_WCHAR_T_DEFINED should not be defined in C99" +#endif + +#include <stddef.h> + +#if !defined(_WCHAR_T_DEFINED) +#error "_WCHAR_T_DEFINED should have been set by stddef.h" +#endif + +#if defined(_NATIVE_WCHAR_T_DEFINED) +#error "_NATIVE_WCHAR_T_DEFINED should not be defined" +#endif |