aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp-if5.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2000-06-08 00:27:57 +0200
committerZack Weinberg <zack@gcc.gnu.org>2000-06-07 22:27:57 +0000
commit5af7e2c2e1949e500d44d78d25f98cd3cfdf3e3c (patch)
treef7aa6b7905149647216d26d181d5e60eb5b4e9cf /gcc/testsuite/gcc.dg/cpp-if5.c
parent69197e7e5ead2bebae71ed62532a9d422222684a (diff)
downloadgcc-5af7e2c2e1949e500d44d78d25f98cd3cfdf3e3c.zip
gcc-5af7e2c2e1949e500d44d78d25f98cd3cfdf3e3c.tar.gz
gcc-5af7e2c2e1949e500d44d78d25f98cd3cfdf3e3c.tar.bz2
cpplib.c (do_ifdef, do_ifndef): Don't segfault if parse_ifdef returned NULL.
2000-06-06 Jakub Jelinek <jakub@redhat.com> * cpplib.c (do_ifdef, do_ifndef): Don't segfault if parse_ifdef returned NULL. From-SVN: r34448
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp-if5.c')
-rw-r--r--gcc/testsuite/gcc.dg/cpp-if5.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp-if5.c b/gcc/testsuite/gcc.dg/cpp-if5.c
new file mode 100644
index 0000000..2eac73b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp-if5.c
@@ -0,0 +1,12 @@
+/* Regression test: #ifdef 0 should not crash. Problem noted by
+ Jakub Jelinek <jakub@redhat.com>. */
+/* { dg-do preprocess } */
+
+#ifdef 0 /* { dg-error "with invalid argument" } */
+#error not seen
+#endif
+
+#ifndef 0 /* { dg-error "with invalid argument" } */
+#else
+#error not seen
+#endif