aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2024-07-24 18:00:05 +0200
committerThomas Koenig <tkoenig@gcc.gnu.org>2024-07-28 19:05:53 +0200
commit41886930c339c382cd4b5d9ea959590390bb0ac4 (patch)
treee5adcab577c6c452111c965cba5a9cb0660f7a4f
parent00fc1169f7cea8149c2a5442d07b64615cb8b336 (diff)
downloadgcc-41886930c339c382cd4b5d9ea959590390bb0ac4.zip
gcc-41886930c339c382cd4b5d9ea959590390bb0ac4.tar.gz
gcc-41886930c339c382cd4b5d9ea959590390bb0ac4.tar.bz2
testsuite: Fix up pr116034.c test for big/pdp endian [PR116061]
Didn't notice the memmove is into an int variable, so the test was still failing on big endian. 2024-07-24 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/116034 PR testsuite/116061 * gcc.dg/pr116034.c (g): Change type from int to unsigned short. (foo): Guard memmove call on __SIZEOF_SHORT__ == 2.
-rw-r--r--gcc/testsuite/gcc.dg/pr116034.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/testsuite/gcc.dg/pr116034.c b/gcc/testsuite/gcc.dg/pr116034.c
index 9a31de0..955b4c9 100644
--- a/gcc/testsuite/gcc.dg/pr116034.c
+++ b/gcc/testsuite/gcc.dg/pr116034.c
@@ -2,12 +2,13 @@
/* { dg-do run } */
/* { dg-options "-O1 -fno-strict-aliasing" } */
-int g;
+unsigned short int g;
static inline int
foo (_Complex unsigned short c)
{
- __builtin_memmove (&g, 1 + (char *) &c, 2);
+ if (__SIZEOF_SHORT__ == 2)
+ __builtin_memmove (&g, 1 + (char *) &c, 2);
return g;
}