Debian Codegraph @

gcc/testsuite/gcc.dg/uninit-pr106866.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fno-ipa-pure-const -Wuninitialized" } */
3
4 int n;
5
6 void
7 empty (int)
8 {
9 }
10
11 int
12 bar (int x)
13 {
14 return n + x + 1;
15 }
16
17 __attribute__ ((pure, returns_twice)) int
18 foo (void)
19 {
20 int uninitialized;
21
22 if (n)
23 {
24 if (bar (0))
25 return 0;
26
27 __builtin_unreachable ();
28 }
29
30 while (uninitialized < 1) /* { dg-warning "uninitialized" } */
31 {
32 foo ();
33 empty (bar (0) == foo ());
34 ++uninitialized;
35 }
36
37 return 0;
38 }