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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [ssa-ccp-1.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -fdump-tree-store_ccp" } */
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 "store_ccp"} } */
75
/* { dg-final { cleanup-tree-dump "store_ccp" } } */

powered by: WebSVN 2.1.0

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