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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [debug/] [redecl-1.c] - Blame information for rev 853

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Test for multiple declarations and composite types.  As in bug
2
   13801.  Test no problems in debug information generation.  */
3
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
4
/* { dg-do compile } */
5
/* { dg-options "" } */
6
 
7
typedef int IA[];
8
typedef int A10[10];
9
 
10
/* Test all combinations of: a variable declared at file scope (no
11
   type specifiers, or extern, or static), or just inside a function
12
   (with extern), redeclared in an inner scope (with extern), and
13
   redeclared in an inner scope when the previous declaration is
14
   hidden (with extern, and not if the original declaration was
15
   static).  Test three times: incomplete variable types; pointers to
16
   incomplete types; functions returning such pointers.
17
 
18
   This test only includes the valid code cases, to test debug info
19
   generation.  (Incomplete static at file scope is not permitted by
20
   ISO C, but is accepted by GCC as an extension without
21
   -pedantic.)  */
22
 
23
A10 a5;
24
void
25
f5 (void)
26
{
27
  sizeof(a5);
28
  {
29
    extern IA a5;
30
    sizeof(a5);
31
    {
32
      int a5;
33
      {
34
        extern A10 a5;
35
        sizeof(a5);
36
      }
37
    }
38
    sizeof(a5);
39
  }
40
  sizeof(a5);
41
}
42
extern A10 a5;
43
 
44
A10 a7;
45
void
46
f7 (void)
47
{
48
  sizeof(a7);
49
  {
50
    extern A10 a7;
51
    sizeof(a7);
52
    {
53
      int a7;
54
      {
55
        extern A10 a7;
56
        sizeof(a7);
57
      }
58
    }
59
    sizeof(a7);
60
  }
61
  sizeof(a7);
62
}
63
extern A10 a7;
64
 
65
extern A10 a13;
66
void
67
f13 (void)
68
{
69
  sizeof(a13);
70
  {
71
    extern IA a13;
72
    sizeof(a13);
73
    {
74
      int a13;
75
      {
76
        extern A10 a13;
77
        sizeof(a13);
78
      }
79
    }
80
    sizeof(a13);
81
  }
82
  sizeof(a13);
83
}
84
extern A10 a13;
85
 
86
extern A10 a15;
87
void
88
f15 (void)
89
{
90
  sizeof(a15);
91
  {
92
    extern A10 a15;
93
    sizeof(a15);
94
    {
95
      int a15;
96
      {
97
        extern A10 a15;
98
        sizeof(a15);
99
      }
100
    }
101
    sizeof(a15);
102
  }
103
  sizeof(a15);
104
}
105
extern A10 a15;
106
 
107
 
108
static A10 a18;
109
void
110
f18 (void)
111
{
112
  sizeof(a18);
113
  {
114
    extern IA a18;
115
    sizeof(a18);
116
  }
117
  sizeof(a18);
118
}
119
extern A10 a18;
120
 
121
static A10 a19;
122
void
123
f19 (void)
124
{
125
  sizeof(a19);
126
  {
127
    extern A10 a19;
128
    sizeof(a19);
129
  }
130
  sizeof(a19);
131
}
132
extern A10 a19;
133
 
134
A10 *b5;
135
void
136
g5 (void)
137
{
138
  sizeof(*b5);
139
  {
140
    extern IA *b5;
141
    sizeof(*b5);
142
    {
143
      int b5;
144
      {
145
        extern A10 *b5;
146
        sizeof(*b5);
147
      }
148
    }
149
    sizeof(*b5);
150
  }
151
  sizeof(*b5);
152
}
153
extern A10 *b5;
154
 
155
A10 *b7;
156
void
157
g7 (void)
158
{
159
  sizeof(*b7);
160
  {
161
    extern A10 *b7;
162
    sizeof(*b7);
163
    {
164
      int b7;
165
      {
166
        extern A10 *b7;
167
        sizeof(*b7);
168
      }
169
    }
170
    sizeof(*b7);
171
  }
172
  sizeof(*b7);
173
}
174
extern A10 *b7;
175
 
