The test case logic relies on the constant literal -4 being promoted to
32-bit int.  But on AVR and other targets with 16-bit int types, the
literal is promoted to 16-bit int, which changes the expression value
and ultimately failing the test:

  FAIL: gcc.dg/pr122925.c execution test

Fix by requiring an effective target with at least 32-bit ints.

Ok for trunk? The test was added in stage 4, so I think it's reasonable
to fix now.

gcc/testsuite/ChangeLog:

        * gcc.dg/pr122925.c: Require int32plus effective target.

Cc: H.J. Lu <[email protected]>
Signed-off-by: Dimitar Dimitrov <[email protected]>
---
 gcc/testsuite/gcc.dg/pr122925.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/pr122925.c b/gcc/testsuite/gcc.dg/pr122925.c
index 1f27af14a58..8aebad6c7bc 100644
--- a/gcc/testsuite/gcc.dg/pr122925.c
+++ b/gcc/testsuite/gcc.dg/pr122925.c
@@ -1,4 +1,4 @@
-/* { dg-do run } */
+/* { dg-do run { target int32plus } } */
 /* { dg-options "-O2" } */
 
 typedef __UINT64_TYPE__ uint64_t;
-- 
2.53.0

Reply via email to