]> granicus.if.org Git - clang/commitdiff
Add a missing test for the limits on wchar
authorSean Hunt <scshunt@csclub.uwaterloo.ca>
Thu, 21 Jul 2011 22:01:12 +0000 (22:01 +0000)
committerSean Hunt <scshunt@csclub.uwaterloo.ca>
Thu, 21 Jul 2011 22:01:12 +0000 (22:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135708 91177308-0d34-0410-b5e6-96231b3b80d8

test/Headers/wchar_limits.cpp [new file with mode: 0644]

diff --git a/test/Headers/wchar_limits.cpp b/test/Headers/wchar_limits.cpp
new file mode 100644 (file)
index 0000000..704a12c
--- /dev/null
@@ -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)];