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-4_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
#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_INT
40
T(cc, _Complex char, CINT (0, 1))
41
T(cs, _Complex short, CINT (1 + 2))
42
#endif
43
T(cf, _Complex float, CDBL (1.0, 2.0))
44
 
45
#undef T
46
 
47
void
48
scalar_return_4_x ()
49
{
50
DEBUG_INIT
51
 
52
#define T(NAME) testit##NAME ();
53
 
54
#ifndef SKIP_COMPLEX_INT
55
T(cc)
56
T(cs)
57
#endif
58
T(cf)
59
 
60
DEBUG_FINI
61
 
62
if (fails != 0)
63
  abort ();
64
 
65
#undef T
66
}

powered by: WebSVN 2.1.0

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