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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [divcmp-1.c] - Blame information for rev 688

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
extern void abort(void);
2
 
3
int test1(int x)
4
{
5
  return x/10 == 2;
6
}
7
 
8
int test1u(unsigned int x)
9
{
10
  return x/10U == 2;
11
}
12
 
13
int test2(int x)
14
{
15
  return x/10 == 0;
16
}
17
 
18
int test2u(unsigned int x)
19
{
20
  return x/10U == 0;
21
}
22
 
23
int test3(int x)
24
{
25
  return x/10 != 2;
26
}
27
 
28
int test3u(unsigned int x)
29
{
30
  return x/10U != 2;
31
}
32
 
33
int test4(int x)
34
{
35
  return x/10 != 0;
36
}
37
 
38
int test4u(unsigned int x)
39
{
40
  return x/10U != 0;
41
}
42
 
43
int test5(int x)
44
{
45
  return x/10 < 2;
46
}
47
 
48
int test5u(unsigned int x)
49
{
50
  return x/10U < 2;
51
}
52
 
53
int test6(int x)
54
{
55
  return x/10 < 0;
56
}
57
 
58
int test7(int x)
59
{
60
  return x/10  <= 2;
61
}
62
 
63
int test7u(unsigned int x)
64
{
65
  return x/10U <= 2;
66
}
67
 
68
int test8(int x)
69
{
70
  return x/10 <= 0;
71
}
72
 
73
int test8u(unsigned int x)
74
{
75
  return x/10U <= 0;
76
}
77
 
78
int test9(int x)
79
{
80
  return x/10 > 2;
81
}
82
 
83
int test9u(unsigned int x)
84
{
85
  return x/10U > 2;
86
}
87
 
88
int test10(int x)
89
{
90
  return x/10 > 0;
91
}
92
 
93
int test10u(unsigned int x)
94
{
95
  return x/10U > 0;
96
}
97
 
98
int test11(int x)
99
{
100
  return x/10 >= 2;
101
}
102
 
103
int test11u(unsigned int x)
104
{
105
  return x/10U >= 2;
106
}
107
 
108
int test12(int x)
109
{
110
  return x/10 >= 0;
111
}
112
 
113
 
