1 /* { dg-options "-O3 -fdump-tree-lversion-details" } */
3 /* Test that we do version for a step of 1 when that would lead the
4 iterations to access consecutive groups. */
7 f1 (unsigned short *x
, int stepx
, int n
)
9 for (int i
= 0; i
< n
; ++i
)
11 x
[i
* stepx
* 2] = 100;
12 x
[i
* stepx
* 2 + 1] = 99;
17 f2 (unsigned short *x
, int stepx
, int n
)
19 for (int i
= 0; i
< n
; i
+= stepx
* 2)
27 f3 (unsigned short *x
, int stepx
, int n
)
29 for (int i
= 0; i
< n
; ++i
)
31 x
[i
* stepx
* 2 - 16] = 100;
32 x
[i
* stepx
* 2 - 15] = 99;
37 f4 (unsigned short *x
, int stepx
, int n
)
39 for (int i
= 0; i
< n
; i
+= stepx
* 2)
47 f5 (unsigned short *x
, int stepx
, int n
)
49 for (unsigned short *y
= x
; y
< x
+ n
; y
+= stepx
* 2)
56 unsigned short x
[1000];
61 for (int i
= 0; i
< n
; ++i
)
63 x
[i
* stepx
* 2] = 100;
64 x
[i
* stepx
* 2 + 1] = 99;
71 for (int i
= 0; i
< n
; i
+= stepx
* 2)
81 for (int i
= 0; i
< n
; ++i
)
83 x
[i
* stepx
* 2 - 16] = 100;
84 x
[i
* stepx
* 2 - 15] = 99;
91 for (int i
= 0; i
< n
; i
+= stepx
* 2)
101 for (unsigned short *y
= x
; y
< x
+ n
; y
+= stepx
* 2)
108 /* { dg-final { scan-tree-dump-times {want to version containing loop} 10 "lversion" } } */
109 /* { dg-final { scan-tree-dump-times {versioned this loop} 10 "lversion" } } */