summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/uninit-B-2.c
diff options
context:
space:
mode:
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-20 22:23:45 +0000
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-20 22:23:45 +0000
commit1c32170edd1160213fdb70076d663bc68e2e7eb2 (patch)
tree660ae75a4cdf11380c42d11680fdb1c7ead51a82 /gcc/testsuite/gcc.dg/uninit-B-2.c
parentdb3454cf73b52f9ed125ea0f1e7c347473b1cb3d (diff)
downloadgcc-1c32170edd1160213fdb70076d663bc68e2e7eb2.tar.gz
2008-08-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR middle-end/179 * tree-ssa.c (warn_uninit): Do not warn for variables that can be initialized outside the current module. (warn_uninitialized_var): Ignore left-hand side when walking the trees. Ignore address expressions. Examine VUSE operands in gimple statements with a variable declaration on the right-hand side. testsuite/ * gcc.dg/uninit-6.c (make_something): Remove XFAIL. * gcc.dg/uninit-6-O0.c (make_something): Remove XFAIL. * gcc.dg/uninit-B.c (baz): Remove XFAIL. * gcc.dg/uninit-B-2.c: New. * gcc.dg/uninit-B-O0-2.c: New. * gcc.dg/uninit-pr19430-O0.c: New. * gcc.dg/uninit-pr19430.c: New. * gcc.dg/uninit-pr19430-2.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139347 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/uninit-B-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/uninit-B-2.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/uninit-B-2.c b/gcc/testsuite/gcc.dg/uninit-B-2.c
new file mode 100644
index 00000000000..ee8a885817b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-B-2.c
@@ -0,0 +1,16 @@
+/* Origin: PR c/179 inverse of uninit-B-O0.c, we should not warn. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+extern void foo (int *);
+extern void bar (int);
+
+void
+baz (void)
+{
+ int i;
+ foo (&i); /* { dg-bogus "is used uninitialized" "uninit i warning" } */
+ if (i)
+ bar (i);
+}
+
+