This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] testcase for pr8828


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]