Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / c-c++-common / unroll-3.c
blob541accb7e9317fdb6e4e53124692791ed1b622f4
1 /* { dg-do compile } */
2 /* { dg-options "-O -fdisable-tree-cunroll -fdump-rtl-loop2_unroll-details" } */
4 extern void bar (int);
6 int j;
8 void test (void)
10 #pragma GCC unroll 8
11 for (unsigned long i = 1; i <= 8; ++i)
12 bar(i);
13 /* { dg-final { scan-rtl-dump-not "11:.*: optimized: loop unrolled" "loop2_unroll" } } */
15 #pragma GCC unroll 8
16 for (unsigned long i = 1; i <= 7; ++i)
17 bar(i);
18 /* { dg-final { scan-rtl-dump-not "16:.*: optimized: loop unrolled" "loop2_unroll" } } */
20 #pragma GCC unroll 8
21 for (unsigned long i = 1; i <= 15; ++i)
22 bar(i);
23 /* { dg-final { scan-rtl-dump "21:.*: optimized: loop unrolled 7 times" "loop2_unroll" } } */
25 #pragma GCC unroll 8
26 for (unsigned long i = 1; i <= j; ++i)
27 bar(i);
28 /* { dg-final { scan-rtl-dump "26:.*: optimized: loop unrolled 7 times" "loop2_unroll" } } */
30 #pragma GCC unroll 7
31 for (unsigned long i = 1; i <= j; ++i)
32 bar(i);
33 /* { dg-final { scan-rtl-dump "31:.*: optimized: loop unrolled 3 times" "loop2_unroll" } } */
35 unsigned long i = 0;
36 #pragma GCC unroll 3
37 do {
38 bar(i);
39 } while (++i < 9);
40 /* { dg-final { scan-rtl-dump "3\[79\]:.*: optimized: loop unrolled 2 times" "loop2_unroll" } } */