PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20030313-1.c
blob49245a0b39f151bfe6084ed0c7067c908e1c2622
1 struct A
3 unsigned long p, q, r, s;
4 } x = { 13, 14, 15, 16 };
6 extern void abort (void);
7 extern void exit (int);
9 static inline struct A *
10 bar (void)
12 struct A *r;
14 switch (8)
16 case 2:
17 abort ();
18 break;
19 case 8:
20 r = &x;
21 break;
22 default:
23 abort ();
24 break;
26 return r;
29 void
30 foo (unsigned long *x, int y)
32 if (y != 12)
33 abort ();
34 if (x[0] != 1 || x[1] != 11)
35 abort ();
36 if (x[2] != 2 || x[3] != 12)
37 abort ();
38 if (x[4] != 3 || x[5] != 13)
39 abort ();
40 if (x[6] != 4 || x[7] != 14)
41 abort ();
42 if (x[8] != 5 || x[9] != 15)
43 abort ();
44 if (x[10] != 6 || x[11] != 16)
45 abort ();
48 int
49 main (void)
51 unsigned long a[40];
52 int b = 0;
54 a[b++] = 1;
55 a[b++] = 11;
56 a[b++] = 2;
57 a[b++] = 12;
58 a[b++] = 3;
59 a[b++] = bar()->p;
60 a[b++] = 4;
61 a[b++] = bar()->q;
62 a[b++] = 5;
63 a[b++] = bar()->r;
64 a[b++] = 6;
65 a[b++] = bar()->s;
66 foo (a, b);
67 exit (0);