Add a predefine __WINT_UNSIGNED__, similar to __WCHAR_UNSIGNED__, and test them both for ARM and X86.

Use this to fully fix Sema/format-strings.c for non-x86 platforms.

Reviewed by Chandler on IRC.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156169 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c
index d1dca7e..5d8e4cb 100644
--- a/test/Sema/format-strings.c
+++ b/test/Sema/format-strings.c
@@ -339,7 +339,12 @@
   printf("%lc", 1.0); // expected-warning{{the argument has type 'double'}}
   printf("%lc", (char) 1); // no-warning
   printf("%lc", &c); // expected-warning{{the argument has type 'wint_t *'}}
+  // If wint_t and wchar_t are the same width and wint_t is signed where
+  // wchar_t is unsigned, an implicit conversion isn't possible.
+#if defined(__WINT_UNSIGNED__) || !defined(__WCHAR_UNSIGNED__) ||   \
+  __WINT_WIDTH__ > __WCHAR_WIDTH__
   printf("%lc", c2); // no-warning
+#endif
 }
 
 // <rdar://problem/8269537> -Wformat-security says NULL is not a string literal