annotate gcc/testsuite/gcc.dg/20030309-1.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do link } */
kono
parents:
diff changeset
2 /* { dg-options "-O2" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 struct A0 { int x; };
kono
parents:
diff changeset
5 struct A1 { int x; int y[1]; };
kono
parents:
diff changeset
6 struct A2 { int x; int y[2]; };
kono
parents:
diff changeset
7 struct A3 { int x; int y[3]; };
kono
parents:
diff changeset
8 struct A4 { int x; int y[4]; };
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 void *s;
kono
parents:
diff changeset
11 int u;
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 int
kono
parents:
diff changeset
14 main (void)
kono
parents:
diff changeset
15 {
kono
parents:
diff changeset
16 int x;
kono
parents:
diff changeset
17 void *t = s;
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 switch (u)
kono
parents:
diff changeset
20 {
kono
parents:
diff changeset
21 case 0:
kono
parents:
diff changeset
22 x = ((struct A0 *) t)->x;
kono
parents:
diff changeset
23 break;
kono
parents:
diff changeset
24 case 1:
kono
parents:
diff changeset
25 x = ((struct A1 *) t)->x;
kono
parents:
diff changeset
26 break;
kono
parents:
diff changeset
27 case 2:
kono
parents:
diff changeset
28 x = ((struct A2 *) t)->x;
kono
parents:
diff changeset
29 break;
kono
parents:
diff changeset
30 case 3:
kono
parents:
diff changeset
31 x = ((struct A3 *) t)->x;
kono
parents:
diff changeset
32 break;
kono
parents:
diff changeset
33 case 4:
kono
parents:
diff changeset
34 x = ((struct A4 *) t)->x;
kono
parents:
diff changeset
35 break;
kono
parents:
diff changeset
36 default:
kono
parents:
diff changeset
37 x = 0;
kono
parents:
diff changeset
38 break;
kono
parents:
diff changeset
39 }
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 return x;
kono
parents:
diff changeset
42 }