aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/unroll_5.c
blob: edb9c26a68564bc78acab64e4d31a3f29c73bf08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* { dg-do compile } */
/* { dg-options "-O3 -fdump-rtl-loop2_unroll -funroll-loops" } */
/* { dg-require-effective-target int32plus } */

void abort (void);
int *a;
/* Fails on MIPS16 because equality checks are implemented using XOR.
   It's unlikely MIPS16 users would want unrolling anyway.  */
#ifdef __mips
__attribute__((nomips16))
#endif
int t()
{
   int i;
  for (i=0;i<1000000;i++)
    if (a[i])
      return 1;
  return 0;
}
#ifdef __mips
__attribute__((nomips16))
#endif
int t2()
{
   int i;
  for (i=0;i<3000000;i++)
    if (a[i])
        abort ();
  return 0;
}
/* { dg-final { scan-rtl-dump-times "upper bound: 999999" 1 "loop2_unroll" } } */
/* { dg-final { scan-rtl-dump-not "realistic bound: 999999" "loop2_unroll" } } */
/* { dg-final { scan-rtl-dump-times "upper bound: 2999999" 1 "loop2_unroll" } } */
/* { dg-final { scan-rtl-dump-times "realistic bound: 2999999" 1 "loop2_unroll" } } */
/* { dg-final { cleanup-rtl-dump "loop2_unroll" } } */