aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorNeil Booth <neil@duron.akihabara.co.uk>2004-07-04 12:57:50 +0000
committerNeil Booth <neil@gcc.gnu.org>2004-07-04 12:57:50 +0000
commita09d4744294e28a19e7f785e85a361d2cd34c25e (patch)
tree7aa5c20469e6c104827c6efe34863e1cdbc76042 /gcc/testsuite
parentb25c17bcf0525adb212c2f08fa2607a0543630a8 (diff)
downloadgcc-a09d4744294e28a19e7f785e85a361d2cd34c25e.zip
gcc-a09d4744294e28a19e7f785e85a361d2cd34c25e.tar.gz
gcc-a09d4744294e28a19e7f785e85a361d2cd34c25e.tar.bz2
re PR preprocessor/16192 (Bug in expression evaluation when operand is missing)
* doc/cpp.texi: Don't document what we do for ill-formed expressions. * doc/cppopts.texi: Clarify processing of command-line defines. libcpp: PR preprocessor/16192 PR preprocessor/15913 PR preprocessor/15572 * expr.c (_cpp_parse_expr): Handle remaining cases where an expression is missing. * init.c (post_options): Traditional cpp doesn't do // comments. testsuite: * gcc.dg/cpp/if-mop.c: Two new testcases. * gcc.dg/cpp/trad/comment-3.c: New. From-SVN: r84080
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/cpp/if-mop.c6
-rw-r--r--gcc/testsuite/gcc.dg/cpp/trad/comment-3.c6
3 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1ca7e1a..9f03b45 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
+
+ * gcc.dg/cpp/if-mop.c: Two new testcases.
+ * gcc.dg/cpp/trad/comment-3.c: New.
+
2004-07-04 Paul Brook <paul@codesourcery.com>
* gfortran.fortran-torture/compile/implicit_1.f90: New test.
diff --git a/gcc/testsuite/gcc.dg/cpp/if-mop.c b/gcc/testsuite/gcc.dg/cpp/if-mop.c
index 9202740..119c739 100644
--- a/gcc/testsuite/gcc.dg/cpp/if-mop.c
+++ b/gcc/testsuite/gcc.dg/cpp/if-mop.c
@@ -23,3 +23,9 @@
#if (2) 4 * 2 /* { dg-error "missing bin" "close paren then immediate" } */
#endif
+
+#if == 2 /* { dg-error "no left op" } */
+#endif
+
+#if (==2) /* { dg-error "no left op" } */
+#endif
diff --git a/gcc/testsuite/gcc.dg/cpp/trad/comment-3.c b/gcc/testsuite/gcc.dg/cpp/trad/comment-3.c
new file mode 100644
index 0000000..e2710ad
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/trad/comment-3.c
@@ -0,0 +1,6 @@
+/* Test we don't accept C++ comments. */
+
+/* { dg-do preprocess } */
+
+#if 0
+#endif // /* { dg-warning "extra tokens" } */