diff options
| author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-06 17:15:07 +0000 |
|---|---|---|
| committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-06 17:15:07 +0000 |
| commit | 151e90ccc4ec622c5c4004b25fb90b67171bcc9d (patch) | |
| tree | 9b75142790c70534d0c2159f221893eb16ef3402 /gcc | |
| parent | 36fb17058156550631e423817c444f200c235a07 (diff) | |
| download | ppe42-gcc-151e90ccc4ec622c5c4004b25fb90b67171bcc9d.tar.gz ppe42-gcc-151e90ccc4ec622c5c4004b25fb90b67171bcc9d.zip | |
gcc/testsuite
PR preprocessor/35313, PR preprocessor/36088:
* gcc.dg/cpp/pr35313.c: New file.
* gcc.dg/cpp/if-oppr.c: Remove test for ',' in a conditional
expression.
* gcc.dg/cpp/if-oppr2.c: New file.
libcpp
PR preprocessor/35313, PR preprocessor/36088:
* expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
(reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134989 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.dg/cpp/if-oppr.c | 7 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.dg/cpp/if-oppr2.c | 10 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.dg/cpp/pr35313.c | 11 |
4 files changed, 30 insertions, 6 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e5bf09b744e..4aacdf2112b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2008-05-06 Tom Tromey <tromey@redhat.com> + + PR preprocessor/35313, PR preprocessor/36088: + * gcc.dg/cpp/pr35313.c: New file. + * gcc.dg/cpp/if-oppr.c: Remove test for ',' in a conditional + expression. + * gcc.dg/cpp/if-oppr2.c: New file. + 2008-05-06 Tobias Burnus <burnus@net-b.de> PR fortran/36117 diff --git a/gcc/testsuite/gcc.dg/cpp/if-oppr.c b/gcc/testsuite/gcc.dg/cpp/if-oppr.c index 9c4910f6a20..a46a815cf99 100644 --- a/gcc/testsuite/gcc.dg/cpp/if-oppr.c +++ b/gcc/testsuite/gcc.dg/cpp/if-oppr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. */ +/* Copyright (C) 2000, 2008 Free Software Foundation, Inc. */ /* Test the full range of preprocessor operator precedence. Each operator is tested with one of immediately higher precedence to @@ -19,11 +19,6 @@ #else #endif -/* , not higher than ?. This is not a syntax error if it is. */ -#if 1 ? 0, 1: 1 /* { dg-error "without" "? higher precedence than ," } */ -#error -#endif - /* : strictly higher than ?. This would give a syntax error otherwise. */ #if 0 ? 0 : 1 ? 1 : 1 #endif diff --git a/gcc/testsuite/gcc.dg/cpp/if-oppr2.c b/gcc/testsuite/gcc.dg/cpp/if-oppr2.c new file mode 100644 index 00000000000..bcfe7cca2f0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/if-oppr2.c @@ -0,0 +1,10 @@ +/* Copyright (C) 2008 Free Software Foundation, Inc. */ + +/* Another test of operator precedence. */ + +/* { dg-do preprocess } */ +/* { dg-options "" } */ + +#if 1 ? 2 : 3 , 0 +#error +#endif diff --git a/gcc/testsuite/gcc.dg/cpp/pr35313.c b/gcc/testsuite/gcc.dg/cpp/pr35313.c new file mode 100644 index 00000000000..e12636e0b70 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/pr35313.c @@ -0,0 +1,11 @@ +/* Test two failing cases for libcpp parser. From PRs 35313, 36088*/ +/* { dg-do preprocess } */ +/* { dg-options "-std=c99 -pedantic-errors" } */ + +extern int x; + +#if 0 ? 3,4 : 2 +#endif + +#if 1 ? 0 : 1 ? 1/0 : 1/0 +#endif |

