summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-17 22:20:33 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-17 22:20:33 +0000
commit00a1a249e088472ba08196998a595d421a0244ce (patch)
treed30e405b088b0e569b5e4a7c2d94d855af66387b /gcc/testsuite/gcc.dg
parent4d5f8cf5f7072f39ead15100cc608ddbc35e0ae7 (diff)
downloadgcc-00a1a249e088472ba08196998a595d421a0244ce.tar.gz
tree-optimization/18501
* tree-optimize.c (init_tree_optimization_passes): Run pass_late_warn_uninitialized before the last DCE run. testsuite/ChangeLog: * gcc.dg/pr18501.c: New test. * gcc.dg/uninit-5.c: XFAIL. * gcc.dg/uninit-9.c: XFAIL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92337 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/pr18501.c20
-rw-r--r--gcc/testsuite/gcc.dg/uninit-5.c4
-rw-r--r--gcc/testsuite/gcc.dg/uninit-9.c2
3 files changed, 23 insertions, 3 deletions
diff --git a/gcc/testsuite/gcc.dg/pr18501.c b/gcc/testsuite/gcc.dg/pr18501.c
new file mode 100644
index 00000000000..bcd20717f9e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr18501.c
@@ -0,0 +1,20 @@
+/* Expected uninitialized variable warning. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+unsigned bmp_iter_set ();
+int something (void);
+
+void
+bitmap_print_value_set (void)
+{
+ unsigned first; /* { dg-warning "may be used" "conditional in loop" } */
+
+ for (; bmp_iter_set (); )
+ {
+ if (!first)
+ something ();
+ first = 0;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/uninit-5.c b/gcc/testsuite/gcc.dg/uninit-5.c
index ae7a8de7646..21ac9eec6f8 100644
--- a/gcc/testsuite/gcc.dg/uninit-5.c
+++ b/gcc/testsuite/gcc.dg/uninit-5.c
@@ -9,7 +9,7 @@ extern void foo(void);
void
func1(int cond)
{
- int x; /* { dg-bogus "x" "uninitialized variable warning" } */
+ int x; /* { dg-bogus "x" "uninitialized variable warning" { xfail *-*-* } } */
if(cond)
x = 1;
@@ -23,7 +23,7 @@ func1(int cond)
void
func2 (int cond)
{
- int x; /* { dg-bogus "x" "uninitialized variable warning" } */
+ int x; /* { dg-bogus "x" "uninitialized variable warning" { xfail *-*-* } } */
int flag = 0;
if(cond)
diff --git a/gcc/testsuite/gcc.dg/uninit-9.c b/gcc/testsuite/gcc.dg/uninit-9.c
index 2a8ccb69f32..62681f9e0fd 100644
--- a/gcc/testsuite/gcc.dg/uninit-9.c
+++ b/gcc/testsuite/gcc.dg/uninit-9.c
@@ -23,7 +23,7 @@ func(struct foo *list, int count)
{
int n_clobbers = 0;
int i;
- struct foo **clob_list; /* { dg-bogus "clob_list" "uninitialized variable warning" } */
+ struct foo **clob_list; /* { dg-bogus "clob_list" "uninitialized variable warning" { xfail *-*-* } } */
if(list[0].type == PARALLEL)
{