OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [compat/] [struct-return-10_y.c] - Blame information for rev 404

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

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

powered by: WebSVN 2.1.0

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