summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/graphite/pr35356-1.c
blob: 2ba0c1b0f5ec966fe06fff48dc1e87ed67b2caf4 (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
/* { dg-options "-O2 -fgraphite-identity -fdump-tree-graphite-all" } */

int a[100];

int
foo (int bar, int n, int k)
{
  int i;

  for (i = 0; i < n; i++)
    if (i == k)
      a[i] = bar;

  return a[bar];
}

/* There should be no loops generated for this testcase, instead we
   should generate the following:

   | if (k >= 0 && k < n)
   |   a[k] = bar;

*/

/* { dg-final { scan-tree-dump-times "loop_1" 0 "graphite" } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */