aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2013-04-12 23:41:08 +0000
committerDaniel Dunbar <daniel@zuster.org>2013-04-12 23:41:08 +0000
commitdd9bd3ba42ecc3c91ba36f194b993a99371ab825 (patch)
tree52531abd3ce7ec7e0b8223322b9e92c091b2ab24
parent9df151c5bc2a746096632bbd21dc61e18675ed55 (diff)
Headers: Don't try to use RSIZE_MAX unless we are freestanding.
- We don't want to depend on the platforms stdint.h. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179429 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Headers/c11.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/Headers/c11.c b/test/Headers/c11.c
index 7d859fc5f0..ebe2123a2f 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+{{}}
@@ -21,4 +22,11 @@ _Static_assert(__alignof(c) == 4, "");
#define __STDC_WANT_LIB_EXT1__ 1
#include <stddef.h>
#include <stdint.h>
-rsize_t x = RSIZE_MAX;
+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__
+rsize_t x2 = RSIZE_MAX;
+#endif
+