blob: cb02875e6745f6f41ad7ab0d48f119c539213b80 (
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
|
/* { dg-do compile } */
/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev-details" } */
int main(void)
{
int a;
int b;
int c;
/* nb_iterations 28 */
for (a = 22; a < 50; a++)
{
/* nb_iterations 6 */
for (b = 23; b < 50; b+=5)
{
/* nb_iterations {78, +, -1}_1 */
for (c = a; c < 100; c++)
{
}
}
}
}
/* The analyzer has to detect the following evolution functions:
a -> {22, +, 1}_1
b -> {23, +, 5}_2
c -> {{22, +, 1}_1, +, 1}_3
*/
/* { dg-final { scan-tree-dump-times "nb_iterations 28" 1 "scev"} } */
/* { dg-final { scan-tree-dump-times "nb_iterations 6" 1 "scev"} } */
|