2015-09-24 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / 20030309-1.c
blob2431bc1b52f307d2febac2aedfe7a897786a87e9
1 /* { dg-do link } */
2 /* { dg-options "-O2" } */
4 struct A0 { int x; };
5 struct A1 { int x; int y[1]; };
6 struct A2 { int x; int y[2]; };
7 struct A3 { int x; int y[3]; };
8 struct A4 { int x; int y[4]; };
10 void *s;
11 int u;
13 int
14 main (void)
16 int x;
17 void *t = s;
19 switch (u)
21 case 0:
22 x = ((struct A0 *) t)->x;
23 break;
24 case 1:
25 x = ((struct A1 *) t)->x;
26 break;
27 case 2:
28 x = ((struct A2 *) t)->x;
29 break;
30 case 3:
31 x = ((struct A3 *) t)->x;
32 break;
33 case 4:
34 x = ((struct A4 *) t)->x;
35 break;
36 default:
37 x = 0;
38 break;
41 return x;