Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / gcc.dg / tree-prof / peel-1.c
1 /* { dg-options "-O3 -fdump-rtl-loop2_unroll -fno-unroll-loops -fpeel-loops" } */
2 void abort();
3
4 int a[1000];
5 int
6 __attribute__ ((noinline))
7 t()
8 {
9   int i;
10   for (i=0;i<1000;i++)
11     if (!a[i])
12       return 1;
13   abort ();
14 }
15 main()
16 {
17   int i;
18   for (i=0;i<1000;i++)
19     t();
20   return 0;
21 }
22 /* { dg-final-use { scan-rtl-dump "Considering simply peeling loop" "loop2_unroll" } } */
23 /* In fact one peeling is enough; we however mispredict number of iterations of the loop
24    at least until loop_ch is schedule ahead of profiling pass.  */
25 /* { dg-final-use { cleanup-rtl-dump "loop2_unroll" } } */