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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [dfp/] [func-array.c] - Blame information for rev 853

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

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-options "-std=gnu99" } */
2
 
3
/* C99 6.5.2.2 Function calls.
4
   Test passing array elements involving decimal floating point types. */
5
 
6
extern void abort (void);
7
 
8
/* A handful of functions that return the Nth _Decimal32 argument of
9
   an incoming array.  */
10
 
11
_Decimal32
12
arg0_32 (_Decimal32 args[])
13
{
14
  return args[0];
15
}
16
 
17
_Decimal32
18
arg1_32 (_Decimal32 args[])
19
{
20
  return args[1];
21
}
22
 
23
_Decimal32
24
arg2_32 (_Decimal32 args[])
25
{
26
  return args[2];
27
}
28
 
29
_Decimal32
30
arg3_32 (_Decimal32 args[])
31
{
32
  return args[3];
33
}
34
 
35
_Decimal32
36
arg4_32 (_Decimal32 args[])
37
{
38
  return args[4];
39
}
40
 
41
_Decimal32
42
arg5_32 (_Decimal32 args[])
43
{
44
  return args[5];
45
}
46
 
47
 
48
/* A handful of functions that return the Nth _Decimal64 argument of
49
   an incoming array.  */
50
 
51
_Decimal64
52
arg0_64 (_Decimal64 args[])
53
{
54
  return args[0];
55
}
56
 
57
_Decimal64
58
arg1_64 (_Decimal64 args[])
59
{
60
  return args[1];
61
}
62
 
63
_Decimal64
64
arg2_64 (_Decimal64 args[])
65
{
66
  return args[2];
67
}
68
 
69
_Decimal64
70
arg3_64 (_Decimal64 args[])
71
{
72
  return args[3];
73
}
74
 
75
_Decimal64
76
arg4_64 (_Decimal64 args[])
77
{
78
  return args[4];
79
}
80
 
81
_Decimal64
82
arg5_64 (_Decimal64 args[])
83
{
84
  return args[5];
85
}
86
 
87
 
88
/* A handful of functions that return the Nth _Decimal128 argument of
89
   an incoming array.  */
90
 
91
_Decimal128
92
arg0_128 (_Decimal128 args[])
93
{
94
  return args[0];
95
}
96
 
97
_Decimal128
98
arg1_128 (_Decimal128 args[])
99
{
100
  return args[1];
101
}
102
 
103
_Decimal128
104
arg2_128 (_Decimal128 args[])
105
{
106
  return args[2];
107
}
108
 
109
_Decimal128
110
arg3_128 (_Decimal128 args[])
111
{
112
  return args[3];
113
}
114
 
115
_Decimal128
116
arg4_128 (_Decimal128 args[])
117
{
118
  return args[4];
119
}
120
 
121
_Decimal128
122
arg5_128 (_Decimal128 args[])
123
{
124
  return args[5];
125
}
126
 
127
 
128
int main()
129
{
130
  _Decimal32 d32[] = { 0.0df, 1.0df, 2.0df, 3.0df, 4.0df, 5.0df };
131
  _Decimal64 d64[] = { 0.0dd, 1.0dd, 2.0dd, 3.0dd, 4.0dd, 5.0dd };
132
  _Decimal128 d128[] = { 0.0dl, 1.0dl, 2.0dl, 3.0dl, 4.0dl, 5.0dl };
133
 
134
  /* _Decimal32 variants.  */
135
  if (arg0_32 (d32) != 0.0df) abort ();
136
  if (arg1_32 (d32) != 1.0df) abort ();
137
  if (arg2_32 (d32) != 2.0df) abort ();
138
  if (arg3_32 (d32) != 3.0df) abort ();
139
  if (arg4_32 (d32) != 4.0df) abort ();
140
  if (arg5_32 (d32) != 5.0df) abort ();
141
 
142
  /* _Decimal64 variants.  */
143
  if (arg0_64 (d64) != 0.0dd) abort ();
144
  if (arg1_64 (d64) != 1.0dd) abort ();
145
  if (arg2_64 (d64) != 2.0dd) abort ();
146
  if (arg3_64 (d64) != 3.0dd) abort ();
147
  if (arg4_64 (d64) != 4.0dd) abort ();
148
  if (arg5_64 (d64) != 5.0dd) abort ();
149
 
150
  /* _Decimal128 variants.  */
151
  if (arg0_128 (d128) != 0.0dl) abort ();
152
  if (arg1_128 (d128) != 1.0dl) abort ();
153
  if (arg2_128 (d128) != 2.0dl) abort ();
154
  if (arg3_128 (d128) != 3.0dl) abort ();
155
  if (arg4_128 (d128) != 4.0dl) abort ();
156
  if (arg5_128 (d128) != 5.0dl) abort ();
157
 
158
  return 0;
159
}

powered by: WebSVN 2.1.0

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