OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [redecl-2.c] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Test for multiple declarations of an identifier at same block
2
   scope: only valid case is all extern.  */
3
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
4
/* { dg-do compile } */
5
/* { dg-options "" } */
6
 
7
void
8
fa0 (void)
9
{
10
  int a0; /* { dg-error "previous declaration" } */
11
  int a0; /* { dg-error "redeclaration" } */
12
}
13
 
14
void
15
fa1 (void)
16
{
17
  int a1; /* { dg-error "previous declaration" } */
18
  static int a1; /* { dg-error "redeclaration" } */
19
}
20
 
21
void
22
fa2 (void)
23
{
24
  int a2; /* { dg-error "previous declaration" } */
25
  extern int a2; /* { dg-error "follows declaration with no linkage" } */
26
}
27
 
28
void
29
fa3 (void)
30
{
31
  static int a3; /* { dg-error "previous declaration" } */
32
  int a3; /* { dg-error "redeclaration" } */
33
}
34
 
35
void
36
fa4 (void)
37
{
38
  static int a4; /* { dg-error "previous declaration" } */
39
  static int a4; /* { dg-error "redeclaration" } */
40
}
41
 
42
void
43
fa5 (void)
44
{
45
  static int a5; /* { dg-error "previous declaration" } */
46
  extern int a5; /* { dg-error "follows declaration with no linkage" } */
47
}
48
 
49
void
50
fa6 (void)
51
{
52
  extern int a6; /* { dg-error "previous declaration" } */
53
  int a6; /* { dg-error "follows extern declaration" } */
54
}
55
 
56
void
57
fa7 (void)
58
{
59
  extern int a7; /* { dg-error "previous declaration" } */
60
  static int a7; /* { dg-error "follows extern declaration" } */
61
}
62
 
63
void
64
fa8 (void)
65
{
66
  extern int a8;
67
  extern int a8;
68
}

powered by: WebSVN 2.1.0

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