diff options
author | Jan Hubicka <hubicka@gcc.gnu.org> | 2003-02-16 22:10:10 +0000 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2003-02-16 22:10:10 +0000 |
commit | 096daf41db55827292c1d70cd937b4e97de8043a (patch) | |
tree | c0995f241340b5f698925d91af5ffa83db5f4b1e /gcc/testsuite/gcc.dg/c99-const-expr-3.c | |
parent | 35113fde34664bf86a7cee2deb8d94a5537a8a29 (diff) | |
download | gcc-096daf41db55827292c1d70cd937b4e97de8043a.zip gcc-096daf41db55827292c1d70cd937b4e97de8043a.tar.gz gcc-096daf41db55827292c1d70cd937b4e97de8043a.tar.bz2 |
c-typeck.c (build_c_cast): Fold constant variables into initial values.
* c-typeck.c (build_c_cast): Fold constant variables into
initial values.
* gcc.dg/c90-const-expr-3.c (DZERO): New static variable
(foo): Add few extra tests
* gcc.dg/c99-const-expr-3.c: Likewise.
* gcc.c-torture/execute/20030216-1.c: New.
From-SVN: r62987
Diffstat (limited to 'gcc/testsuite/gcc.dg/c99-const-expr-3.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/c99-const-expr-3.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-3.c b/gcc/testsuite/gcc.dg/c99-const-expr-3.c index 7490f62..096825e 100644 --- a/gcc/testsuite/gcc.dg/c99-const-expr-3.c +++ b/gcc/testsuite/gcc.dg/c99-const-expr-3.c @@ -6,6 +6,7 @@ to give the correct behavior to conforming programs. */ static const int ZERO = 0; +static const double DZERO = 0; int *a; int b; @@ -36,4 +37,9 @@ foo (void) ASSERT_NOT_NPC ((char) ZERO); ASSERT_NPC ((int) 0); ASSERT_NOT_NPC ((int) ZERO); + ASSERT_NPC ((int) 0.0); + 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 *-*-* } } */ } |