1 /*
2    pta-field-1.c from the execute part of the gcc torture tests.
3  */
4 
5 #include <testfwk.h>
6 
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
10 
11 struct Foo {
12   int *p;
13   int *q;
14 };
15 
16 void
bar(int ** x)17 bar (int **x)
18 {
19   struct Foo *f = (struct Foo *)x;
20   *(f->q) = 0;
21 }
22 
foo(void)23 int foo(void)
24 {
25   struct Foo f;
26   int i = 1, j = 2;
27   f.p = &i;
28   f.q = &j;
29   bar(&f.p);
30   return j;
31 }
32 
33 void
testTortureExecute(void)34 testTortureExecute (void)
35 {
36   if (foo () != 0)
37     ASSERT (0);
38   return;
39 }
40 
41