diff options
author | Oliver Stannard <oliver.stannard@arm.com> | 2014-10-24 11:28:47 +0000 |
---|---|---|
committer | Oliver Stannard <oliver.stannard@arm.com> | 2014-10-24 11:28:47 +0000 |
commit | abed2eeaeaf920d19c879f8888cc6546520c7d12 (patch) | |
tree | e4dc8a49d6111523bdd1422b34aa2ef2c7555394 | |
parent | a836924be45ff44059e915aec53787fc8432f4e4 (diff) | |
download | bcm5719-llvm-abed2eeaeaf920d19c879f8888cc6546520c7d12.tar.gz bcm5719-llvm-abed2eeaeaf920d19c879f8888cc6546520c7d12.zip |
[Thumb] Clang thinks "char" is signed when using a thumb triple
'char' is unsigned on all ARM and Thumb architectures. Clang gets this
right for ARM, and for thumb when using and arm triple and the -mthumb
option, but gets it wrong for thumb triples. This fixes that.
llvm-svn: 220555
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 2 | ||||
-rw-r--r-- | clang/test/Lexer/wchar-signedness.c | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index e34fd5c9e43..fb2485d6400 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -459,6 +459,8 @@ static bool isSignedCharDefault(const llvm::Triple &Triple) { case llvm::Triple::aarch64_be: case llvm::Triple::arm: case llvm::Triple::armeb: + case llvm::Triple::thumb: + case llvm::Triple::thumbeb: if (Triple.isOSDarwin() || Triple.isOSWindows()) return true; return false; diff --git a/clang/test/Lexer/wchar-signedness.c b/clang/test/Lexer/wchar-signedness.c index b5d4ac8f000..1d8bc4d5dd0 100644 --- a/clang/test/Lexer/wchar-signedness.c +++ b/clang/test/Lexer/wchar-signedness.c @@ -1,5 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -dM -E %s -triple x86_64-none-linux-gnu | FileCheck %s --check-prefix=CHECK-X86 // RUN: %clang_cc1 -fsyntax-only -dM -E %s -triple armv7-none-eabi | FileCheck %s --check-prefix=CHECK-ARM +// RUN: %clang_cc1 -fsyntax-only -dM -E %s -triple thumbv7-none-eabi | FileCheck %s --check-prefix=CHECK-ARM // CHECK-X86-NOT: #define __WCHAR_UNSIGNED__ // CHECK-X86: #define __WINT_UNSIGNED__ 1 |