OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [compat/] [scalar-by-value-2_x.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 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
T(c, char, 21)
72
T(uc, unsigned char, 22)
73
T(sc, signed char, (-33))
74
T(us, unsigned short, 41)
75
T(ss, short, (-44))
76
T(f, float, 90.0)
77
 
78
#undef T
79
 
80
void
81
scalar_by_value_2_x ()
82
{
83
DEBUG_INIT
84
 
85
#define T(NAME) testit##NAME ();
86
 
87
T(c)
88
T(uc)
89
T(sc)
90
T(us)
91
T(ss)
92
T(f)
93
 
94
DEBUG_FINI
95
 
96
if (fails != 0)
97
  abort ();
98
 
99
#undef T
100
}

powered by: WebSVN 2.1.0

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