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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [compat/] [fnptr-by-value-1_y.c] - Blame information for rev 867

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

Line No. Rev Author Line
1 149 jeremybenn
#include <stdarg.h>
2
 
3
#include "compat-common.h"
4
 
5
typedef void (*fpi)(int);
6
typedef void (*fpd)(double);
7
 
8
extern int f1_val;
9
extern void checki (int, int);
10
 
11
void
12
test1a (fpi f)
13
{
14
  (*f)(1);
15
}
16
 
17
void
18
test1b (fpi f, int i)
19
{
20
  (*f)(i);
21
}
22
 
23
void
24
test1c (double x, fpd f)
25
{
26
  (*f)(x);
27
}
28
 
29
void
30
test2a (fpi f1, fpd f2)
31
{
32
  (*f1)(10);
33
  (*f2)(10.0);
34
}
35
 
36
void
37
test2b (fpi f1, fpd f2, int i)
38
{
39
  (*f1)(i);
40
  (*f2)((double)i);
41
}
42
 
43
void
44
test2c (fpi f1, int i, fpd f2)
45
{
46
  (*f1)(i);
47
  (*f2)((double)i);
48
}
49
 
50
void
51
test2d (int i, fpi f1, fpd f2)
52
{
53
  (*f1)(i);
54
  (*f2)((double)i);
55
}
56
 
57
void
58
test2e (fpi f1, fpd f2, int i, double x)
59
{
60
  (*f1)(i);
61
  (*f2)(x);
62
}
63
 
64
void
65
test2f (fpi f1, int i, fpd f2, double x)
66
{
67
  (*f1)(i);
68
  (*f2)(x);
69
}
70
 
71
void
72
test2g (fpi f1, int i, double x, fpd f2)
73
{
74
  (*f1)(i);
75
  (*f2)(x);
76
}
77
 
78
void
79
test2h (double x, fpd f1, fpi f2, int i)
80
{
81
  (*f1)(x);
82
  (*f2)(i);
83
}
84
 
85
void
86
test2i (double x, fpd f1, int i, fpi f2)
87
{
88
  (*f1)(x);
89
  (*f2)(i);
90
}
91
 
92
void
93
test2j (int i, double x, fpi f1, fpd f2)
94
{
95
  (*f1)(i);
96
  (*f2)(x);
97
}
98
 
99
void
100
testva (int n, ...)
101
{
102
  int i;
103
  va_list ap;
104
  va_start (ap, n);
105
  for (i = 0; i < n; i++)
106
    {
107
      fpi fp = va_arg (ap, fpi);
108
      (*fp)(i);
109
      checki (f1_val, i);
110
    }
111
}

powered by: WebSVN 2.1.0

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