diff options
author | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-08-19 20:12:44 +0000 |
---|---|---|
committer | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-08-19 20:12:44 +0000 |
commit | ac9b19aaa4d30842172a28c02ee38ec006d56e56 (patch) | |
tree | 346f1ebd450686d1b4790a3e7d867e9291da3711 /gcc/testsuite/gcc.dg | |
parent | 59729df469b42e2bf8edd05c06b279ef77df0ea1 (diff) | |
download | gcc-ac9b19aaa4d30842172a28c02ee38ec006d56e56.tar.gz |
*** empty log message ***
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70573 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/uninit-D.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/uninit-E.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/uninit-F.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/uninit-G.c | 9 |
4 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/uninit-D.c b/gcc/testsuite/gcc.dg/uninit-D.c new file mode 100644 index 00000000000..ea957e49e98 --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-D.c @@ -0,0 +1,9 @@ +/* Test we do not warn about initializing variable with self. */ +/* { dg-do compile } */ +/* { dg-options "-O -Wuninitialized" } */ + +int f() +{ + int i = i; + return i; +} diff --git a/gcc/testsuite/gcc.dg/uninit-E.c b/gcc/testsuite/gcc.dg/uninit-E.c new file mode 100644 index 00000000000..42b84302f96 --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-E.c @@ -0,0 +1,9 @@ +/* Test we do warn about initializing variable with self when -Winit-self is supplied. */ +/* { dg-do compile } */ +/* { dg-options "-O -Wuninitialized -Winit-self" } */ + +int f() +{ + int i = i; + return i; +} diff --git a/gcc/testsuite/gcc.dg/uninit-F.c b/gcc/testsuite/gcc.dg/uninit-F.c new file mode 100644 index 00000000000..1dbb365e5b7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-F.c @@ -0,0 +1,9 @@ +/* Test we do warn about initializing variable with self in the initialization. */ +/* { dg-do compile } */ +/* { dg-options "-O -Wuninitialized" } */ + +int f() +{ + int i = i + 1; /* { dg-warning "i" "uninitialized variable warning" } */ + return i; +} diff --git a/gcc/testsuite/gcc.dg/uninit-G.c b/gcc/testsuite/gcc.dg/uninit-G.c new file mode 100644 index 00000000000..08f5f532116 --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-G.c @@ -0,0 +1,9 @@ +/* Test we do not warn about initializing variable with address of self in the initialization. */ +/* { dg-do compile } */ +/* { dg-options "-O -Wuninitialized" } */ + +void *f() +{ + void *i = &i; + return i; +} |