diff mbox series

[committed] testsuite: Fix up pr116034.c test for big/pdp endian [PR116061]

Message ID ZqEuv4Wb23zacpqJ@tucnak
State New
Headers show
Series [committed] testsuite: Fix up pr116034.c test for big/pdp endian [PR116061] | expand

Commit Message

Jakub Jelinek July 24, 2024, 4:41 p.m. UTC
Hi!

Didn't notice the memmove is into an int variable, so the test
was still failing on big endian.

Committed to trunk as obvious.

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.


	Jakub
diff mbox series

Patch

--- gcc/testsuite/gcc.dg/pr116034.c.jj	2024-07-23 10:50:10.878953531 +0200
+++ gcc/testsuite/gcc.dg/pr116034.c	2024-07-24 17:57:37.377829853 +0200
@@ -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;
 }