aboutsummaryrefslogtreecommitdiff
path: root/test/Headers
diff options
context:
space:
mode:
authorSean Hunt <scshunt@csclub.uwaterloo.ca>2011-07-21 22:01:12 +0000
committerSean Hunt <scshunt@csclub.uwaterloo.ca>2011-07-21 22:01:12 +0000
commitf818a8b598dabf924bec4c491d02cbfcfe2d0c2e (patch)
treeff9fd3c13f4b333bd2c4c837565958cac056e873 /test/Headers
parent428382c1ae2e867604ace65713345c9b6cd7e95e (diff)
Add a missing test for the limits on wchar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135708 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Headers')
-rw-r--r--test/Headers/wchar_limits.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Headers/wchar_limits.cpp b/test/Headers/wchar_limits.cpp
new file mode 100644
index 0000000000..704a12cbfa
--- /dev/null
+++ b/test/Headers/wchar_limits.cpp
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -fshort-wchar %s
+
+#include <limits.h>
+
+const bool swchar = (wchar_t)-1 > (wchar_t)0;
+
+#ifdef __WCHAR_UNSIGNED__
+int signed_test[!swchar];
+#else
+int signed_test[swchar];
+#endif
+
+int max_test[WCHAR_MAX == (swchar ? -(WCHAR_MIN+1) : (wchar_t)-1)];
+int min_test[WCHAR_MIN == (swchar ? 0 : -WCHAR_MAX-1)];