1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-rtl-loop2_unroll-optimized" } */
4 /* The pragma specified for foo2 should not affect foo1.
5 Verify compiler won't perform unrolling for foo1. */
8 extern int a1
[N
], b1
[N
], c1
[N
];
9 extern int a2
[N
], b2
[N
], c2
[N
];
16 for (i
= 0; i
< n
; i
++)
17 c1
[i
] += a1
[i
] + b1
[i
];
20 #pragma GCC optimize("O3,unroll-loops")
25 for (i
= 0; i
< n
; i
++)
26 c2
[i
] += a2
[i
] + b2
[i
];
29 /* { dg-final { scan-rtl-dump-times "optimized: loop unrolled" 1 "loop2_unroll" } } */