OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [graphite/] [pr35356-2.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { 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] = 1;
13
    else
14
      a[i] = i;
15
 
16
  return a[bar];
17
}
18
 
19
/* We should generate the following:
20
 
21
   | for (i = 0; i < min (n, k); i++)
22
   |   a[i] = i;
23
   | if (k >= 0 && k < n)
24
   |   a[k] = 1;
25
   | for (i = max(k+1,0); i < n; i++)
26
   |   a[i] = i;
27
 
28
   XXX: At the moment we generate to protect loops that are executed zero times.
29
 
30
   | if (0 < min (n, k) + 1)
31
   |   for (i = 0; i < min (n, k); i++)
32
   |     a[i] = i;
33
   | if (k >= 0 && k < n)
34
   |   a[k] = 1;
35
   | if (0 < max(n, k) + 1)
36
   |   for (i = max(k+1,0); i < n; i++)
37
   |     a[i] = i;
38
 
39
*/
40
 
41
 
42
/* { dg-final { scan-tree-dump-times "MIN_EXPR" 2 "graphite" } } */
43
/* { dg-final { scan-tree-dump-times "MAX_EXPR" 2 "graphite" } } */
44
/* { dg-final { cleanup-tree-dump "graphite" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.