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

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

Line No. Rev Author Line
1 149 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
T(ui, unsigned int, 51)
87
T(si, int, (-55))
88
T(ul, unsigned long, 61)
89
T(sl, long, (-66))
90
T(ull, unsigned long long, 71)
91
T(sll, long long, (-77))
92
T(d, double, 91.0)
93
T(ld, long double, 92.0)
94
 
95
#undef T
96
 
97
void
98
scalar_return_1_x ()
99
{
100
DEBUG_INIT
101
 
102
#define T(NAME) testit##NAME ();
103
 
104
T(ui)
105
T(si)
106
T(ul)
107
T(sl)
108
T(ull)
109
T(sll)
110
T(d)
111
T(ld)
112
 
113
DEBUG_FINI
114
 
115
if (fails != 0)
116
  abort ();
117
 
118
#undef T
119
}

powered by: WebSVN 2.1.0

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