[testsuite,pushed] Fix sloppy PR120277 test

Message ID 77085172-5f5c-4164-8489-7fd5bb3204be@gjlay.de
State New
Headers
Series [testsuite,pushed] Fix sloppy PR120277 test |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_simplebootstrap_build--master-aarch64-bootstrap fail Patch failed to apply
linaro-tcwg-bot/tcwg_simplebootstrap_build--master-arm-bootstrap fail Patch failed to apply

Commit Message

Georg-Johann Lay Sept. 1, 2026, 5:50 p.m. UTC
  gcc.dg/pr120277.c files with

FAIL: gcc.dg/pr120277.c (test for excess errors)
Excess errors:
gcc.dg/pr120277.c:14:4: warning: cast to pointer from integer of 
different size [-Wint-to-pointer-cast]

hence using __INTPTR_TYPE__ in involved variables.

Johann

--

gcc/testsuite/
	PR testsuite/120277
	* gcc.dg/pr120277.c (e): Use __INTPTR_TYPE__ instead of long.
  

Patch

diff --git a/gcc/testsuite/gcc.dg/pr120277.c 
b/gcc/testsuite/gcc.dg/pr120277.c
index f291e920db1..69d93692f0e 100644
--- a/gcc/testsuite/gcc.dg/pr120277.c
+++ b/gcc/testsuite/gcc.dg/pr120277.c
@@ -2,7 +2,7 @@ 
  /* { dg-options "-O2" } */

  int a, b;
-int c(int d, long e) {
+int c(int d, __INTPTR_TYPE__ e) {
    switch (d) {
    case 129:
      a = 1;
@@ -13,7 +13,7 @@  int c(int d, long e) {
    }
    *(int *)e = 0;
  }
-void f(int d, long e) { c(d, e); }
+void f(int d, __INTPTR_TYPE__ e) { c(d, e); }
  void g() {
    int h = b * sizeof(int);
    f(h + 7, h);