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-by-value-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, g02##NAME, g03##NAME, g04##NAME;                \
5
TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME;                \
6
TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME;                \
7
TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME;                \
8
                                                                \
9
extern void init##NAME (TYPE *p, TYPE v);                       \
10
extern void checkg##NAME (void);                                \
11
extern void                                                     \
12
test##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04,             \
13
            TYPE x05, TYPE x06, TYPE x07, TYPE x08,             \
14
            TYPE x09, TYPE x10, TYPE x11, TYPE x12,             \
15
            TYPE x13, TYPE x14, TYPE x15, TYPE x16);            \
16
                                                                \
17
void                                                            \
18
check##NAME (TYPE x, TYPE v)                                    \
19
{                                                               \
20
  if (x != v + INITVAL)                                         \
21
    DEBUG_CHECK                                                 \
22
}                                                               \
23
                                                                \
24
void                                                            \
25
test2_##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04,           \
26
              TYPE x05, TYPE x06, TYPE x07, TYPE x08)           \
27
{                                                               \
28
  test##NAME (x01, g02##NAME, x02, g04##NAME,                   \
29
              x03, g06##NAME, x04, g08##NAME,                   \
30
              x05, g10##NAME, x06, g12##NAME,                   \
31
              x07, g14##NAME, x08, g16##NAME);                  \
32
}                                                               \
33
                                                                \
34
void                                                            \
35
testit##NAME (void)                                             \
36
{                                                               \
37
  DEBUG_FPUTS (#NAME);                                          \
38
  DEBUG_FPUTS (" init: ");                                      \
39
  init##NAME (&g01##NAME,  1);                                  \
40
  init##NAME (&g02##NAME,  2);                                  \
41
  init##NAME (&g03##NAME,  3);                                  \
42
  init##NAME (&g04##NAME,  4);                                  \
43
  init##NAME (&g05##NAME,  5);                                  \
44
  init##NAME (&g06##NAME,  6);                                  \
45
  init##NAME (&g07##NAME,  7);                                  \
46
  init##NAME (&g08##NAME,  8);                                  \
47
  init##NAME (&g09##NAME,  9);                                  \
48
  init##NAME (&g10##NAME, 10);                                  \
49
  init##NAME (&g11##NAME, 11);                                  \
50
  init##NAME (&g12##NAME, 12);                                  \
51
  init##NAME (&g13##NAME, 13);                                  \
52
  init##NAME (&g14##NAME, 14);                                  \
53
  init##NAME (&g15##NAME, 15);                                  \
54
  init##NAME (&g16##NAME, 16);                                  \
55
  checkg##NAME ();                                              \
56
  DEBUG_NL;                                                     \
57
  DEBUG_FPUTS (#NAME);                                          \
58
  DEBUG_FPUTS (" test: ");                                      \
59
  test##NAME (g01##NAME, g02##NAME, g03##NAME, g04##NAME,       \
60
              g05##NAME, g06##NAME, g07##NAME, g08##NAME,       \
61
              g09##NAME, g10##NAME, g11##NAME, g12##NAME,       \
62
              g13##NAME, g14##NAME, g15##NAME, g16##NAME);      \
63
  DEBUG_NL;                                                     \
64
  DEBUG_FPUTS (#NAME);                                          \
65
  DEBUG_FPUTS (" test2: ");                                     \
66
  test2_##NAME (g01##NAME, g03##NAME, g05##NAME, g07##NAME,     \
67
                g09##NAME, g11##NAME, g13##NAME, g15##NAME);    \
68
  DEBUG_NL;                                                     \
69
}
70
 
71
#ifndef SKIP_COMPLEX_INT
72
T(cc, _Complex char, CINT (0, 1))
73
T(cs, _Complex short, CINT (1, 2))
74
#endif
75
T(cf, _Complex float, CDBL (6.0, 7.0))
76
 
77
#undef T
78
 
79
void
80
scalar_by_value_4_x ()
81
{
82
DEBUG_INIT
83
 
84
#define T(NAME) testit##NAME ();
85
 
86
#ifndef SKIP_COMPLEX_INT
87
T(cc)
88
T(cs)
89
#endif
90
T(cf)
91
 
92
DEBUG_FINI
93
 
94
if (fails != 0)
95
  abort ();
96
 
97
#undef T
98
}

powered by: WebSVN 2.1.0

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