176
extern A10 *b13;
177
void
178
g13 (void)
179
{
180
  sizeof(*b13);
181
  {
182
    extern IA *b13;
183
    sizeof(*b13);
184
    {
185
      int b13;
186
      {
187
        extern A10 *b13;
188
        sizeof(*b13);
189
      }
190
    }
191
    sizeof(*b13);
192
  }
193
  sizeof(*b13);
194
}
195
extern A10 *b13;
196
 
197
extern A10 *b15;
198
void
199
g15 (void)
200
{
201
  sizeof(*b15);
202
  {
203
    extern A10 *b15;
204
    sizeof(*b15);
205
    {
206
      int b15;
207
      {
208
        extern A10 *b15;
209
        sizeof(*b15);
210
      }
211
    }
212
    sizeof(*b15);
213
  }
214
  sizeof(*b15);
215
}
216
extern A10 *b15;
217
 
218
static A10 *b18;
219
void
220
g18 (void)
221
{
222
  sizeof(*b18);
223
  {
224
    extern IA *b18;
225
    sizeof(*b18);
226
  }
227
  sizeof(*b18);
228
}
229
extern A10 *b18;
230
 
231
static A10 *b19;
232
void
233
g19 (void)
234
{
235
  sizeof(*b19);
236
  {
237
    extern A10 *b19;
238
    sizeof(*b19);
239
  }
240
  sizeof(*b19);
241
}
242
extern A10 *b19;
243
 
244
A10 *c5 (void);
245
void
246
h5 (void)
247
{
248
  sizeof(*c5());
249
  {
250
    extern IA *c5 (void);
251
    sizeof(*c5());
252
    {
253
      int c5;
254
      {
255
        extern A10 *c5 (void);
256
        sizeof(*c5());
257
      }
258
    }
259
    sizeof(*c5());
260
  }
261
  sizeof(*c5());
262
}
263
A10 *c5 (void) { return 0; }
264
 
265
A10 *c7 (void);
266
void
267
h7 (void)
268
{
269
  sizeof(*c7());
270
  {
271
    extern A10 *c7 (void);
272
    sizeof(*c7());
273
    {
274
      int c7;
275
      {
276
        extern A10 *c7 (void);
277
        sizeof(*c7());
278
      }
279
    }
280
    sizeof(*c7());
281
  }
282
  sizeof(*c7());
283
}
284
A10 *c7 (void) { return 0; }
285
 
286
extern A10 *c13 (void);
287
void
288
h13 (void)
289
{
290
  sizeof(*c13());
291
  {
292
    extern IA *c13 (void);
293
    sizeof(*c13());
294
    {
295
      int c13;
296
      {
297
        extern A10 *c13 (void);
298
        sizeof(*c13());
299
      }
300
    }
301
    sizeof(*c13());
302
  }
303
  sizeof(*c13());
304
}
305
extern A10 *c13 (void) { return 0; }
306
 
307
extern A10 *c15 (void);
308
void
309
h15 (void)
310
{
311
  sizeof(*c15());
312
  {
313
    extern A10 *c15 (void);
314
    sizeof(*c15());
315
    {
316
      int c15;
317
      {
318
        extern A10 *c15 (void);
319
        sizeof(*c15());
320
      }
321
    }
322
    sizeof(*c15());
323
  }
324
  sizeof(*c15());
325
}
326
extern A10 *c15 (void) { return 0; }
327
 
328
static A10 *c18 (void);
329
void
330
h18 (void)
331
{
332
  sizeof(*c18());
333
  {
334
    extern IA *c18 (void);
335
    sizeof(*c18());
336
  }
337
  sizeof(*c18());
338
}
339
static A10 *c18 (void) { return 0; }
340
 
341
static A10 *c19 (void);
342
void
343
h19 (void)
344
{
345
  sizeof(*c19());
346
  {
347
    extern A10 *c19 (void);
348
    sizeof(*c19());
349
  }
350
  sizeof(*c19());
351
}
352
static A10 *c19 (void) { return 0; }

powered by: WebSVN 2.1.0

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