* configure.ac: New switch for disabling -O2 (--disable-optimizations).
[cacao.git] / tests / regression / jasmin / test_iinc.j
1 .class public test_iinc
2 .super java/lang/Object
3
4 ; ======================================================================
5
6 .method public <init>()V
7    aload_0
8    invokenonvirtual java/lang/Object/<init>()V
9    return
10 .end method
11
12 ; ======================================================================
13
14 .method public static check(I)V
15         .limit locals 1
16         .limit stack 10
17         getstatic java/lang/System/out Ljava/io/PrintStream;
18         iload_0
19         invokevirtual java/io/PrintStream/println(I)V
20         return
21 .end method
22
23 ; ======================================================================
24
25 .method public static main([Ljava/lang/String;)V
26         .limit stack 2
27         .limit locals 2
28
29         ldc 35
30         istore 1
31
32         aload 0
33         ifnull force_basic_block_boundary
34
35         ; --------------------------------------------------
36
37         iinc 1 0
38
39         ; positive, 8bit
40
41         iinc 1 1
42                 iload 1
43                 invokestatic test_iinc/check(I)V
44                 ; OUTPUT: 36
45         iinc 1 2
46                 iload 1
47                 invokestatic test_iinc/check(I)V
48                 ; OUTPUT: 38
49         iinc 1 3
50                 iload 1
51                 invokestatic test_iinc/check(I)V
52                 ; OUTPUT: 41
53         iinc 1 4
54                 iload 1
55                 invokestatic test_iinc/check(I)V
56                 ; OUTPUT: 45
57         iinc 1 7
58                 iload 1
59                 invokestatic test_iinc/check(I)V
60                 ; OUTPUT: 52
61         iinc 1 8
62                 iload 1
63                 invokestatic test_iinc/check(I)V
64                 ; OUTPUT: 60
65         iinc 1 9
66                 iload 1
67                 invokestatic test_iinc/check(I)V
68                 ; OUTPUT: 69
69         iinc 1 15
70                 iload 1
71                 invokestatic test_iinc/check(I)V
72                 ; OUTPUT: 84
73         iinc 1 16
74                 iload 1
75                 invokestatic test_iinc/check(I)V
76                 ; OUTPUT: 100
77         iinc 1 17
78                 iload 1
79                 invokestatic test_iinc/check(I)V
80                 ; OUTPUT: 117
81         iinc 1 31
82                 iload 1
83                 invokestatic test_iinc/check(I)V
84                 ; OUTPUT: 148
85         iinc 1 32
86                 iload 1
87                 invokestatic test_iinc/check(I)V
88                 ; OUTPUT: 180
89         iinc 1 33
90                 iload 1
91                 invokestatic test_iinc/check(I)V
92                 ; OUTPUT: 213
93         iinc 1 63
94                 iload 1
95                 invokestatic test_iinc/check(I)V
96                 ; OUTPUT: 276
97         iinc 1 64
98                 iload 1
99                 invokestatic test_iinc/check(I)V
100                 ; OUTPUT: 340
101         iinc 1 65
102                 iload 1
103                 invokestatic test_iinc/check(I)V
104                 ; OUTPUT: 405
105         iinc 1 127
106                 iload 1
107                 invokestatic test_iinc/check(I)V
108                 ; OUTPUT: 532
109
110         ; positive, 16 bit
111
112         iinc 1 128
113                 iload 1
114                 invokestatic test_iinc/check(I)V
115                 ; OUTPUT: 660
116         iinc 1 129
117                 iload 1
118                 invokestatic test_iinc/check(I)V
119                 ; OUTPUT: 789
120         iinc 1 255
121                 iload 1
122                 invokestatic test_iinc/check(I)V
123                 ; OUTPUT: 1044
124         iinc 1 256
125                 iload 1
126                 invokestatic test_iinc/check(I)V
127                 ; OUTPUT: 1300
128         iinc 1 257
129                 iload 1
130                 invokestatic test_iinc/check(I)V
131                 ; OUTPUT: 1557
132         iinc 1 511
133                 iload 1
134                 invokestatic test_iinc/check(I)V
135                 ; OUTPUT: 2068
136         iinc 1 512
137                 iload 1
138                 invokestatic test_iinc/check(I)V
139                 ; OUTPUT: 2580
140         iinc 1 513
141                 iload 1
142                 invokestatic test_iinc/check(I)V
143                 ; OUTPUT: 3093
144         iinc 1 1023
145                 iload 1
146                 invokestatic test_iinc/check(I)V
147                 ; OUTPUT:  4116
148         iinc 1 1024
149                 iload 1
150                 invokestatic test_iinc/check(I)V
151                 ; OUTPUT: 5140
152         iinc 1 1025
153                 iload 1
154                 invokestatic test_iinc/check(I)V
155                 ; OUTPUT: 6165
156         iinc 1 2047
157                 iload 1
158                 invokestatic test_iinc/check(I)V
159                 ; OUTPUT: 8212
160         iinc 1 2048
161                 iload 1
162                 invokestatic test_iinc/check(I)V
163                 ; OUTPUT: 10260
164         iinc 1 2049
165                 iload 1
166                 invokestatic test_iinc/check(I)V
167                 ; OUTPUT: 12309
168         iinc 1 4095
169                 iload 1
170                 invokestatic test_iinc/check(I)V
171                 ; OUTPUT: 16404
172         iinc 1 4096
173                 iload 1
174                 invokestatic test_iinc/check(I)V
175                 ; OUTPUT: 20500
176         iinc 1 4097
177                 iload 1
178                 invokestatic test_iinc/check(I)V
179                 ; OUTPUT: 24597
180         iinc 1 8191
181                 iload 1
182                 invokestatic test_iinc/check(I)V
183                 ; OUTPUT: 32788
184         iinc 1 8192
185                 iload 1
186                 invokestatic test_iinc/check(I)V
187                 ; OUTPUT: 40980
188         iinc 1 8193
189                 iload 1
190                 invokestatic test_iinc/check(I)V
191                 ; OUTPUT: 49173
192         iinc 1 16383
193                 iload 1
194                 invokestatic test_iinc/check(I)V
195                 ; OUTPUT: 65556
196         iinc 1 16384
197                 iload 1
198                 invokestatic test_iinc/check(I)V
199                 ; OUTPUT: 81940
200         iinc 1 16385
201                 iload 1
202                 invokestatic test_iinc/check(I)V
203                 ; OUTPUT: 98325
204         iinc 1 32767
205                 iload 1
206                 invokestatic test_iinc/check(I)V
207                 ; OUTPUT: 131092
208
209         ; negative, 8bit
210
211         iinc 1 -1
212                 iload 1
213                 invokestatic test_iinc/check(I)V
214                 ; OUTPUT: 131091
215         iinc 1 -2
216                 iload 1
217                 invokestatic test_iinc/check(I)V
218                 ; OUTPUT: 131089
219         iinc 1 -3
220                 iload 1
221                 invokestatic test_iinc/check(I)V
222                 ; OUTPUT: 131086
223         iinc 1 -4
224                 iload 1
225                 invokestatic test_iinc/check(I)V
226                 ; OUTPUT: 131082
227         iinc 1 -7
228                 iload 1
229                 invokestatic test_iinc/check(I)V
230                 ; OUTPUT: 131075
231         iinc 1 -8
232                 iload 1
233                 invokestatic test_iinc/check(I)V
234                 ; OUTPUT: 131067
235         iinc 1 -9
236                 iload 1
237                 invokestatic test_iinc/check(I)V
238                 ; OUTPUT: 131058
239         iinc 1 -15
240                 iload 1
241                 invokestatic test_iinc/check(I)V
242                 ; OUTPUT: 131043
243         iinc 1 -16
244                 iload 1
245                 invokestatic test_iinc/check(I)V
246                 ; OUTPUT: 131027
247         iinc 1 -17
248                 iload 1
249                 invokestatic test_iinc/check(I)V
250                 ; OUTPUT: 131010
251         iinc 1 -31
252                 iload 1
253                 invokestatic test_iinc/check(I)V
254                 ; OUTPUT: 130979
255         iinc 1 -32
256                 iload 1
257                 invokestatic test_iinc/check(I)V
258                 ; OUTPUT: 130947
259         iinc 1 -33
260                 iload 1
261                 invokestatic test_iinc/check(I)V
262                 ; OUTPUT: 130914
263         iinc 1 -63
264                 iload 1
265                 invokestatic test_iinc/check(I)V
266                 ; OUTPUT: 130851
267         iinc 1 -64
268                 iload 1
269                 invokestatic test_iinc/check(I)V
270                 ; OUTPUT: 130787
271         iinc 1 -65
272                 iload 1
273                 invokestatic test_iinc/check(I)V
274                 ; OUTPUT: 130722
275         iinc 1 -127
276                 iload 1
277                 invokestatic test_iinc/check(I)V
278                 ; OUTPUT: 130595
279         iinc 1 -128
280                 iload 1
281                 invokestatic test_iinc/check(I)V
282                 ; OUTPUT: 130467
283
284         ; negative, 16 bit
285
286         iinc 1 -129
287                 iload 1
288                 invokestatic test_iinc/check(I)V
289                 ; OUTPUT: 130338
290         iinc 1 -255
291                 iload 1
292                 invokestatic test_iinc/check(I)V
293                 ; OUTPUT: 130083
294         iinc 1 -256
295                 iload 1
296                 invokestatic test_iinc/check(I)V
297                 ; OUTPUT: 129827
298         iinc 1 -257
299                 iload 1
300                 invokestatic test_iinc/check(I)V
301                 ; OUTPUT: 129570
302         iinc 1 -511
303                 iload 1
304                 invokestatic test_iinc/check(I)V
305                 ; OUTPUT: 129059
306         iinc 1 -512
307                 iload 1
308                 invokestatic test_iinc/check(I)V
309                 ; OUTPUT: 128547
310         iinc 1 -513
311                 iload 1
312                 invokestatic test_iinc/check(I)V
313                 ; OUTPUT: 128034
314         iinc 1 -1023
315                 iload 1
316                 invokestatic test_iinc/check(I)V
317                 ; OUTPUT: 127011
318         iinc 1 -1024
319                 iload 1
320                 invokestatic test_iinc/check(I)V
321                 ; OUTPUT: 125987
322         iinc 1 -1025
323                 iload 1
324                 invokestatic test_iinc/check(I)V
325                 ; OUTPUT: 124962
326         iinc 1 -2047
327                 iload 1
328                 invokestatic test_iinc/check(I)V
329                 ; OUTPUT: 122915
330         iinc 1 -2048
331                 iload 1
332                 invokestatic test_iinc/check(I)V
333                 ; OUTPUT: 120867
334         iinc 1 -2049
335                 iload 1
336                 invokestatic test_iinc/check(I)V
337                 ; OUTPUT: 118818
338         iinc 1 -4095
339                 iload 1
340                 invokestatic test_iinc/check(I)V
341                 ; OUTPUT: 114723
342         iinc 1 -4096
343                 iload 1
344                 invokestatic test_iinc/check(I)V
345                 ; OUTPUT: 110627
346         iinc 1 -4097
347                 iload 1
348                 invokestatic test_iinc/check(I)V
349                 ; OUTPUT: 106530
350         iinc 1 -8191
351                 iload 1
352                 invokestatic test_iinc/check(I)V
353                 ; OUTPUT: 98339
354         iinc 1 -8192
355                 iload 1
356                 invokestatic test_iinc/check(I)V
357                 ; OUTPUT: 90147
358         iinc 1 -8193
359                 iload 1
360                 invokestatic test_iinc/check(I)V
361                 ; OUTPUT: 81954
362         iinc 1 -16383
363                 iload 1
364                 invokestatic test_iinc/check(I)V
365                 ; OUTPUT: 65571
366         iinc 1 -16384
367                 iload 1
368                 invokestatic test_iinc/check(I)V
369                 ; OUTPUT: 49187
370         iinc 1 -16385
371                 iload 1
372                 invokestatic test_iinc/check(I)V
373                 ; OUTPUT: 32802
374         iinc 1 -32767
375                 iload 1
376                 invokestatic test_iinc/check(I)V
377                 ; OUTPUT: 35
378         iinc 1 -32768
379                 iload 1
380                 invokestatic test_iinc/check(I)V
381                 ; OUTPUT: -32733
382
383         ; --------------------------------------------------
384
385 force_basic_block_boundary:
386
387                 iload 1
388                 invokestatic test_iinc/check(I)V
389                 ; OUTPUT: -32733
390
391         return
392 .end method