Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / uninit-pr65182.c
blob45b538d1a2fde3c6cd55a60574c9b6470981f83a
1 /* PR middle-end/65182 - -Wuninitialized fails when pointer to variable
2 later passed to function
3 { dg-do compile }
4 { dg-options "-O0 -Wall" } */
6 void bar (int *a);
8 int baz (void);
10 __attribute__ ((noipa)) void foo_O0 (int *b)
12 int a;
14 if (a) // { dg-warning "\\\[-Wuninitialized" }
16 *b = 0;
17 return;
20 bar (&a);
22 a = baz ();
24 *b = a + 2;
27 #pragma GCC optimize ("2")
29 __attribute__ ((noipa)) void foo_O2 (int *b)
31 int a;
33 if (a) // { dg-warning "\\\[-Wuninitialized" }
35 *b = 0;
36 return;
39 bar (&a);
41 a = baz ();
43 *b = a + 3;