From 2c4ea36c875435ef58616cda4c7691123491b262 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 17 Jan 2005 18:55:56 +0000 Subject: [PATCH] re PR c/5675 (const variables wrongly considered part of constant expressions (gcc.dg/c9[09]-const-expr-3.c)) PR c/5675 * gcc.dg/c90-const-expr-3.c: Remove xfails on tests which now pass--those that refer just to the variable, possibly with a cast. * gcc.dg/c99-const-expr-3.c: Likewise. From-SVN: r93770 --- gcc/testsuite/ChangeLog | 8 +++++++- gcc/testsuite/gcc.dg/c90-const-expr-3.c | 8 ++++---- gcc/testsuite/gcc.dg/c99-const-expr-3.c | 8 ++++---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 99e86e2..9f39f00 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,10 @@ -2005-01-16 Ian Lance Taylor +2005-01-17 Ian Lance Taylor + + PR c/5675 + * gcc.dg/c90-const-expr-3.c: Remove xfails on tests which now + pass--those that refer just to the variable, possibly with a + cast. + * gcc.dg/c99-const-expr-3.c: Likewise. PR middle-end/13127 * gcc.dg/20040206-1.c: Remove xfail on bogus warning which is no diff --git a/gcc/testsuite/gcc.dg/c90-const-expr-3.c b/gcc/testsuite/gcc.dg/c90-const-expr-3.c index 75c8bff..0fda68e 100644 --- a/gcc/testsuite/gcc.dg/c90-const-expr-3.c +++ b/gcc/testsuite/gcc.dg/c90-const-expr-3.c @@ -26,7 +26,7 @@ void foo (void) { ASSERT_NPC (0); - ASSERT_NOT_NPC (ZERO); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ + ASSERT_NOT_NPC (ZERO); ASSERT_NPC (0 + 0); ASSERT_NOT_NPC (ZERO + 0); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ ASSERT_NOT_NPC (ZERO + ZERO); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ @@ -35,11 +35,11 @@ foo (void) ASSERT_NPC (-0); ASSERT_NOT_NPC (-ZERO); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ ASSERT_NPC ((char) 0); - ASSERT_NOT_NPC ((char) ZERO); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ + ASSERT_NOT_NPC ((char) ZERO); ASSERT_NPC ((int) 0); - ASSERT_NOT_NPC ((int) ZERO); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ + ASSERT_NOT_NPC ((int) ZERO); ASSERT_NPC ((int) 0.0); - ASSERT_NOT_NPC ((int) DZERO); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ + ASSERT_NOT_NPC ((int) DZERO); ASSERT_NOT_NPC ((int) +0.0); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ ASSERT_NOT_NPC ((int) (0.0+0.0)); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ ASSERT_NOT_NPC ((int) (double)0.0); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-3.c b/gcc/testsuite/gcc.dg/c99-const-expr-3.c index cbf6da3..f230603 100644 --- a/gcc/testsuite/gcc.dg/c99-const-expr-3.c +++ b/gcc/testsuite/gcc.dg/c99-const-expr-3.c @@ -25,7 +25,7 @@ void foo (void) { ASSERT_NPC (0); - ASSERT_NOT_NPC (ZERO); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ + ASSERT_NOT_NPC (ZERO); ASSERT_NPC (0 + 0); ASSERT_NOT_NPC (ZERO + 0); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ ASSERT_NOT_NPC (ZERO + ZERO); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ @@ -34,11 +34,11 @@ foo (void) ASSERT_NPC (-0); ASSERT_NOT_NPC (-ZERO); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ ASSERT_NPC ((char) 0); - ASSERT_NOT_NPC ((char) ZERO); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ + ASSERT_NOT_NPC ((char) ZERO); ASSERT_NPC ((int) 0); - ASSERT_NOT_NPC ((int) ZERO); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ + ASSERT_NOT_NPC ((int) ZERO); ASSERT_NPC ((int) 0.0); - ASSERT_NOT_NPC ((int) DZERO); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ + ASSERT_NOT_NPC ((int) DZERO); ASSERT_NOT_NPC ((int) +0.0); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ ASSERT_NOT_NPC ((int) (0.0+0.0)); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ ASSERT_NOT_NPC ((int) (double)0.0); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */ -- 2.7.4