[clang] 49dbde9 - [AIX] Define WCHAR_T_TYPE as unsigned short on AIX for wchar.c test case.
Amy Kwan via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 6 07:27:06 PDT 2021
Author: Amy Kwan
Date: 2021-10-06T08:49:37-05:00
New Revision: 49dbde9c9e5149bcc8b906f7dbd040be76a2a267
URL: https://github.com/llvm/llvm-project/commit/49dbde9c9e5149bcc8b906f7dbd040be76a2a267
DIFF: https://github.com/llvm/llvm-project/commit/49dbde9c9e5149bcc8b906f7dbd040be76a2a267.diff
LOG: [AIX] Define WCHAR_T_TYPE as unsigned short on AIX for wchar.c test case.
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.
Differential Revision: https://reviews.llvm.org/D110428
Added:
Modified:
clang/test/Sema/wchar.c
Removed:
################################################################################
diff --git a/clang/test/Sema/wchar.c b/clang/test/Sema/wchar.c
index 83ea6372168d6..fff12442ed543 100644
--- a/clang/test/Sema/wchar.c
+++ b/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) && !defined(__64BIT__))
#define WCHAR_T_TYPE unsigned short
#elif defined(__aarch64__)
// See AArch64TargetInfo constructor -- unsigned on non-darwin non-OpenBSD non-NetBSD.
More information about the cfe-commits
mailing list