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:
parent
347561b87c
commit
56dea94bcf
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.
|
||||
|
24
gcc/testsuite/treelang/compile/extrafunc.tree
Normal file
24
gcc/testsuite/treelang/compile/extrafunc.tree
Normal file
@ -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" } }
|
13
gcc/testsuite/treelang/compile/extravar.tree
Normal file
13
gcc/testsuite/treelang/compile/extravar.tree
Normal file
@ -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" } }
|
Loading…
x
Reference in New Issue
Block a user