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

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gcc.dg/] [compat/] [scalar-return-4_x.c] - Blame information for rev 384

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
#include "compat-common.h"
2
 
3
#define T(NAME, TYPE, INITVAL)                                  \
4
TYPE g01##NAME;                                                 \
5
                                                                \
6
extern void init##NAME (TYPE *p, TYPE v);                       \
7
extern void checkg##NAME (void);                                \
8
extern TYPE test0##NAME (void);                                 \
9
extern TYPE test1##NAME (TYPE);                                 \
10
                                                                \
11
void                                                            \
12
check##NAME (TYPE x, TYPE v)                                    \
13
{                                                               \
14
  if (x != v)                                                   \
15
    DEBUG_CHECK                                                 \
16
}                                                               \
17
                                                                \
18
void                                                            \
19
testit##NAME (void)                                             \
20
{                                                               \
21
  TYPE rslt;                                                    \
22
  DEBUG_FPUTS (#NAME);                                          \
23
  DEBUG_FPUTS (" init: ");                                      \
24
  init##NAME (&g01##NAME,  1);                                  \
25
  checkg##NAME ();                                              \
26
  DEBUG_NL;                                                     \
27
  DEBUG_FPUTS (#NAME);                                          \
28
  DEBUG_FPUTS (" test0: ");                                     \
29
  rslt = test0##NAME ();                                        \
30
  check##NAME (rslt, g01##NAME);                                \
31
  DEBUG_NL;                                                     \
32
  DEBUG_FPUTS (#NAME);                                          \
33
  DEBUG_FPUTS (" test1: ");                                     \
34
  rslt = test1##NAME (g01##NAME);                               \
35
  check##NAME (rslt, g01##NAME);                                \
36
  DEBUG_NL;                                                     \
37
}
38
 
39
#ifndef SKIP_COMPLEX
40
#ifndef SKIP_COMPLEX_INT
41
T(cc, _Complex char, CINT (0, 1))
42
T(cs, _Complex short, CINT (1 + 2))
43
#endif
44
T(cf, _Complex float, CDBL (1.0, 2.0))
45
#endif
46
 
47
#undef T
48
 
49
void
50
scalar_return_4_x ()
51
{
52
DEBUG_INIT
53
 
54
#define T(NAME) testit##NAME ();
55
 
56
#ifndef SKIP_COMPLEX
57
#ifndef SKIP_COMPLEX_INT
58
T(cc)
59
T(cs)
60
#endif
61
T(cf)
62
#endif
63
 
64
DEBUG_FINI
65
 
66
if (fails != 0)
67
  abort ();
68
 
69
#undef T
70
}

powered by: WebSVN 2.1.0

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