summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/uninit-pr20644-O0.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/uninit-pr20644-O0.c')
-rw-r--r--gcc/testsuite/gcc.dg/uninit-pr20644-O0.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/uninit-pr20644-O0.c b/gcc/testsuite/gcc.dg/uninit-pr20644-O0.c
new file mode 100644
index 000000000..092d41164
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-pr20644-O0.c
@@ -0,0 +1,24 @@
+/* PR 20644 */
+/* { dg-do compile } */
+/* { dg-options "-O0 -Wuninitialized" } */
+int foo ()
+{
+ int i = 0;
+ int j;
+
+ if (1 == i)
+ return j; /* { dg-bogus "uninitialized" "uninitialized" { xfail *-*-* } 10 } */
+
+ return 0;
+}
+
+int bar ()
+{
+ int i = 1;
+ int j;
+
+ if (1 == i)
+ return j; /* { dg-warning "uninitialized" "uninitialized" { target *-*-* } 21 } */
+
+ return 0;
+}