2005-02-26 James A. Morrison <phython@gcc.gnu.org>
* compile/extrafunc.tree, compile/extravar.tree: New tests.
From-SVN: r95581
+2005-02-26 James A. Morrison <phython@gcc.gnu.org>
+
+ * compile/extrafunc.tree, compile/extravar.tree: New tests.
+
2005-02-26 James A. Morrison <phython@gcc.gnu.org>
* compile/unsigned.tree: New test.
--- /dev/null
+// { dg-do compile }
+// { dg-options "-O2 -fdump-tree-optimized -Wunused-function" }
+// Check to see that unused functions get removed at -O2 and
+// above.
+static int foo (int bar);
+static int baz (int aaa);
+external_definition int ext (int bbb);
+
+foo
+{
+ return bar;
+}
+
+baz // { dg-warning "defined but not used" }
+{
+ return foo (aaa);
+}
+
+ext
+{
+ return foo (bbb);
+}
+
+// { dg-final { scan-tree-dump-not "baz" "optimized" } }
--- /dev/null
+// { dg-do compile }
+// { dg-options "-fdump-tree-vars -O1 -Wunused-variable" }
+external_definition int bar (int aaa, int ddd);
+
+static int foo = -3; // { dg-warning "defined but not used" }
+
+bar
+{
+ automatic int ccc;
+
+ return aaa + ddd + +3;
+}
+// { dg-final { scan-tree-dump-not "ccc" "vars" } }