mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-19 03:40:26 +08:00
var_defs.tree: Remove duplicate variable.
2005-07-19 James A. Morrrison <phython@gcc.gnu.org> * compile/var_defs.tree: Remove duplicate variable. * compile/var_defs-2.tree: Add duplicate variable test. From-SVN: r102159
This commit is contained in:
parent
0219cf3d1b
commit
cac78d37bf
@ -1,3 +1,8 @@
|
||||
2005-07-19 James A. Morrrison <phython@gcc.gnu.org>
|
||||
|
||||
* compile/var_defs.tree: Remove duplicate variable.
|
||||
* compile/var_defs-2.tree: Add duplicate variable test.
|
||||
|
||||
2005-03-22 James A. Morrison <phython@gcc.gnu.org>
|
||||
|
||||
* compile/memory.tree: New test.
|
||||
|
20
gcc/testsuite/treelang/compile/var_defs-2.tree
Normal file
20
gcc/testsuite/treelang/compile/var_defs-2.tree
Normal file
@ -0,0 +1,20 @@
|
||||
// { dg-do compile }
|
||||
external_definition int first_nonzero (int arg5, int arg6);
|
||||
|
||||
first_nonzero
|
||||
{
|
||||
automatic int y;
|
||||
automatic int y; // { dg-error "Duplicate" }
|
||||
if (arg5)
|
||||
{
|
||||
return arg5;
|
||||
}
|
||||
else
|
||||
{
|
||||
automatic int j;
|
||||
j = arg6;
|
||||
return j;
|
||||
}
|
||||
return arg6;
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
// { dg-options "-Wuninitialized -O" }
|
||||
external_definition void boring (int arg0);
|
||||
external_definition char condition (char arg1, char arg2);
|
||||
external_definition int first_nonzero (int arg5, int arg6);
|
||||
|
||||
boring
|
||||
{
|
||||
@ -23,21 +22,5 @@ condition
|
||||
return j; // { dg-warning "uninitialized" }
|
||||
}
|
||||
}
|
||||
|
||||
first_nonzero
|
||||
{
|
||||
automatic int y;
|
||||
automatic int y; // { dg-error "Duplicate" }
|
||||
if (arg5)
|
||||
{
|
||||
return arg5;
|
||||
}
|
||||
else
|
||||
{
|
||||
automatic int j;
|
||||
j = arg6;
|
||||
return j;
|
||||
}
|
||||
return arg6;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user