Skip to content

Commit f4269a9

Browse files
committed
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 <[email protected]> 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. (cherry picked from commit 69e6984)
1 parent aa586d7 commit f4269a9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gcc/testsuite/gcc.dg/pr116034.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
/* { dg-do run } */
33
/* { dg-options "-O1 -fno-strict-aliasing" } */
44

5-
int g;
5+
unsigned short int g;
66

77
static inline int
88
foo (_Complex unsigned short c)
99
{
10-
__builtin_memmove (&g, 1 + (char *) &c, 2);
10+
if (__SIZEOF_SHORT__ == 2)
11+
__builtin_memmove (&g, 1 + (char *) &c, 2);
1112
return g;
1213
}
1314

0 commit comments

Comments
 (0)