PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr41463.c
blobc410fe0218be09c812e496053e52bc5fe24d4227
1 #include <stdlib.h>
3 union tree_node;
5 struct tree_common
7 int a;
8 long b;
9 long c;
10 void *p;
11 int d;
14 struct other_tree
16 struct tree_common common;
17 int arr[14];
20 struct tree_vec
22 struct tree_common common;
23 int length;
24 union tree_node *a[1];
27 union tree_node
29 struct other_tree othr;
30 struct tree_vec vec;
33 union tree_node global;
35 union tree_node * __attribute__((noinline))
36 foo (union tree_node *p, int i)
38 union tree_node **q;
39 p->vec.a[i] = (union tree_node *) 0;
40 q = &p->vec.a[1];
41 *q = &global;
42 return p->vec.a[i];
45 extern void abort (void);
46 extern void *malloc (__SIZE_TYPE__);
48 int
49 main()
51 union tree_node *p = malloc (sizeof (union tree_node));
52 if (foo (p, 1) != &global)
53 abort ();
54 return 0;