Skip to content

Commit

Permalink
testsuite: Fix up pr116034.c test for big/pdp endian [PR116061]
Browse files Browse the repository at this point in the history
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.

(cherry picked from commit 69e6984)
  • Loading branch information
jakubjelinek committed Jul 24, 2024
1 parent ab03866 commit 181f40f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gcc/testsuite/gcc.dg/pr116034.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 181f40f

Please sign in to comment.