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/] [tree-ssa/] [ssa-ccp-3.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O -fdump-tree-ccp2" } */
3
 
4
extern void link_error (void);
5
 
6
/* Some addresses clearly cannot be equal, check that some address
7
   expressions can be evaluated as constants.
8
   Most of the tests are folding tests, but at least some require
9
   points-to analysis, so we scan the first CCP dump after PTA.  */
10
 
11
char g1, g2;
12
void test6 (char p1, char p2)
13
{
14
  char l1 = 1, l2 = 2;
15
  static char s1 = 5, s2 = 7;
16
  if (&l1 == &l2)
17
    link_error ();
18
 
19
  if (&p1 == &p2)
20
    link_error ();
21
 
22
  if (&s1 == &s2)
23
    link_error ();
24
 
25
  if (&g1 == &g2)
26
    link_error ();
27
 
28
  if (&p1 == &l1)
29
    link_error ();
30
 
31
  if (&p1 == &s1)
32
    link_error ();
33
 
34
  if (&p1 == &l2)
35
    link_error ();
36
 
37
  if (&p1 == &g1)
38
    link_error ();
39
 
40
  if (&l1 == &g1)
41
    link_error ();
42
 
43
  if (&s1 == &g1)
44
    link_error ();
45
}
46
 
47
extern void *alloc (int) __attribute__ ((malloc));
48
char gca1[128];
49
char* __restrict__ rgc1;
50
char* test66 (char * __restrict__ rp1, char * __restrict__ rp2, char *p1)
51
{
52
  char * __restrict__ rl1 = p1;
53
  char * l1 = (char*) alloc (20);
54
 
55
  if (l1 == rgc1)
56
    link_error ();
57
 
58
  if (l1 == rp1)
59
    link_error ();
60
 
61
  if (l1 == rl1)
62
    link_error ();
63
 
64
  if (l1 == gca1)
65
    link_error ();
66
 
67
  if (rl1 == rgc1)
68
    link_error ();
69
 
70
  if (rl1 == rp1)
71
    link_error ();
72
 
73
  if (rl1 == gca1)
74
    link_error ();
75
 
76
  if (rp1 == rp2)
77
    link_error ();
78
 
79
  if (rp1 == rgc1)
80
    link_error ();
81
 
82
  if (rp1 == gca1)
83
    link_error ();
84
 
85
  if (gca1 == rgc1)
86
    link_error ();
87
 
88
}
89
 
90
int gci1[128];
91
int* __restrict__ rgi1;
92
int* test666 (int * __restrict__ rp1, int * __restrict__ rp2, int *p1)
93
{
94
  int * __restrict__ rl1 = p1;
95
  int * l1 = (int*) alloc (20);
96
 
97
  if (l1 == rgi1)
98
    link_error ();
99
 
100
  if (l1 == rp1)
101
    link_error ();
102
 
103
  if (l1 == rl1)
104
    link_error ();
105
 
106
  if (l1 == gci1)
107
    link_error ();
108
 
109
  if (rl1 == rgi1)
110
    link_error ();
111
 
112
  if (rl1 == rp1)
113
    link_error ();
114
 
115
  if (rl1 == gci1)
116
    link_error ();
117
 
118
  if (rp1 == rp2)
119
    link_error ();
120
 
121
  if (rp1 == rgi1)
122
    link_error ();
123
 
124
  if (rp1 == gci1)
125
    link_error ();
126
 
127
  if (gci1 == rgi1)
128
    link_error ();
129
}
130
 
131
 
132
/* There should be not link_error calls, if there is any the
133
   optimization has failed */
134
/* ??? While we indeed don't handle some of these, a couple of the
135
   restrict tests are incorrect.  */
136
/* { dg-final { scan-tree-dump-times "link_error" 0 "ccp2" { xfail *-*-* } } } */
137
/* { dg-final { cleanup-tree-dump "ccp2" } } */

powered by: WebSVN 2.1.0

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