Fix all tests that fail with -sanitize=return.
[official-gcc.git] / gcc / testsuite / g++.dg / tree-ssa / pr26757.C
blob4d124e3c45d6472689d5d8d35145caf1ac9d05ad
1 // PR c++/26757
2 // { dg-do run }
3 // { dg-options "-O" }
5 extern "C" void abort ();
7 typedef struct A
9   int c;
10   int d;
11 } A;
13 A *b;
15 void
16 foo ()
18   b->c++;
19   extern A *b;
20   b->d++;
24 void
25 bar ()
27   if (b->d)
28     b->c++;
32 int
33 main ()
35   A a = { 0, 0 };
36   b = &a;
37   foo ();
38   bar ();
39   if (b->c != 2)
40     abort ();
41   if (b->d != 1)
42     abort ();
43   return 0;