From 77195a5edb332947a991a1f0c4e915f5f1d9411f Mon Sep 17 00:00:00 2001 From: Alexander Richardson Date: Sun, 9 Feb 2025 12:18:52 -0800 Subject: [PATCH] [CSKY] Default to unsigned char This matches the ABI document found at https://github.com/c-sky/csky-doc/blob/master/C-SKY_V2_CPU_Applications_Binary_Interface_Standards_Manual.pdf Partially addresses https://github.com/llvm/llvm-project/issues/115957 Reviewed By: zixuan-wu Pull Request: https://github.com/llvm/llvm-project/pull/115961 (cherry picked from commit d2047242e6d0f0deb7634ff22ab164354c520c79) --- clang/lib/Driver/ToolChains/Clang.cpp | 1 + clang/test/Driver/csky-toolchain.c | 1 + 2 files changed, 2 insertions(+) diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index ec5ee29ece434..57b7d2bd46989 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -1358,6 +1358,7 @@ static bool isSignedCharDefault(const llvm::Triple &Triple) { return true; return false; + case llvm::Triple::csky: case llvm::Triple::hexagon: case llvm::Triple::msp430: case llvm::Triple::ppcle: diff --git a/clang/test/Driver/csky-toolchain.c b/clang/test/Driver/csky-toolchain.c index 66485464652ac..638ce64ec98cd 100644 --- a/clang/test/Driver/csky-toolchain.c +++ b/clang/test/Driver/csky-toolchain.c @@ -3,6 +3,7 @@ // RUN: %clang -### %s --target=csky 2>&1 | FileCheck -check-prefix=CC1 %s // CC1: "-cc1" "-triple" "csky" +// CC1: "-fno-signed-char" // In the below tests, --rtlib=platform is used so that the driver ignores // the configure-time CLANG_DEFAULT_RTLIB option when choosing the runtime lib