* compile/extrafunc.tree, compile/extravar.tree: New tests.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95581
138bc75d-0d04-0410-961f-
82ee72b054a4
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.
2005-02-24 James A. Morrison <phython@gcc.gnu.org>
--- /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" } }