var_defs: Add uninitialized variables.

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

        * compile/var_defs: Add uninitialized variables.

From-SVN: r95585
This commit is contained in:
James A. Morrison 2005-02-26 16:09:33 +00:00
parent b12d3a1946
commit 54ff999a48
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2005-02-26 James A. Morrison <phython@gcc.gnu.org>
* compile/var_defs: Add uninitialized variables.
2005-02-26 James A. Morrison <phython@gcc.gnu.org>
* compile/extrafunc.tree, compile/extravar.tree: New tests.

View File

@ -1,4 +1,5 @@
// { dg-do compile }
// { 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);
@ -14,11 +15,12 @@ condition
if (arg1)
{
automatic int i;
return arg1;
return i + 1; // { dg-warning "uninitialized" }
}
else
{
return 0;
automatic int j;
return j; // { dg-warning "uninitialized" }
}
}