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/] [vector-check.h] - Blame information for rev 867

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
#define TEST(NUM,TMODE,VAL)                             \
2
extern v##NUM##TMODE g_v##NUM##TMODE;                   \
3
extern TMODE g_##TMODE;                                 \
4
                                                        \
5
extern void pass_v##NUM##TMODE (v##NUM##TMODE);         \
6
extern v##NUM##TMODE return_v##NUM##TMODE (void);       \
7
                                                        \
8
void                                                    \
9
checkp_##NUM##TMODE (TMODE *p)                          \
10
{                                                       \
11
  int i;                                                \
12
  for (i = 0; i < NUM; i++)                              \
13
    {                                                   \
14
      if (p[i] != g_##TMODE + i)                        \
15
        DEBUG_CHECK;                                    \
16
    }                                                   \
17
}                                                       \
18
                                                        \
19
void                                                    \
20
checkg_##NUM##TMODE (void)                              \
21
{                                                       \
22
  u##NUM##TMODE u;                                      \
23
  TMODE *p = u.a;                                       \
24
                                                        \
25
  u.v = g_v##NUM##TMODE;                                \
26
  checkp_##NUM##TMODE (p);                              \
27
}                                                       \
28
                                                        \
29
void                                                    \
30
init_##NUM##TMODE (void)                                \
31
{                                                       \
32
  int i;                                                \
33
  u##NUM##TMODE u;                                      \
34
  g_##TMODE = VAL;                                      \
35
  for (i = 0; i < NUM; i++)                              \
36
    u.a[i] = VAL + i;                                   \
37
  g_v##NUM##TMODE = u.v;                                \
38
}                                                       \
39
                                                        \
40
void                                                    \
41
test_v##NUM##TMODE (void)                               \
42
{                                                       \
43
  v##NUM##TMODE v;                                      \
44
  u##NUM##TMODE u;                                      \
45
  TMODE *p = u.a;                                       \
46
                                                        \
47
  DEBUG_FPUTS ("v" #NUM #TMODE);                        \
48
  DEBUG_NL;                                             \
49
  DEBUG_FPUTS ("  global variable:");                   \
50
  init_##NUM##TMODE ();                                 \
51
  checkg_##NUM##TMODE ();                               \
52
  DEBUG_NL;                                             \
53
  DEBUG_FPUTS ("  pass global variable:");              \
54
  pass_v##NUM##TMODE (g_v##NUM##TMODE);                 \
55
  DEBUG_NL;                                             \
56
  DEBUG_FPUTS ("  pass local variable:");               \
57
  v = g_v##NUM##TMODE;                                  \
58
  pass_v##NUM##TMODE (v);                               \
59
  DEBUG_NL;                                             \
60
  DEBUG_FPUTS ("  function return:");                   \
61
  u.v = return_v##NUM##TMODE ();                        \
62
  checkp_##NUM##TMODE (p);                              \
63
  DEBUG_NL;                                             \
64
}

powered by: WebSVN 2.1.0

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