summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/compat/struct-return-10_x.c
blob: d1531b179bd0cf9c6857038ecb06cf7873dd08ca (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
112
113
114
115
116
117
118
119
#include "compat-common.h"

#define T(TYPE)							\
TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE;		\
TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE;		\
TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE;		\
TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE;		\
								\
extern void init##TYPE (TYPE *p, double y);			\
extern void checkg##TYPE (void);				\
extern TYPE test0##TYPE (void);					\
extern TYPE test1##TYPE (TYPE);					\
extern TYPE testva##TYPE (int n, ...);				\
								\
void								\
testit##TYPE (void)						\
{								\
  TYPE rslt;							\
  DEBUG_FPUTS (#TYPE);						\
  DEBUG_FPUTS (" init: ");					\
  init##TYPE  (&g01##TYPE,  1.0);				\
  init##TYPE  (&g02##TYPE,  2.0);				\
  init##TYPE  (&g03##TYPE,  3.0);				\
  init##TYPE  (&g04##TYPE,  4.0);				\
  init##TYPE  (&g05##TYPE,  5.0);				\
  init##TYPE  (&g06##TYPE,  6.0);				\
  init##TYPE  (&g07##TYPE,  7.0);				\
  init##TYPE  (&g08##TYPE,  8.0);				\
  init##TYPE  (&g09##TYPE,  9.0);				\
  init##TYPE  (&g10##TYPE, 10.0);				\
  init##TYPE  (&g11##TYPE, 11.0);				\
  init##TYPE  (&g12##TYPE, 12.0);				\
  init##TYPE  (&g13##TYPE, 13.0);				\
  init##TYPE  (&g14##TYPE, 14.0);				\
  init##TYPE  (&g15##TYPE, 15.0);				\
  init##TYPE  (&g16##TYPE, 16.0);				\
  checkg##TYPE ();						\
  DEBUG_NL;							\
  DEBUG_FPUTS (#TYPE);						\
  DEBUG_FPUTS (" test0: ");					\
  rslt = test0##TYPE ();					\
  check##TYPE (rslt, 1.0);					\
  DEBUG_NL;							\
  DEBUG_FPUTS (#TYPE);						\
  DEBUG_FPUTS (" test1: ");					\
  rslt = test1##TYPE (g01##TYPE);				\
  check##TYPE (rslt, 1.0);					\
  DEBUG_NL;							\
  DEBUG_FPUTS (#TYPE);						\
  DEBUG_FPUTS (" testva:");					\
  rslt = testva##TYPE (1, g01##TYPE);				\
  check##TYPE (rslt, 1.0);					\
  rslt = testva##TYPE (5, g01##TYPE, g02##TYPE,			\
			  g03##TYPE, g04##TYPE,			\
			  g05##TYPE);				\
  check##TYPE (rslt, 5.0);					\
  rslt = testva##TYPE (9, g01##TYPE, g02##TYPE,			\
			  g03##TYPE, g04##TYPE,			\
			  g05##TYPE, g06##TYPE,			\
			  g07##TYPE, g08##TYPE,			\
			  g09##TYPE);				\
  check##TYPE (rslt, 9.0);					\
  rslt = testva##TYPE (16, g01##TYPE, g02##TYPE,		\
			  g03##TYPE, g04##TYPE,			\
			  g05##TYPE, g06##TYPE,			\
			  g07##TYPE, g08##TYPE,			\
			  g09##TYPE, g10##TYPE,			\
			  g11##TYPE, g12##TYPE,			\
			  g13##TYPE, g14##TYPE,			\
			  g15##TYPE, g16##TYPE);		\
  check##TYPE (rslt, 16.0);					\
  DEBUG_NL;							\
}

#include "fp2-struct-defs.h"
#include "fp2-struct-check.h"

T(Sfd)
T(Sfl)
T(Sdf)
T(Sdl)
T(Slf)
T(Sld)
T(Sfdl)
T(Sfld)
T(Sdfl)
T(Sdlf)
T(Slfd)
T(Sldf)

#undef T

void
struct_return_10_x ()
{
DEBUG_INIT

#define T(TYPE) testit##TYPE ();

T(Sfd);
T(Sfl);
T(Sdf);
T(Sdl);
T(Slf);
T(Sld);
T(Sfdl);
T(Sfld);
T(Sdfl);
T(Sdlf);
T(Slfd);
T(Sldf);

DEBUG_FINI

if (fails != 0)
  return;

#undef T
}