aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/uninit-pr89296.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/uninit-pr89296.c')
-rw-r--r--gcc/testsuite/gcc.dg/uninit-pr89296.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/uninit-pr89296.c b/gcc/testsuite/gcc.dg/uninit-pr89296.c
new file mode 100644
index 00000000000..9d81b32b979
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-pr89296.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+
+int get_a_value ();
+void printk(const char *);
+void test_func()
+{
+ int loop;
+ while (!loop) { /* { dg-warning "is used uninitialized" } */
+ loop = get_a_value();
+ printk("...");
+ }
+}