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-4.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 688 jeremybenn
/* PR middle-end/17894 */
2
 
3
extern void abort(void);
4
 
5
int test1(int x)
6
{
7
  return x/-10 == 2;
8
}
9
 
10
int test2(int x)
11
{
12
  return x/-10 == 0;
13
}
14
 
15
int test3(int x)
16
{
17
  return x/-10 != 2;
18
}
19
 
20
int test4(int x)
21
{
22
  return x/-10 != 0;
23
}
24
 
25
int test5(int x)
26
{
27
  return x/-10 < 2;
28
}
29
 
30
int test6(int x)
31
{
32
  return x/-10 < 0;
33
}
34
 
35
int test7(int x)
36
{
37
  return x/-10  <= 2;
38
}
39
 
40
int test8(int x)
41
{
42
  return x/-10 <= 0;
43
}
44
 
45
int test9(int x)
46
{
47
  return x/-10 > 2;
48
}
49
 
50
int test10(int x)
51
{
52
  return x/-10 > 0;
53
}
54
 
55
int test11(int x)
56
{
57
  return x/-10 >= 2;
58
}
59
 
60
int test12(int x)
61
{
62
  return x/-10 >= 0;
63
}
64
 
65
 
66
int main()
67
{
68
  if (test1(-30) != 0)
69
    abort ();
70
  if (test1(-29) != 1)
71
    abort ();
72
  if (test1(-20) != 1)
73
    abort ();
74
  if (test1(-19) != 0)
75
    abort ();
76
 
77
  if (test2(0) != 1)
78
    abort ();
79
  if (test2(9) != 1)
80
    abort ();
81
  if (test2(10) != 0)
82
    abort ();
83
  if (test2(-1) != 1)
84
    abort ();
85
  if (test2(-9) != 1)
86
    abort ();
87
  if (test2(-10) != 0)
88
    abort ();
89
 
90
  if (test3(-30) != 1)
91
    abort ();
92
  if (test3(-29) != 0)
93
    abort ();
94
  if (test3(-20) != 0)
95
    abort ();
96
  if (test3(-19) != 1)
97
    abort ();
98
 
99
  if (test4(0) != 0)
100
    abort ();
101
  if (test4(9) != 0)
102
    abort ();
103
  if (test4(10) != 1)
104
    abort ();
105
  if (test4(-1) != 0)
106
    abort ();
107
  if (test4(-9) != 0)
108
    abort ();
109
  if (test4(-10) != 1)
110
    abort ();
111
 
112
  if (test5(-30) != 0)
113
    abort ();
114
  if (test5(-29) != 0)
115
    abort ();
116
  if (test5(-20) != 0)
117
    abort ();
118
  if (test5(-19) != 1)
119
    abort ();
120
 
121
  if (test6(0) != 0)
122
    abort ();
123
  if (test6(9) != 0)
124
    abort ();
125
  if (test6(10) != 1)
126
    abort ();
127
  if (test6(-1) != 0)
128
    abort ();
129
  if (test6(-9) != 0)
130
    abort ();
131
  if (test6(-10) != 0)
132
    abort ();
133
 
134
  if (test7(-30) != 0)
135
    abort ();
136
  if (test7(-29) != 1)
137
    abort ();
138
  if (test7(-20) != 1)
139
    abort ();
140
  if (test7(-19) != 1)
141
    abort ();
142
 
143
  if (test8(0) != 1)
144
    abort ();
145
  if (test8(9) != 1)
146
    abort ();
147
  if (test8(10) != 1)
148
    abort ();
149
  if (test8(-1) != 1)
150
    abort ();
151
  if (test8(-9) != 1)
152
    abort ();
153
  if (test8(-10) != 0)
154
    abort ();
155
 
156
  if (test9(-30) != 1)
157
    abort ();
158
  if (test9(-29) != 0)
159
    abort ();
160
  if (test9(-20) != 0)
161
    abort ();
162
  if (test9(-19) != 0)
163
    abort ();
164
 
165
  if (test10(0) != 0)
166
    abort ();
167
  if (test10(9) != 0)
168
    abort ();
169
  if (test10(10) != 0)
170
    abort ();
171
  if (test10(-1) != 0)
172
    abort ();
173
  if (test10(-9) != 0)
174
    abort ();
175
  if (test10(-10) != 1)
176
    abort ();
177
 
178
  if (test11(-30) != 1)
179
    abort ();
180
  if (test11(-29) != 1)
181
    abort ();
182
  if (test11(-20) != 1)
183
    abort ();
184
  if (test11(-19) != 0)
185
    abort ();
186
 
187
  if (test12(0) != 1)
188
    abort ();
189
  if (test12(9) != 1)
190
    abort ();
191
  if (test12(10) != 0)
192
    abort ();
193
  if (test12(-1) != 1)
194
    abort ();
195
  if (test12(-9) != 1)
196
    abort ();
197
  if (test12(-10) != 1)
198
    abort ();
199
 
200
  return 0;
201
}
202
 

powered by: WebSVN 2.1.0

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