[committed] testsuite: Fix up pr64536.c for LLP64 targets [PR108151]

Message ID Y6Be2p6281yCqfoq@tucnak
State Unresolved
Headers
Series [committed] testsuite: Fix up pr64536.c for LLP64 targets [PR108151] |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Jakub Jelinek Dec. 19, 2022, 12:53 p.m. UTC
  Hi!

The test casts a pointer to long, which is ok for ilp32 and lp64
targets but not for llp64 targets.  Nothing reads the values later,
it is a link test, so all we care about is that it is the same
cast on s390x-linux where it used to fail before the PR64536 fix,
and that we don't warn about it.

Tested on x86_64-linux -m32/-m64 and with a cross to s390x-linux,
committed to trunk as obvious.

2022-12-19  Jakub Jelinek  <jakub@redhat.com>

	PR testsuite/108151
	* gcc.dg/pr64536.c (bar): Use casts to __INTPTR_TYPE__ rather than
	long when casting pointer to integral type.


	Jakub
  

Patch

--- gcc/testsuite/gcc.dg/pr64536.c.jj	2020-01-12 11:54:37.489397175 +0100
+++ gcc/testsuite/gcc.dg/pr64536.c	2022-12-19 13:44:42.608091278 +0100
@@ -41,7 +41,7 @@  bar (int x)
 	    }
 	  else
 	    i = (long *) (h->q = *f);
-	  *c++ = (long) f;
+	  *c++ = (__INTPTR_TYPE__) f;
 	  e += 6;
 	}
       else
@@ -55,7 +55,7 @@  bar (int x)
 	    }
 	  else
 	    i = (long *) (h->q = *f);
-	  *c++ = (long) f;
+	  *c++ = (__INTPTR_TYPE__) f;
 	  e += 6;
 	}
     }