summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorChad Loder <cloder@cvs.openbsd.org>2006-04-21 02:37:29 +0000
committerChad Loder <cloder@cvs.openbsd.org>2006-04-21 02:37:29 +0000
commit8aa8f27587cc7987ea6331ca32bb3123463f7f57 (patch)
tree4d320c7d475e748b2e909487a6689ffa15939c89 /regress
parent58d7e817ef428a8856f1c3cc7f83754e81acab83 (diff)
Regression test for lint crash dealing with break outside a switch or a
loop. Found by dlg
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.bin/xlint/test-17.c8
-rw-r--r--regress/usr.bin/xlint/test-17.c.exp5
2 files changed, 11 insertions, 2 deletions
diff --git a/regress/usr.bin/xlint/test-17.c b/regress/usr.bin/xlint/test-17.c
index 58870ab8a7e..337c36bbc6b 100644
--- a/regress/usr.bin/xlint/test-17.c
+++ b/regress/usr.bin/xlint/test-17.c
@@ -1,4 +1,4 @@
- /* $OpenBSD: test-17.c,v 1.1 2006/04/20 03:39:14 cloder Exp $ */
+ /* $OpenBSD: test-17.c,v 1.2 2006/04/21 02:37:28 cloder Exp $ */
/*
* Placed in the public domain by Chad Loder <cloder@openbsd.org>.
@@ -26,6 +26,11 @@ main(int argc, char* argv[])
break; /* should warn */
}
break;
+ case 3:
+ switch (a) {
+ case 0:
+ break;
+ }
default:
break;
}
@@ -40,5 +45,6 @@ main(int argc, char* argv[])
break;
}
+ break;
return a;
}
diff --git a/regress/usr.bin/xlint/test-17.c.exp b/regress/usr.bin/xlint/test-17.c.exp
index 227bde47683..a40a0c7140c 100644
--- a/regress/usr.bin/xlint/test-17.c.exp
+++ b/regress/usr.bin/xlint/test-17.c.exp
@@ -1,3 +1,6 @@
test-17.c:26: warning: statement not reached
-test-17.c:36: warning: statement not reached
+test-17.c:34: warning: fallthrough on default statement
+test-17.c:41: warning: statement not reached
+test-17.c:48: break outside loop or switch
+test-17.c:49: warning: statement not reached
Lint pass2: