2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-03-21 10:30:34 +08:00

extrafunc.tree, [...]: New tests.

2005-02-26  James A. Morrison  <phython@gcc.gnu.org>

        * compile/extrafunc.tree, compile/extravar.tree: New tests.

From-SVN: r95581
This commit is contained in:
James A. Morrison 2005-02-26 14:12:05 +00:00
parent 347561b87c
commit 56dea94bcf
3 changed files with 41 additions and 0 deletions
gcc/testsuite/treelang

@ -1,3 +1,7 @@
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.

@ -0,0 +1,24 @@
// { 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" } }

@ -0,0 +1,13 @@
// { 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" } }