1 /* PR rtl-optimization/44838 */
2 /* { dg-do run } */
3 /* { dg-options "-O2 -funroll-loops" } */
4
5 extern void abort ();
6
7 void
foo(int * a,int n)8 foo (int *a, int n)
9 {
10 int *lasta = a + n;
11 for (; a != lasta; a++)
12 {
13 *a *= 2;
14 a[1] = a[-1] + a[-2];
15 }
16 }
17
18 int a[16];
19 int ref[16] = { 0, 1, 4, 2, 10, 12, 24, 44,
20 72, 136, 232, 416, 736, 1296, 2304, 2032 };
21
22 int
main()23 main ()
24 {
25 int i;
26 for (i = 0; i < 16; i++)
27 a[i] = i;
28 foo (a + 2, 16 - 3);
29 for (i = 0; i < 16; i++)
30 if (ref[i] != a[i])
31 abort ();
32 return 0;
33 }
34