]>
Commit | Line | Data |
---|---|---|
f9bf4777 JH |
1 | /* { dg-do compile } */ |
2 | /* { dg-options "-O3 -fdump-rtl-loop2_unroll -funroll-loops" } */ | |
1076781c GJL |
3 | /* { dg-require-effective-target int32plus } */ |
4 | ||
f9bf4777 JH |
5 | void abort (void); |
6 | int *a; | |
8816ac70 RS |
7 | /* Fails on MIPS16 because equality checks are implemented using XOR. |
8 | It's unlikely MIPS16 users would want unrolling anyway. */ | |
9 | #ifdef __mips | |
10 | __attribute__((nomips16)) | |
11 | #endif | |
f9bf4777 JH |
12 | int t() |
13 | { | |
14 | int i; | |
15 | for (i=0;i<1000000;i++) | |
16 | if (a[i]) | |
17 | return 1; | |
18 | return 0; | |
19 | } | |
8816ac70 RS |
20 | #ifdef __mips |
21 | __attribute__((nomips16)) | |
22 | #endif | |
f9bf4777 JH |
23 | int t2() |
24 | { | |
25 | int i; | |
26 | for (i=0;i<3000000;i++) | |
27 | if (a[i]) | |
28 | abort (); | |
29 | return 0; | |
30 | } | |
31 | /* { dg-final { scan-rtl-dump-times "upper bound: 999999" 1 "loop2_unroll" } } */ | |
32 | /* { dg-final { scan-rtl-dump-not "realistic bound: 999999" "loop2_unroll" } } */ | |
33 | /* { dg-final { scan-rtl-dump-times "upper bound: 2999999" 1 "loop2_unroll" } } */ | |
34 | /* { dg-final { scan-rtl-dump-times "realistic bound: 2999999" 1 "loop2_unroll" } } */ |