1 /* { dg-options "-O3 -fdump-tree-lversion-details" } */
2 
3 /* These shouldn't be versioned; it's extremely likely that the code
4    is emulating two-dimensional arrays.  */
5 
6 void
f1(double * x,int step,int n)7 f1 (double *x, int step, int n)
8 {
9   for (int i = 0; i < n; ++i)
10     for (int j = 0; j < n; ++j)
11       x[i * step + j] = 100;
12 }
13 
14 void
f2(double * x,int step,int n)15 f2 (double *x, int step, int n)
16 {
17   for (int i = 0; i < n; ++i)
18     for (int j = 0; j < n; ++j)
19       x[j * step + i] = 100;
20 }
21 
22 void
f3(double * x,int * offsets,int step,int n)23 f3 (double *x, int *offsets, int step, int n)
24 {
25   for (int i = 0; i < n; ++i)
26     for (int j = 0; j < n; ++j)
27       x[i * step + j + offsets[i]] = 100;
28 }
29 
30 void
f4(double * x,int * offsets,int step,int n)31 f4 (double *x, int *offsets, int step, int n)
32 {
33   for (int i = 0; i < n; ++i)
34     for (int j = 0; j < n; ++j)
35       x[j * step + i + offsets[i]] = 100;
36 }
37 
38 /* { dg-final { scan-tree-dump-not {want to version} "lversion" } } */
39 /* { dg-final { scan-tree-dump-not {versioned} "lversion" } } */
40