OSDN Git Service

PR c/10175
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Apr 2003 01:25:40 +0000 (01:25 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Apr 2003 01:25:40 +0000 (01:25 +0000)
        * jump.c (never_reached_warning): Revert patch of 2002-11-02.
        Look backwards for a line note.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65229 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/gcc.dg/Wunreachable-3.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/Wunreachable-3.c b/gcc/testsuite/gcc.dg/Wunreachable-3.c
new file mode 100644 (file)
index 0000000..966d89e
--- /dev/null
@@ -0,0 +1,17 @@
+/* PR c/10175 */
+/* { dg-do compile } */
+/* { dg-options "-Wunreachable-code" } */
+
+int i,j;
+int main(void)
+{
+  if (0) {
+    i = 0;                /* { dg-warning "will never be executed" "" } */
+    j = 0;
+  } else {
+    i = 1;
+    j = 1;
+  }
+
+  return 0;
+}