1 /* { dg-options "-O2 -fgraphite-identity -fdump-tree-graphite-all" } */
2
3 int a[100];
4
5 int
foo(int bar,int n,int k)6 foo (int bar, int n, int k)
7 {
8 int i;
9
10 for (i = 0; i < n; i++)
11 if (i == k)
12 a[i] = bar;
13
14 return a[bar];
15 }
16
17 /* There should be no loops generated for this testcase, instead we
18 should generate the following:
19
20 | if (k >= 0 && k < n)
21 | a[k] = bar;
22
23 */
24
25 /* { dg-final { scan-tree-dump-times "loop_1" 0 "graphite" } } */
26 /* { dg-final { cleanup-tree-dump "graphite" } } */
27