[patch] testcase for pr8828
Dan Kegel
dank@kegel.com
Fri Sep 26 15:45:00 GMT 2003
I checked in the gcc-3.3 tree, and there's no testcase
for PR8828. (Haven't checked mainline.) So here's one.
--- /dev/null Sat Dec 14 13:56:51 2002
+++ gcc/gcc/testsuite/gcc.dg/Wunreachable-3.c Fri Sep 26 08:13:29 2003
@@ -0,0 +1,20 @@
+/* See http://gcc.gnu.org/PR8828 */
+/* { dg-do compile } */
+/* { do-options "-O2 -Wunreachable-code -W" } */
+
+int vola;
+
+void framistat(int i)
+{
+ switch (i) {
+ case 0:
+ vola = 0; /* { dg-bogus "will never be executed" } */
+ break;
+ case 1:
+ vola = 1;
+ break;
+ case 2:
+ vola = 2;
+ break;
+ }
+}
--
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045
More information about the Gcc-patches
mailing list