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-3.c] - Blame information for rev 149

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