[clang] 7b7ae72 - [MSP430] Default to unsigned char (#115964)

via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 14 12:49:07 PST 2024


Author: Alexander Richardson
Date: 2024-11-14T12:49:02-08:00
New Revision: 7b7ae72b5863c4090bf06d1f10cd676823e02fb1

URL: https://github.com/llvm/llvm-project/commit/7b7ae72b5863c4090bf06d1f10cd676823e02fb1
DIFF: https://github.com/llvm/llvm-project/commit/7b7ae72b5863c4090bf06d1f10cd676823e02fb1.diff

LOG: [MSP430] Default to unsigned char (#115964)

This matches the ABI document at https://www.ti.com/lit/pdf/slaa534 as well as the GCC implementation.

Partially fixes https://github.com/llvm/llvm-project/issues/115957

Added: 
    clang/test/Driver/msp430-char.c

Modified: 
    clang/lib/Driver/ToolChains/Clang.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 8ca2d2006d6fb0..3133b8f5762389 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -1341,6 +1341,7 @@ static bool isSignedCharDefault(const llvm::Triple &Triple) {
     return false;
 
   case llvm::Triple::hexagon:
+  case llvm::Triple::msp430:
   case llvm::Triple::ppcle:
   case llvm::Triple::ppc64le:
   case llvm::Triple::riscv32:

diff  --git a/clang/test/Driver/msp430-char.c b/clang/test/Driver/msp430-char.c
new file mode 100644
index 00000000000000..67954e3e2a1be5
--- /dev/null
+++ b/clang/test/Driver/msp430-char.c
@@ -0,0 +1,4 @@
+/// Check that char is unsigned by default.
+// RUN: %clang -### %s --target=msp430 -c 2>&1 | FileCheck %s
+// CHECK: "-cc1" "-triple" "msp430"
+// CHECK-SAME: "-fno-signed-char"


        


More information about the cfe-commits mailing list