aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/decl-9.c
blob: 9bb15609d836ab5eac491468102c96d49545580f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* { dg-do compile } */
/* { dg-options "-std=gnu89 -pedantic-errors" } */

w *x; /* { dg-error "unknown type name 'w'" } */

int z;    /* { dg-message "previous declaration of 'z'" } */
y         /* { dg-error "unknown type name 'y'" } */
  * z;    /* { dg-error "conflicting " } */

int f1()
{
  int d, e;
  d * e; /* { dg-bogus "unknown type name 'd'" } */
  g * h; /* { dg-error "unknown type name 'g'" } */
  /* { dg-error "mixed declarations" "" { target *-*-* } .-1 } */
  g i;   /* { dg-error "unknown type name 'g'" } */
}

typedef int a;

int f2()
{
b: a: ; /* { dg-bogus "a label can only be part of a statement" } */
c: d e; /* { dg-error "a label can only be part of a statement" } */
/* { dg-error "unknown type name 'd'" "unknown type name" { target *-*-* } .-1 } */
   ;
}

void *f3()
{
  return x; /* { dg-bogus "'x' undeclared" } */
}