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

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(TYPE)                                                 \
10
TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE;                \
11
TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE;                \
12
TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE;                \
13
TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE;                \
14
                                                                \
15
extern void init##TYPE (TYPE *p, int i);                        \
16
extern void checkg##TYPE (void);                                \
17
extern TYPE test0##TYPE (void);                                 \
18
extern TYPE test1##TYPE (TYPE);                                 \
19
extern TYPE testva##TYPE (int n, ...);                          \
20
                                                                \
21
void                                                            \
22
testit##TYPE (void)                                             \
23
{                                                               \
24
  TYPE rslt;                                                    \
25
  DEBUG_FPUTS (#TYPE);                                          \
26
  DEBUG_FPUTS (" init: ");                                      \
27
  init##TYPE  (&g01##TYPE,  1);                                 \
28
  init##TYPE  (&g02##TYPE,  2);                                 \
29
  init##TYPE  (&g03##TYPE,  3);                                 \
30
  init##TYPE  (&g04##TYPE,  4);                                 \
31
  init##TYPE  (&g05##TYPE,  5);                                 \
32
  init##TYPE  (&g06##TYPE,  6);                                 \
33
  init##TYPE  (&g07##TYPE,  7);                                 \
34
  init##TYPE  (&g08##TYPE,  8);                                 \
35
  init##TYPE  (&g09##TYPE,  9);                                 \
36
  init##TYPE  (&g10##TYPE, 10);                                 \
37
  init##TYPE  (&g11##TYPE, 11);                                 \
38
  init##TYPE  (&g12##TYPE, 12);                                 \
39
  init##TYPE  (&g13##TYPE, 13);                                 \
40
  init##TYPE  (&g14##TYPE, 14);                                 \
41
  init##TYPE  (&g15##TYPE, 15);                                 \
42
  init##TYPE  (&g16##TYPE, 16);                                 \
43
  checkg##TYPE ();                                              \
44
  DEBUG_NL;                                                     \
45
  DEBUG_FPUTS (#TYPE);                                          \
46
  DEBUG_FPUTS (" test0: ");                                     \
47
  rslt = test0##TYPE ();                                        \
48
  check##TYPE (rslt, 1);                                        \
49
  DEBUG_NL;                                                     \
50
  DEBUG_FPUTS (#TYPE);                                          \
51
  DEBUG_FPUTS (" test1: ");                                     \
52
  rslt = test1##TYPE (g01##TYPE);                               \
53
  check##TYPE (rslt, 1);                                        \
54
  if (test_va)                                                  \
55
    {                                                           \
56
      DEBUG_NL;                                                 \
57
      DEBUG_FPUTS (#TYPE);                                      \
58
      DEBUG_FPUTS (" testva: ");                                \
59
      rslt = testva##TYPE (1, g01##TYPE);                       \
60
      check##TYPE (rslt, 1);                                    \
61
      rslt = testva##TYPE (5, g01##TYPE, g02##TYPE,             \
62
                           g03##TYPE, g04##TYPE,                \
63
                           g05##TYPE);                          \
64
      check##TYPE (rslt, 5);                                    \
65
      rslt = testva##TYPE (9, g01##TYPE, g02##TYPE,             \
66
                           g03##TYPE, g04##TYPE,                \
67
                           g05##TYPE, g06##TYPE,                \
68
                           g07##TYPE, g08##TYPE,                \
69
                           g09##TYPE);                          \
70
      check##TYPE (rslt, 9);                                    \
71
      rslt = testva##TYPE (16, g01##TYPE, g02##TYPE,            \
72
                           g03##TYPE, g04##TYPE,                \
73
                           g05##TYPE, g06##TYPE,                \
74
                           g07##TYPE, g08##TYPE,                \
75
                           g09##TYPE, g10##TYPE,                \
76
                           g11##TYPE, g12##TYPE,                \
77
                           g13##TYPE, g14##TYPE,                \
78
                           g15##TYPE, g16##TYPE);               \
79
      check##TYPE (rslt, 16);                                   \
80
    }                                                           \
81
  DEBUG_NL;                                                     \
82
}
83
 
84
#include "union-defs.h"
85
#include "union-check.h"
86
 
87
T(Ucs)
88
T(Uci)
89
T(Ucl)
90
T(Ucll)
91
T(Usi)
92
T(Usl)
93
T(Usll)
94
T(Uil)
95
T(Uill)
96
T(Ulll)
97
 
98
#undef T
99
 
100
void
101
union_return_1_x ()
102
{
103
DEBUG_INIT
104
 
105
#define T(TYPE) testit##TYPE ();
106
 
107
T(Ucs)
108
T(Uci)
109
T(Ucl)
110
T(Ucll)
111
T(Usi)
112
T(Usl)
113
T(Usll)
114
T(Uil)
115
T(Uill)
116
T(Ulll)
117
 
118
DEBUG_FINI
119
 
120
if (fails != 0)
121
  abort ();
122
 
123
#undef T
124
}

powered by: WebSVN 2.1.0

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