aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKewen Lin <linkw@linux.ibm.com>2024-08-13 21:25:13 -0500
committerKewen Lin <linkw@gcc.gnu.org>2024-08-13 21:25:13 -0500
commit10972e6fb59cf83e12dcf7d5d6db01aa8e38dc52 (patch)
tree0217f9cee1e3a5c694d2ac4a5501037c0717cdbe
parentc3c83d22d212a35cb1bfb8727477819463f0dcd8 (diff)
downloadgcc-10972e6fb59cf83e12dcf7d5d6db01aa8e38dc52.zip
gcc-10972e6fb59cf83e12dcf7d5d6db01aa8e38dc52.tar.gz
gcc-10972e6fb59cf83e12dcf7d5d6db01aa8e38dc52.tar.bz2
testsuite: Fix fam-in-union-alone-in-struct-2.c with unsigned char [PR116148]
As PR116148#c7 shows, fam-in-union-alone-in-struct-2.c still fails on hppa which is a BE environment, but by checking more (also confirmed by John in PR116148#c12), it's due to that signedness of plain char on hppa is signed therefore the value of with_fam_3_v.a[7] "8f" get sign extended as "ffffff8f" then the verification will fail. This patch is to change plain char with unsigned char to avoid that. PR testsuite/116148 gcc/testsuite/ChangeLog: * c-c++-common/fam-in-union-alone-in-struct-2.c: Change the type of member a[] of union with_fam_3 with unsigned char.
-rw-r--r--gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-2.c b/gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-2.c
index 7845a7f..49960a3 100644
--- a/gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-2.c
+++ b/gcc/testsuite/c-c++-common/fam-in-union-alone-in-struct-2.c
@@ -14,7 +14,7 @@ union with_fam_2 {
} with_fam_2_v = {.a = 0x1f2f3f4f};
union with_fam_3 {
- char a[];
+ unsigned char a[];
int b[];
} with_fam_3_v = {.b = {0x1f2f3f4f, 0x5f6f7f8f}};