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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [fixed-point/] [func-array.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-std=gnu99" } */
3
 
4
/* C99 6.5.2.2 Function calls.
5
   Test passing array elements involving fixed-point types.
6
   Based on the test from ../dfp/.  */
7
 
8
extern void abort (void);
9
 
10
/* A handful of functions that return the Nth argument of
11
   an incoming array.  */
12
 
13
#define FUNC(TYPE,NAME) \
14
TYPE NAME ## 0 (TYPE args[]) { return args[0]; } \
15
TYPE NAME ## 1 (TYPE args[]) { return args[1]; } \
16
TYPE NAME ## 2 (TYPE args[]) { return args[2]; } \
17
TYPE NAME ## 3 (TYPE args[]) { return args[3]; } \
18
TYPE NAME ## 4 (TYPE args[]) { return args[4]; } \
19
TYPE NAME ## 5 (TYPE args[]) { return args[5]; }
20
 
21
FUNC (short _Fract, sf)
22
FUNC (_Fract, f)
23
FUNC (long _Fract, lf)
24
FUNC (long long _Fract, llf)
25
FUNC (unsigned short _Fract, usf)
26
FUNC (unsigned _Fract, uf)
27
FUNC (unsigned long _Fract, ulf)
28
FUNC (unsigned long long _Fract, ullf)
29
FUNC (_Sat short _Fract, Ssf)
30
FUNC (_Sat _Fract, Sf)
31
FUNC (_Sat long _Fract, Slf)
32
FUNC (_Sat long long _Fract, Sllf)
33
FUNC (_Sat unsigned short _Fract, Susf)
34
FUNC (_Sat unsigned _Fract, Suf)
35
FUNC (_Sat unsigned long _Fract, Sulf)
36
FUNC (_Sat unsigned long long _Fract, Sullf)
37
FUNC (short _Accum, sa)
38
FUNC (_Accum, a)
39
FUNC (long _Accum, la)
40
FUNC (long long _Accum, lla)
41
FUNC (unsigned short _Accum, usa)
42
FUNC (unsigned _Accum, ua)
43
FUNC (unsigned long _Accum, ula)
44
FUNC (unsigned long long _Accum, ulla)
45
FUNC (_Sat short _Accum, Ssa)
46
FUNC (_Sat _Accum, Sa)
47
FUNC (_Sat long _Accum, Sla)
48
FUNC (_Sat long long _Accum, Slla)
49
FUNC (_Sat unsigned short _Accum, Susa)
50
FUNC (_Sat unsigned _Accum, Sua)
51
FUNC (_Sat unsigned long _Accum, Sula)
52
FUNC (_Sat unsigned long long _Accum, Sulla)
53
 
54
int main()
55
{
56
#define TEST(TYPE,NAME,PF) \
57
  { \
58
    TYPE NAME[] = { 0.0 ## PF, 0.1 ## PF, 0.2 ## PF, 0.3 ## PF, 0.4 ## PF, \
59
                    0.5 ## PF }; \
60
    if (NAME ## 0 (NAME) != 0.0 ## PF) abort (); \
61
    if (NAME ## 1 (NAME) != 0.1 ## PF) abort (); \
62
    if (NAME ## 2 (NAME) != 0.2 ## PF) abort (); \
63
    if (NAME ## 3 (NAME) != 0.3 ## PF) abort (); \
64
    if (NAME ## 4 (NAME) != 0.4 ## PF) abort (); \
65
    if (NAME ## 5 (NAME) != 0.5 ## PF) abort (); \
66
  }
67
 
68
  TEST (short _Fract, sf, hr)
69
  TEST (_Fract, f, r)
70
  TEST (long _Fract, lf, lr)
71
  TEST (long long _Fract, llf, llr)
72
  TEST (unsigned short _Fract, usf, uhr)
73
  TEST (unsigned _Fract, uf, ur)
74
  TEST (unsigned long _Fract, ulf, ulr)
75
  TEST (unsigned long long _Fract, ullf, ullr)
76
  TEST (_Sat short _Fract, Ssf, hr)
77
  TEST (_Sat _Fract, Sf, r)
78
  TEST (_Sat long _Fract, Slf, lr)
79
  TEST (_Sat long long _Fract, Sllf, llr)
80
  TEST (_Sat unsigned short _Fract, Susf, uhr)
81
  TEST (_Sat unsigned _Fract, Suf, ur)
82
  TEST (_Sat unsigned long _Fract, Sulf, ulr)
83
  TEST (_Sat unsigned long long _Fract, Sullf, ullr)
84
  TEST (short _Accum, sa, hk)
85
  TEST (_Accum, a, k)
86
  TEST (long _Accum, la, lk)
87
  TEST (long long _Accum, lla, llk)
88
  TEST (unsigned short _Accum, usa, uhk)
89
  TEST (unsigned _Accum, ua, uk)
90
  TEST (unsigned long _Accum, ula, ulk)
91
  TEST (unsigned long long _Accum, ulla, ullk)
92
  TEST (_Sat short _Accum, Ssa, hk)
93
  TEST (_Sat _Accum, Sa, k)
94
  TEST (_Sat long _Accum, Sla, lk)
95
  TEST (_Sat long long _Accum, Slla, llk)
96
  TEST (_Sat unsigned short _Accum, Susa, uhk)
97
  TEST (_Sat unsigned _Accum, Sua, uk)
98
  TEST (_Sat unsigned long _Accum, Sula, ulk)
99
  TEST (_Sat unsigned long long _Accum, Sulla, ullk)
100
 
101
  return 0;
102
}

powered by: WebSVN 2.1.0

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