[clang] [llvm] [PowerPC] Fix codegen for transparent_union function params (PR #101738)
Hubert Tong via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 19 04:12:17 PDT 2024
================
@@ -0,0 +1,67 @@
+// RUN: %clang_cc1 -triple powerpc64le-unknown-linux -O2 -target-cpu pwr7 \
+// RUN: -emit-llvm -fshort-enums %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-64
+// RUN: %clang_cc1 -triple powerpc64-unknown-linux -O2 -target-cpu pwr7 \
+// RUN: -emit-llvm -fshort-enums %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-64
+// RUN: %clang_cc1 -triple powerpc-unknown-linux -O2 -target-cpu pwr7 \
+// RUN: -emit-llvm -fshort-enums %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-32
+// RUN: %clang_cc1 -triple powerpc64-unknown-aix -O2 -target-cpu pwr7 \
+// RUN: -emit-llvm -fshort-enums %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-64
+// RUN: %clang_cc1 -triple powerpc-unknown-aix -O2 -target-cpu pwr7 \
+// RUN: -emit-llvm -fshort-enums %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-32
+
+typedef union tu_c {
+ char a;
+ char b;
----------------
hubert-reinterpretcast wrote:
Don't use plain `char` its (default) signedness is meant to be platform-dependent.
```suggestion
signed char a;
signed char b;
```
https://github.com/llvm/llvm-project/pull/101738
More information about the cfe-commits
mailing list