amyk created this revision.
amyk added reviewers: hubert.reinterpretcast, daltenty, thakis.
amyk added projects: clang, PowerPC.
amyk requested review of this revision.

The default wchar type is different on AIX vs. Linux. When this test is run on 
AIX,
WCHAR_T_TYPE ends up being set to `int`. This is incorrect as the default
wchar type on AIX is actually `unsigned short`, and setting the type 
incorrectly 
causes the expected errors to not be found.

This patch sets the type correctly (to `unsigned short`) for AIX.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110428

Files:
  clang/test/Sema/wchar.c


Index: clang/test/Sema/wchar.c
===================================================================
--- clang/test/Sema/wchar.c
+++ clang/test/Sema/wchar.c
@@ -4,7 +4,8 @@
 typedef __WCHAR_TYPE__ wchar_t;
 
 #if defined(_WIN32) || defined(_M_IX86) || defined(__CYGWIN__) \
- || defined(_M_X64) || defined(__ORBIS__) || defined(SHORT_WCHAR)
+ || defined(_M_X64) || defined(__ORBIS__) || defined(SHORT_WCHAR) \
+ || defined(_AIX)
   #define WCHAR_T_TYPE unsigned short
 #elif defined(__aarch64__)
   // See AArch64TargetInfo constructor -- unsigned on non-darwin non-OpenBSD 
non-NetBSD.


Index: clang/test/Sema/wchar.c
===================================================================
--- clang/test/Sema/wchar.c
+++ clang/test/Sema/wchar.c
@@ -4,7 +4,8 @@
 typedef __WCHAR_TYPE__ wchar_t;
 
 #if defined(_WIN32) || defined(_M_IX86) || defined(__CYGWIN__) \
- || defined(_M_X64) || defined(__ORBIS__) || defined(SHORT_WCHAR)
+ || defined(_M_X64) || defined(__ORBIS__) || defined(SHORT_WCHAR) \
+ || defined(_AIX)
   #define WCHAR_T_TYPE unsigned short
 #elif defined(__aarch64__)
   // See AArch64TargetInfo constructor -- unsigned on non-darwin non-OpenBSD non-NetBSD.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to