summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/uninit-pr19430-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/uninit-pr19430-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/uninit-pr19430-2.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/uninit-pr19430-2.c b/gcc/testsuite/gcc.dg/uninit-pr19430-2.c
new file mode 100644
index 00000000000..361a6a0bbda
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-pr19430-2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+int *p, *q;
+
+int foo (int b)
+{
+ int i, j = 0;
+ int *x;
+ p = &i;
+ q = &j;
+ if (b)
+ x = p;
+ else
+ x = q;
+ return *x;
+}
+