gcc/
[official-gcc.git] / gcc / testsuite / gcc.dg / 20010822-1.c
blobb1c1cd45a90109f3b78e7274f53b1bcb75cf670c
1 /* { dg-do run } */
2 /* { dg-options "-Os" } */
4 extern void abort (void);
6 void foo (unsigned long x)
10 typedef struct a {
11 volatile unsigned int a1, a2, a3, a4, a5;
12 } *A;
13 typedef struct {
14 volatile unsigned int b1, b2, b3, b4, b5;
15 } *B;
16 struct C {
17 void *c1, *c2;
18 A c3;
19 unsigned char c4;
22 void
23 bar (struct C *c, unsigned int *d)
25 *d = *d | 1;
26 ((c->c4 >= 2)
27 ? (*(volatile unsigned int *) ((void *)(&((A)c->c3)->a5)) = *d)
28 : (*(volatile unsigned int *) ((void *)(&((B)c->c3)->b5)) = *d));
30 foo (50);
33 int main (void)
35 struct a a;
36 struct C c;
37 unsigned int d = 8;
38 c.c3 = &a;
39 c.c4 = 0;
40 bar (&c, &d);
41 if (a.a5 != 9)
42 abort ();
43 return 0;