1 /* { dg-do run } */
2 
3 struct
4 {
5     int mallocFailed;
6 }
7 *a;
8 
9 struct StrAccum
10 {
11     int useMalloc;
12 }
13 b, c;
14 
15 static void
fn1(struct StrAccum * p1,int p2)16 fn1 (struct StrAccum *p1, int p2)
17 {
18     if (p2 == 0)
19         return;
20     if (p1->useMalloc)
21         a->mallocFailed = 0;
22 }
23 
24 void
fn2(struct StrAccum * p1)25 fn2 (struct StrAccum *p1)
26 {
27     fn1 (p1, 1);
28 }
29 
30 void
fn3(struct StrAccum * p1)31 fn3 (struct StrAccum *p1)
32 {
33     fn1 (p1, 1);
34 }
35 
36 void
fn4()37 fn4 ()
38 {
39     c.useMalloc = 1;
40     fn1 (&c, 0);
41 }
42 
43 int
main()44 main ()
45 {
46     fn3 (&b);
47     return 0;
48 }
49