[clang] [Xtensa] Default to unsigned char (PR #115967)
Alexander Richardson via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 12 16:24:21 PST 2024
https://github.com/arichardson created https://github.com/llvm/llvm-project/pull/115967
This matches GCC.
Partially fixes https://github.com/llvm/llvm-project/pull/115964
>From e428a45e9638d0d310bd21e46acf4175b09815c9 Mon Sep 17 00:00:00 2001
From: Alex Richardson <alexrichardson at google.com>
Date: Tue, 12 Nov 2024 16:24:08 -0800
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
=?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Created using spr 1.3.6-beta.1
---
clang/lib/Driver/ToolChains/Clang.cpp | 1 +
clang/test/Driver/xtensa-char.c | 4 ++++
2 files changed, 5 insertions(+)
create mode 100644 clang/test/Driver/xtensa-char.c
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 0952262c360185..29954bfbc560c1 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -1347,6 +1347,7 @@ static bool isSignedCharDefault(const llvm::Triple &Triple) {
case llvm::Triple::riscv64:
case llvm::Triple::systemz:
case llvm::Triple::xcore:
+ case llvm::Triple::xtensa:
return false;
}
}
diff --git a/clang/test/Driver/xtensa-char.c b/clang/test/Driver/xtensa-char.c
new file mode 100644
index 00000000000000..13f8f67727e75d
--- /dev/null
+++ b/clang/test/Driver/xtensa-char.c
@@ -0,0 +1,4 @@
+/// Check that char is unsigned by default.
+// RUN: %clang -### %s --target=xtensa -c 2>&1 | FileCheck %s
+// CHECK: "-cc1" "-triple" "xtensa"
+// CHECK-SAME: "-fno-signed-char"
More information about the cfe-commits
mailing list