diff options
author | Daniel Dunbar <daniel@zuster.org> | 2013-04-12 23:41:08 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2013-04-12 23:41:08 +0000 |
commit | 50b8b5507b345bc95111ed7f1e11036e3a849ac1 (patch) | |
tree | 845872485aed9844318b0e9d40de898b474e796a | |
parent | 7af0aa86dd13d69cf3247ab80030dae643c66154 (diff) | |
download | bcm5719-llvm-50b8b5507b345bc95111ed7f1e11036e3a849ac1.tar.gz bcm5719-llvm-50b8b5507b345bc95111ed7f1e11036e3a849ac1.zip |
Headers: Don't try to use RSIZE_MAX unless we are freestanding.
- We don't want to depend on the platforms stdint.h.
llvm-svn: 179429
-rw-r--r-- | clang/test/Headers/c11.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/test/Headers/c11.c b/clang/test/Headers/c11.c index 7d859fc5f0c..ebe2123a2fc 100644 --- a/clang/test/Headers/c11.c +++ b/clang/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 + |