From 7671789c9cccdfc8e6daef2a96f615a567b59980 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Wed, 12 Nov 2003 12:19:10 +0100 Subject: [PATCH] c99-const-expr-2.c (foo): Avoid extra warning on 64-bit systems. * gcc.dg/c99-const-expr-2.c (foo): Avoid extra warning on 64-bit systems. Co-Authored-By: Andrew Pinski Co-Authored-By: Jakub Jelinek Co-Authored-By: Richard Henderson From-SVN: r73490 --- gcc/testsuite/ChangeLog | 1 + gcc/testsuite/gcc.dg/c99-const-expr-2.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7bd8ab2736f..56583933717 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -5,6 +5,7 @@ * gcc.dg/c90-const-expr-2.c (foo): Avoid extra warning on 64-bit systems. + * gcc.dg/c99-const-expr-2.c (foo): Likewise. * gcc.dg/20030926-1.c: Make it work on x86_64 systems. * gcc.dg/i386-pentium4-not-mull.c: Likewise. diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-2.c b/gcc/testsuite/gcc.dg/c99-const-expr-2.c index 1ba1b4a674a..1a457e51a7d 100644 --- a/gcc/testsuite/gcc.dg/c99-const-expr-2.c +++ b/gcc/testsuite/gcc.dg/c99-const-expr-2.c @@ -14,6 +14,12 @@ int *a; int b; long *c; +#ifdef _LP64 +#define ZERO 0L +#else +#define ZERO 0 +#endif + /* Assertion that n is a null pointer constant: so the conditional expression has type 'int *' instead of 'void *'. */ @@ -30,7 +36,7 @@ foo (void) ASSERT_NPC ((void *)0); ASSERT_NOT_NPC ((void *)(void *)0); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ ASSERT_NOT_NPC ((void *)(char *)0); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ - ASSERT_NOT_NPC ((void *)(0, 0)); /* { dg-bogus "incompatible" "bogus null pointer constant" } */ + ASSERT_NOT_NPC ((void *)(0, ZERO)); /* { dg-bogus "incompatible" "bogus null pointer constant" } */ ASSERT_NOT_NPC ((void *)(&"Foobar"[0] - &"Foobar"[0])); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ /* This last one is a null pointer constant in C99 only. */ ASSERT_NPC ((void *)(1 ? 0 : (0, 0))); -- 2.30.2