[llvm-branch-commits] [clang] release/20.x: [CSKY] Default to unsigned char (PR #126436)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Feb 9 12:33:24 PST 2025


https://github.com/llvmbot created https://github.com/llvm/llvm-project/pull/126436

Backport d2047242e6d0f0deb7634ff22ab164354c520c79

Requested by: @arichardson

>From 667cb0192d9b32ca15d58ad83285c735d4363f26 Mon Sep 17 00:00:00 2001
From: Alexander Richardson <alexrichardson at google.com>
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 589de953be5be1b..49c6d2b271b3812 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 66485464652ac87..638ce64ec98cde3 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



More information about the llvm-branch-commits mailing list