aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8.1/gcc/testsuite/gcc.dg/compat/fnptr-by-value-1_y.c
blob: 1f6917cdcba00a2329c68b0f44acf85ca4ad6fed (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#include <stdarg.h>

#include "compat-common.h"

typedef void (*fpi)(int);
typedef void (*fpd)(double);

extern int f1_val;
extern void checki (int, int);

void
test1a (fpi f)
{
  (*f)(1);
}

void
test1b (fpi f, int i)
{
  (*f)(i);
}

void
test1c (double x, fpd f)
{
  (*f)(x);
}

void
test2a (fpi f1, fpd f2)
{
  (*f1)(10);
  (*f2)(10.0);
}

void
test2b (fpi f1, fpd f2, int i)
{
  (*f1)(i);
  (*f2)((double)i);
}

void
test2c (fpi f1, int i, fpd f2)
{
  (*f1)(i);
  (*f2)((double)i);
}

void
test2d (int i, fpi f1, fpd f2)
{
  (*f1)(i);
  (*f2)((double)i);
}

void
test2e (fpi f1, fpd f2, int i, double x)
{
  (*f1)(i);
  (*f2)(x);
}

void
test2f (fpi f1, int i, fpd f2, double x)
{
  (*f1)(i);
  (*f2)(x);
}

void
test2g (fpi f1, int i, double x, fpd f2)
{
  (*f1)(i);
  (*f2)(x);
}

void
test2h (double x, fpd f1, fpi f2, int i)
{
  (*f1)(x);
  (*f2)(i);
}

void
test2i (double x, fpd f1, int i, fpi f2)
{
  (*f1)(x);
  (*f2)(i);
}

void
test2j (int i, double x, fpi f1, fpd f2)
{
  (*f1)(i);
  (*f2)(x);
}

void
testva (int n, ...)
{
  int i;
  va_list ap;
  va_start (ap, n);
  for (i = 0; i < n; i++)
    {
      fpi fp = va_arg (ap, fpi);
      (*fp)(i);
      checki (f1_val, i);
    }
}