summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/uninit-15-O0.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/uninit-15-O0.c')
-rw-r--r--gcc/testsuite/gcc.dg/uninit-15-O0.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/uninit-15-O0.c b/gcc/testsuite/gcc.dg/uninit-15-O0.c
new file mode 100644
index 000000000..a3fd2b63b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/uninit-15-O0.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+/* XFAIL for now, the uninitialized pass runs before inlining only at -O0. */
+
+inline int __attribute__((always_inline))
+foo (int i)
+{
+ if (i) return 1; /* { dg-warning "is used uninitialized" {} { xfail *-*-* } } */
+ return 0;
+}
+
+void baz();
+
+void bar()
+{
+ int j; /* { dg-message "was declared here" {} { xfail *-*-* } } */
+ for (; foo(j); ++j)
+ baz();
+}