aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2016-07-29 17:34:55 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2016-07-29 17:34:55 +0000
commitefd0786f218626c25adde976a9f83121b0c45342 (patch)
treec21b60865d58f3c7e38d33b70ce2af3168245099 /gcc/testsuite/gcc.dg
parentf618a47208b4cf40ac7567e7b7fc9aeefeecc207 (diff)
downloadgcc-efd0786f218626c25adde976a9f83121b0c45342.zip
gcc-efd0786f218626c25adde976a9f83121b0c45342.tar.gz
gcc-efd0786f218626c25adde976a9f83121b0c45342.tar.bz2
re PR c/71853 (ICE on an ill-formed case statement in c_do_switch_warnings)
PR c/71853 * c-parser.c (c_parser_switch_statement): Initialize ce.original_type to error node for invalid code. * gcc.dg/noncompile/pr71853.c: New test. From-SVN: r238884
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/pr71853.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr71853.c b/gcc/testsuite/gcc.dg/noncompile/pr71853.c
new file mode 100644
index 0000000..673b6c5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/noncompile/pr71853.c
@@ -0,0 +1,9 @@
+/* PR c/71853 */
+/* { dg-do compile } */
+
+void f (void)
+{
+ case (0) { /* { dg-error "expected" } */
+ switch 0: { } /* { dg-error "expected" } */
+ }
+}