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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [ssa-ccp-1.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O -fdump-tree-ccp1" } */
3
 
4
extern void link_error (void);
5
 
6
/* check folding */
7
 
8
void test1 (void)
9
{
10
  unsigned int l = 3 * 4 - 5 / 2;
11
  if (l != 10)
12
    link_error ();
13
}
14
 
15
void test11 (void)
16
{
17
  unsigned int l = (((((((3 / 2 + 2) * 4) & 7) ^ 3) % 8) << 2) + 1) >> 2;
18
  if (l != 7)
19
    link_error ();
20
}
21
 
22
/* cprop in a basic block */
23
void test111 (void)
24
{
25
  unsigned int l0 = 3 / 2 + 2;
26
  unsigned int l1 = l0 * 4;
27
  unsigned int l2 = 7;
28
  unsigned int l3 = l1 & l2;
29
  unsigned int l4 = 3;
30
  unsigned int l5 = l3 ^ l4;
31
  unsigned int l6 = 8;
32
  unsigned int l7 = l5 % l6;
33
  unsigned int l8 = 2;
34
  unsigned int l9 = l7 << l8;
35
  unsigned int l10 = l9 + 1;
36
  unsigned int l11 = l10 >> 2;
37
  if (l11 != 7)
38
    link_error ();
39
}
40
 
41
 
42
/* cprop after an if statement */
43
void test1111 (int p)
44
{
45
  int l = 53;
46
  if (p)
47
    {
48
      if ((67 + l - 25) != 95)
49
        link_error ();
50
    }
51
  else
52
    {
53
      if ((93 - l +  25) != 65)
54
        link_error ();
55
    }
56
}
57
 
58
/* cprop after a loop */
59
void test11111 (int p, int q, int r)
60
{
61
  int l = 53;
62
  while (p < r)
63
    {
64
      if ((67 + l - 25) != 95)
65
        link_error ();
66
      p -= q;
67
    }
68
}
69
 
70
 
71
 
72
/* There should be not link_error calls, if there is any the
73
   optimization has failed */
74
/* { dg-final { scan-tree-dump-times "link_error" 0 "ccp1"} } */
75
/* { dg-final { cleanup-tree-dump "ccp1" } } */

powered by: WebSVN 2.1.0

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