libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / graphite / pr35356-1.c
blob07339c8f6417dad5025943e917ec906750997435
1 /* { dg-options "-O2 -fgraphite-identity -fdump-tree-graphite-all" } */
3 int a[100];
5 int
6 foo (int bar, int n, int k)
8 int i;
10 for (i = 0; i < n; i++)
11 if (i == k)
12 a[i] = bar;
14 for (i = 0; i < n; i++)
15 if (i == k)
16 a[i] = bar;
18 return a[bar];
21 /* There should be no loops generated for this testcase, instead we
22 should generate the following:
24 | if (k >= 0 && k < n)
25 | a[k] = bar;
27 Check that this text is produced:
29 AST generated by isl:
30 if (n >= k + 1 && k >= 0) {
31 S_6(k);
32 S_11(k);
37 /* { dg-final { scan-tree-dump "if \\\(P_\[0-9\]+ >= P_\[0-9\]+ \\\+ 1 && P_\[0-9\]+ >= 0\\\) \\\{" "graphite" } } */