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/] [scalar-return-3_x.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
#include "compat-common.h"
2
 
3
#ifdef SKIP_VA
4
const int test_va = 0;
5
#else
6
const int test_va = 1;
7
#endif
8
 
9
#define T(NAME, TYPE, INITVAL)                                  \
10
TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME;                \
11
TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME;                \
12
TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME;                \
13
TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME;                \
14
                                                                \
15
extern void init##NAME (TYPE *p, TYPE v);                       \
16
extern void checkg##NAME (void);                                \
17
extern TYPE test0##NAME (void);                                 \
18
extern TYPE test1##NAME (TYPE);                                 \
19
extern TYPE testva##NAME (int n, ...);                          \
20
                                                                \
21
void                                                            \
22
check##NAME (TYPE x, TYPE v)                                    \
23
{                                                               \
24
  if (x != v)                                                   \
25
    DEBUG_CHECK                                                 \
26
}                                                               \
27
                                                                \
28
void                                                            \
29
testit##NAME (void)                                             \
30
{                                                               \
31
  TYPE rslt;                                                    \
32
  DEBUG_FPUTS (#NAME);                                          \
33
  DEBUG_FPUTS (" init: ");                                      \
34
  init##NAME (&g01##NAME,  1);                                  \
35
  init##NAME (&g02##NAME,  2);                                  \
36
  init##NAME (&g03##NAME,  3);                                  \
37
  init##NAME (&g04##NAME,  4);                                  \
38
  init##NAME (&g05##NAME,  5);                                  \
39
  init##NAME (&g06##NAME,  6);                                  \
40
  init##NAME (&g07##NAME,  7);                                  \
41
  init##NAME (&g08##NAME,  8);                                  \
42
  init##NAME (&g09##NAME,  9);                                  \
43
  init##NAME (&g10##NAME, 10);                                  \
44
  init##NAME (&g11##NAME, 11);                                  \
45
  init##NAME (&g12##NAME, 12);                                  \
46
  init##NAME (&g13##NAME, 13);                                  \
47
  init##NAME (&g14##NAME, 14);                                  \
48
  init##NAME (&g15##NAME, 15);                                  \
49
  init##NAME (&g16##NAME, 16);                                  \
50
  checkg##NAME ();                                              \
51
  DEBUG_NL;                                                     \
52
  DEBUG_FPUTS (#NAME);                                          \
53
  DEBUG_FPUTS (" test0: ");                                     \
54
  rslt = test0##NAME ();                                        \
55
  check##NAME (rslt, g01##NAME);                                \
56
  DEBUG_NL;                                                     \
57
  DEBUG_FPUTS (#NAME);                                          \
58
  DEBUG_FPUTS (" test1: ");                                     \
59
  rslt = test1##NAME (g01##NAME);                               \
60
  check##NAME (rslt, g01##NAME);                                \
61
  if (test_va)                                                  \
62
    {                                                           \
63
      DEBUG_NL;                                                 \
64
      DEBUG_FPUTS (#NAME);                                      \
65
      DEBUG_FPUTS (" testva: ");                                \
66
      rslt = testva##NAME (1, g01##NAME);                       \
67
      check##NAME (rslt, g01##NAME);                            \
68
      rslt = testva##NAME (5, g01##NAME, g02##NAME, g03##NAME,  \
69
                           g04##NAME, g05##NAME);               \
70
      check##NAME (rslt, g05##NAME);                            \
71
      rslt = testva##NAME (9, g01##NAME, g02##NAME, g03##NAME,  \
72
                           g04##NAME, g05##NAME, g06##NAME,     \
73
                           g07##NAME, g08##NAME, g09##NAME);    \
74
      check##NAME (rslt, g09##NAME);                            \
75
      rslt = testva##NAME (16, g01##NAME, g02##NAME, g03##NAME, \
76
                           g04##NAME, g05##NAME, g06##NAME,     \
77
                           g07##NAME, g08##NAME, g09##NAME,     \
78
                           g10##NAME, g11##NAME, g12##NAME,     \
79
                           g13##NAME, g14##NAME, g15##NAME,     \
80
                           g16##NAME);                          \
81
      check##NAME (rslt, g16##NAME);                            \
82
  }                                                             \
83
  DEBUG_NL;                                                     \
84
}
85
 
86
#ifndef SKIP_COMPLEX
87
#ifndef SKIP_COMPLEX_INT
88
T(ci, _Complex int, CINT (2, 3))
89
T(cl, _Complex long, CINT (3, 4))
90
T(cll, _Complex long long, CINT (4, 5))
91
#endif
92
T(cd, _Complex double, CDBL (2.0, 3.0))
93
T(cld, _Complex long double, CDBL (3.0, 4.0))
94
#endif
95
 
96
#undef T
97
 
98
void
99
scalar_return_3_x ()
100
{
101
DEBUG_INIT
102
 
103
#define T(NAME) testit##NAME ();
104
 
105
#ifndef SKIP_COMPLEX
106
#ifndef SKIP_COMPLEX_INT
107
T(ci)
108
T(cl)
109
T(cll)
110
#endif
111
T(cd)
112
T(cld)
113
#endif
114
 
115
DEBUG_FINI
116
 
117
if (fails != 0)
118
  abort ();
119
 
120
#undef T
121
}

powered by: WebSVN 2.1.0

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