summaryrefslogtreecommitdiff
path: root/tests/tests2/81_types.c
blob: 0bc3bae4270f3da3e13953d69d725abe173ef29b (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* The following are all valid decls, even though some subtypes
   are incomplete.  */
enum E *e;
const enum E *e1;
enum E const *e2;
struct S *s;
const struct S *s1;
struct S const *s2;

/* Various strangely looking declarators, which are all valid
   and have to map to the same numbered typedefs. */
typedef int (*fptr1)();
int f1 (int (), int);
typedef int (*fptr2)(int x);
int f2 (int (int x), int);
typedef int (*fptr3)(int);
int f3 (int (int), int);
typedef int (*fptr4[4])(int);
int f4 (int (*[4])(int), int);
typedef int (*fptr5)(fptr1);
int f5 (int (int()), fptr1);
int f1 (fptr1 fp, int i)
{
  return (*fp)(i);
}
int f2 (fptr2 fp, int i)
{
  return (*fp)(i);
}
int f3 (fptr3 fp, int i)
{
  return (*fp)(i);
}
int f4 (fptr4 fp, int i)
{
  return (*fp[i])(i);
}
int f5 (fptr5 fp, fptr1 i)
{
  return fp(i);
}
typedef int intx4[4];
int f8 (intx4, int);
int f8 (int ([4]), int);
int f8 (int y[4], int i)
{
  return y[i];
}
int f9 (int (*)(int), int);
int f9 (int ((int)), int);
int f9 (int f(int), int i)
{
  return f(i);
}
int main () { return 0; }