libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / uninit-pr89230-1.c
blobbf536e2e65a7076d4b9dc2210baa13f0fc3ca13e
1 /* PR middle-end/89230 - Bogus uninited usage warning with printf
2 { dg-do compile }
3 { dg-options "-O2 -Wall" } */
5 struct S { int i, j; };
7 /* attribute__ ((malloc)) */ struct S* f (void);
9 int g (void)
11 struct S *p = f ();
12 struct S *q; // { dg-bogus "" "uninitialized" { xfail *-*-* } }
14 if (p->i || !(q = f ()) || p->j != q->i)
16 __builtin_printf ("%i", p->i);
18 if (p->i)
19 return 1;
21 if (!q) // { dg-bogus "\\\[-Wmaybe-uninitialized" "" { xfail *-*-* } }
22 return 2;
25 return 0;