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-2.c] - Blame information for rev 867

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-optimized" } */
3
 
4
extern void link_error (void);
5
 
6
 
7
/* check that cprop for variables of different types still works even
8
   if function calls or assignments to different types of data are
9
   interposed.  */
10
 
11
int test7 (int *intarr)
12
{
13
  extern int foo7 (int);
14
  int u = 7, v1;
15
  foo7 (u);
16
  v1 = u;
17
  if (v1 != 7)
18
    link_error ();
19
  return v1;
20
}
21
 
22
int test77 (int *arr)
23
{
24
  int u = 7, v1;
25
  arr[0] = 4;
26
  v1 = u;
27
  if (v1 != 7)
28
    link_error ();
29
  return v1 + arr[0];
30
}
31
 
32
int test777 (void)
33
{
34
  extern int foo(int *);
35
  int u = 7, v1;
36
  static int sarr[10];
37
  sarr[0] = 4;
38
  v1 = u;
39
  if (v1 != 7)
40
    link_error ();
41
  foo (sarr);
42
  return v1 + sarr[0];
43
}
44
 
45
int garr[10];
46
int test7777 (void)
47
{
48
  int u = 7, v1;
49
  garr[0] = 4;
50
  v1 = u;
51
  if (v1 != 7)
52
    link_error ();
53
  return v1 + garr[0];
54
}
55
 
56
int test88 (int *arr)
57
{
58
  static int l;
59
  int v1;
60
  l = 8;
61
  arr[0] = 4;
62
  v1 = l;
63
  if (v1 != 8)
64
    link_error ();
65
  l = foo88 (l);
66
  return v1 + arr[0];
67
}
68
 
69
int test888 (void)
70
{
71
  static int l;
72
  extern int foo(int *);
73
  int v1;
74
  static int sarr[10];
75
  l = 8;
76
  sarr[0] = 4;
77
  v1 = l;
78
  if (v1 != 8)
79
    link_error ();
80
  foo (sarr);
81
  l = foo88(l);
82
  return v1 + sarr[0];
83
}
84
 
85
int test8888 (void)
86
{
87
  static int l;
88
  int v1;
89
  l = 8;
90
  garr[0] = 4;
91
  v1 = l;
92
  if (v1 != 8)
93
    link_error ();
94
  return v1 + garr[0];
95
}
96
 
97
 
98
 
99
/* global var  */
100
int g9;
101
int garr9[10];
102
int test9 (int *intarr)
103
{
104
  extern int foo9 (int) __attribute__ ((const));
105
  int h, v;
106
  g9 = 9;
107
  h = foo9 (g9);
108
  v = g9;
109
  if (v != 9)
110
    link_error ();
111
  return g9;
112
}
113
 
114
int test99 (int *intarr)
115
{
116
  extern int foo9 (int) __attribute__ ((pure));
117
  int h, v;
118
  g9 = 9;
119
  h = foo9 (g9);
120
  v = g9;
121
  if (v != 9)
122
    link_error ();
123
  return g9;
124
}
125
 
126
extern int foo99 (int);
127
 
128
int test999 (int *arr)
129
{
130
  static int l;
131
  int v1;
132
  g9 = 9;
133
  l = 4;
134
  v1 = g9;
135
  if (v1 != 9)
136
    link_error ();
137
  l = foo99 (l);
138
  return v1 + l;
139
}
140
 
141
 
142
int test9999 (void)
143
{
144
  int v1;
145
  static int sarr[10];
146
  g9 = 9;
147
  sarr[0] = 4;
148
  v1 = g9;
149
  if (v1 != 9)
150
    link_error ();
151
  foo (sarr);
152
  g9 = foo99 (g9);
153
  return v1 + sarr[0];
154
}
155
 
156
 
157
int test99999 (void)
158
{
159
  int v1;
160
  g9 = 9;
161
  garr9[0] = 4;
162
  v1 = g9;
163
  if (v1 != 9)
164
    link_error ();
165
  return v1 + garr9[0];
166
}
167
 
168
 
169
/* There should be not link_error calls, if there is any the
170
   optimization has failed */
171
/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
172
/* { dg-final { cleanup-tree-dump "optimized" } } */

powered by: WebSVN 2.1.0

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