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/] [struct-return-10_y.c] - Blame information for rev 816

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
#ifdef SKIP_VA
6
const int test_va = 0;
7
#else
8
const int test_va = 1;
9
#endif
10
 
11
#include "fp2-struct-defs.h"
12
#include "fp2-struct-init.h"
13
 
14
#define T(TYPE)                                                 \
15
extern TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE;         \
16
extern TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE;         \
17
extern TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE;         \
18
extern TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE;         \
19
                                                                \
20
extern void check##TYPE (TYPE x, double y);                     \
21
                                                                \
22
void                                                            \
23
checkg##TYPE (void)                                             \
24
{                                                               \
25
  check##TYPE (g01##TYPE,  1.0);                                        \
26
  check##TYPE (g02##TYPE,  2.0);                                        \
27
  check##TYPE (g03##TYPE,  3.0);                                        \
28
  check##TYPE (g04##TYPE,  4.0);                                        \
29
  check##TYPE (g05##TYPE,  5.0);                                        \
30
  check##TYPE (g06##TYPE,  6.0);                                        \
31
  check##TYPE (g07##TYPE,  7.0);                                        \
32
  check##TYPE (g08##TYPE,  8.0);                                        \
33
  check##TYPE (g09##TYPE,  9.0);                                        \
34
  check##TYPE (g10##TYPE, 10.0);                                        \
35
  check##TYPE (g11##TYPE, 11.0);                                        \
36
  check##TYPE (g12##TYPE, 12.0);                                        \
37
  check##TYPE (g13##TYPE, 13.0);                                        \
38
  check##TYPE (g14##TYPE, 14.0);                                        \
39
  check##TYPE (g15##TYPE, 15.0);                                        \
40
  check##TYPE (g16##TYPE, 16.0);                                        \
41
}                                                               \
42
                                                                \
43
TYPE                                                            \
44
test0##TYPE (void)                                              \
45
{                                                               \
46
  return g01##TYPE;                                             \
47
}                                                               \
48
                                                                \
49
TYPE                                                            \
50
test1##TYPE (TYPE x01)                                          \
51
{                                                               \
52
  return x01;                                                   \
53
}                                                               \
54
                                                                \
55
TYPE                                                            \
56
testva##TYPE (int n, ...)                                       \
57
{                                                               \
58
  int i;                                                        \
59
  TYPE rslt;                                                    \
60
  va_list ap;                                                   \
61
  if (test_va)                                                  \
62
    {                                                           \
63
      va_start (ap, n);                                         \
64
      for (i = 0; i < n; i++)                                    \
65
        {                                                       \
66
          rslt = va_arg (ap, TYPE);                             \
67
        }                                                       \
68
      va_end (ap);                                              \
69
    }                                                           \
70
  return rslt;                                                  \
71
}
72
 
73
T(Sfd)
74
T(Sfl)
75
T(Sdf)
76
T(Sdl)
77
T(Slf)
78
T(Sld)
79
T(Sfdl)
80
T(Sfld)
81
T(Sdfl)
82
T(Sdlf)
83
T(Slfd)
84
T(Sldf)

powered by: WebSVN 2.1.0

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