114
int main()
115
{
116
  if (test1(19) != 0)
117
    abort ();
118
  if (test1(20) != 1)
119
    abort ();
120
  if (test1(29) != 1)
121
    abort ();
122
  if (test1(30) != 0)
123
    abort ();
124
 
125
  if (test1u(19) != 0)
126
    abort ();
127
  if (test1u(20) != 1)
128
    abort ();
129
  if (test1u(29) != 1)
130
    abort ();
131
  if (test1u(30) != 0)
132
    abort ();
133
 
134
  if (test2(0) != 1)
135
    abort ();
136
  if (test2(9) != 1)
137
    abort ();
138
  if (test2(10) != 0)
139
    abort ();
140
  if (test2(-1) != 1)
141
    abort ();
142
  if (test2(-9) != 1)
143
    abort ();
144
  if (test2(-10) != 0)
145
    abort ();
146
 
147
  if (test2u(0) != 1)
148
    abort ();
149
  if (test2u(9) != 1)
150
    abort ();
151
  if (test2u(10) != 0)
152
    abort ();
153
  if (test2u(-1) != 0)
154
    abort ();
155
  if (test2u(-9) != 0)
156
    abort ();
157
  if (test2u(-10) != 0)
158
    abort ();
159
 
160
  if (test3(19) != 1)
161
    abort ();
162
  if (test3(20) != 0)
163
    abort ();
164
  if (test3(29) != 0)
165
    abort ();
166
  if (test3(30) != 1)
167
    abort ();
168
 
169
  if (test3u(19) != 1)
170
    abort ();
171
  if (test3u(20) != 0)
172
    abort ();
173
  if (test3u(29) != 0)
174
    abort ();
175
  if (test3u(30) != 1)
176
    abort ();
177
 
178
  if (test4(0) != 0)
179
    abort ();
180
  if (test4(9) != 0)
181
    abort ();
182
  if (test4(10) != 1)
183
    abort ();
184
  if (test4(-1) != 0)
185
    abort ();
186
  if (test4(-9) != 0)
187
    abort ();
188
  if (test4(-10) != 1)
189
    abort ();
190
 
191
  if (test4u(0) != 0)
192
    abort ();
193
  if (test4u(9) != 0)
194
    abort ();
195
  if (test4u(10) != 1)
196
    abort ();
197
  if (test4u(-1) != 1)
198
    abort ();
199
  if (test4u(-9) != 1)
200
    abort ();
201
  if (test4u(-10) != 1)
202
    abort ();
203
 
204
  if (test5(19) != 1)
205
    abort ();
206
  if (test5(20) != 0)
207
    abort ();
208
  if (test5(29) != 0)
209
    abort ();
210
  if (test5(30) != 0)
211
    abort ();
212
 
213
  if (test5u(19) != 1)
214
    abort ();
215
  if (test5u(20) != 0)
216
    abort ();
217
  if (test5u(29) != 0)
218
    abort ();
219
  if (test5u(30) != 0)
220
    abort ();
221
 
222
  if (test6(0) != 0)
223
    abort ();
224
  if (test6(9) != 0)
225
    abort ();
226
  if (test6(10) != 0)
227
    abort ();
228
  if (test6(-1) != 0)
229
    abort ();
230
  if (test6(-9) != 0)
231
    abort ();
232
  if (test6(-10) != 1)
233
    abort ();
234
 
235
  if (test7(19) != 1)
236
    abort ();
237
  if (test7(20) != 1)
238
    abort ();
239
  if (test7(29) != 1)
240
    abort ();
241
  if (test7(30) != 0)
242
    abort ();
243
 
244
  if (test7u(19) != 1)
245
    abort ();
246
  if (test7u(20) != 1)
247
    abort ();
248
  if (test7u(29) != 1)
249
    abort ();
250
  if (test7u(30) != 0)
251
    abort ();
252
 
253
  if (test8(0) != 1)
254
    abort ();
255
  if (test8(9) != 1)
256
    abort ();
257
  if (test8(10) != 0)
258
    abort ();
259
  if (test8(-1) != 1)
260
    abort ();
261
  if (test8(-9) != 1)
262
    abort ();
263
  if (test8(-10) != 1)
264
    abort ();
265
 
266
  if (test8u(0) != 1)
267
    abort ();
268
  if (test8u(9) != 1)
269
    abort ();
270
  if (test8u(10) != 0)
271
    abort ();
272
  if (test8u(-1) != 0)
273
    abort ();
274
  if (test8u(-9) != 0)
275
    abort ();
276
  if (test8u(-10) != 0)
277
    abort ();
278
 
279
  if (test9(19) != 0)
280
    abort ();
281
  if (test9(20) != 0)
282
    abort ();
283
  if (test9(29) != 0)
284
    abort ();
285
  if (test9(30) != 1)
286
    abort ();
287
 
288
  if (test9u(19) != 0)
289
    abort ();
290
  if (test9u(20) != 0)
291
    abort ();
292
  if (test9u(29) != 0)
293
    abort ();
294
  if (test9u(30) != 1)
295
    abort ();
296
 
297
  if (test10(0) != 0)
298
    abort ();
299
  if (test10(9) != 0)
300
    abort ();
301
  if (test10(10) != 1)
302
    abort ();
303
  if (test10(-1) != 0)
304
    abort ();
305
  if (test10(-9) != 0)
306
    abort ();
307
  if (test10(-10) != 0)
308
    abort ();
309
 
310
  if (test10u(0) != 0)
311
    abort ();
312
  if (test10u(9) != 0)
313
    abort ();
314
  if (test10u(10) != 1)
315
    abort ();
316
  if (test10u(-1) != 1)
317
    abort ();
318
  if (test10u(-9) != 1)
319
    abort ();
320
  if (test10u(-10) != 1)
321
    abort ();
322
 
323
  if (test11(19) != 0)
324
    abort ();
325
  if (test11(20) != 1)
326
    abort ();
327
  if (test11(29) != 1)
328
    abort ();
329
  if (test11(30) != 1)
330
    abort ();
331
 
332
  if (test11u(19) != 0)
333
    abort ();
334
  if (test11u(20) != 1)
335
    abort ();
336
  if (test11u(29) != 1)
337
    abort ();
338
  if (test11u(30) != 1)
339
    abort ();
340
 
341
  if (test12(0) != 1)
342
    abort ();
343
  if (test12(9) != 1)
344
    abort ();
345
  if (test12(10) != 1)
346
    abort ();
347
  if (test12(-1) != 1)
348
    abort ();
349
  if (test12(-9) != 1)
350
    abort ();
351
  if (test12(-10) != 0)
352
    abort ();
353
 
354
  return 0;
355
}
356
 

powered by: WebSVN 2.1.0

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