| 1 |
/* { dg-options "-O2 -fgraphite-identity -fdump-tree-graphite-all" } */ |
| 2 |
|
| 3 |
int a[100]; |
| 4 |
|
| 5 |
int |
| 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 |
for (i = 0; i < n; i++) |
| 15 |
if (i == k) |
| 16 |
a[i] = bar; |
| 17 |
|
| 18 |
return a[bar]; |
| 19 |
} |
| 20 |
|
| 21 |
/* There should be no loops generated for this testcase, instead we |
| 22 |
should generate the following: |
| 23 |
|
| 24 |
| if (k >= 0 && k < n) |
| 25 |
| a[k] = bar; |
| 26 |
|
| 27 |
Check that this text is produced: |
| 28 |
|
| 29 |
AST generated by isl: |
| 30 |
if (n >= k + 1 && k >= 0) { |
| 31 |
S_6(k); |
| 32 |
S_11(k); |
| 33 |
} |
| 34 |
|
| 35 |
*/ |
| 36 |
|
| 37 |
/* { dg-final { scan-tree-dump "if \\\(P_\[0-9\]+ >= P_\[0-9\]+ \\\+ 1 && P_\[0-9\]+ >= 0\\\) \\\{" "graphite" } } */ |