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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [mips/] [abi-main.h] - Blame information for rev 691

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
#define FOR_EACH_SCALAR(F)      \
2
  F(sc, signed char)            \
3
  F(uc, unsigned char)          \
4
  F(ss, short)                  \
5
  F(us, unsigned short)         \
6
  F(si, int)                    \
7
  F(ui, unsigned int)           \
8
  F(sl, long)                   \
9
  F(ul, unsigned long)          \
10
  F(sll, long long)             \
11
  F(ull, unsigned long long)    \
12
  F(f, float)                   \
13
  F(d, double)                  \
14
  F(ld, long double)            \
15
  F(ptr, void *)
16
 
17
#define EXTERN(SUFFIX, TYPE) extern TYPE x##SUFFIX;
18
#define STATIC(SUFFIX, TYPE) static TYPE s##SUFFIX;
19
#define COMMON(SUFFIX, TYPE) TYPE c##SUFFIX;
20
 
21
#define GETADDR(SUFFIX, TYPE)                   \
22
  TYPE *get##SUFFIX (int which)                 \
23
  {                                             \
24
    return (which == 0 ? &c##SUFFIX              \
25
            : which == 1 ? &s##SUFFIX           \
26
            : &x##SUFFIX);                      \
27
  }
28
 
29
#define COPY(SUFFIX, TYPE) c##SUFFIX = s##SUFFIX; s##SUFFIX = x##SUFFIX;
30
 
31
FOR_EACH_SCALAR (EXTERN)
32
FOR_EACH_SCALAR (STATIC)
33
FOR_EACH_SCALAR (COMMON)
34
 
35
FOR_EACH_SCALAR (GETADDR)
36
 
37
void
38
copy (void)
39
{
40
  FOR_EACH_SCALAR (COPY);
41
}
42
 
43
extern void foo (int);
44
 
45
void
46
sibcall1 (void)
47
{
48
  foo (1);
49
}
50
 
51
void
52
sibcall2 (void)
53
{
54
  foo (csi + ssi + xsi);
55
}
56
 
57
static void
58
sibcall3 (void)
59
{
60
  foo (1);
61
  foo (2);
62
  foo (3);
63
}
64
 
65
extern void bar (void (*) (void));
66
 
67
int
68
nested (int x)
69
{
70
  void sub (void) { foo (x); }
71
  bar (sub);
72
  bar (sibcall3);
73
  return 1;
74
}

powered by: WebSVN 2.1.0

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