* src/vm/jit/cfg.c (cfg_build): Fixed a bug causing infinite loops.
[cacao.git] / tests / regression / jasmin / test_swap_interface_slots.j
1 .class public test_swap_interface_slots
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 checkI(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 3
27         .limit locals 2
28
29         ldc 4
30         istore 1
31
32         ldc 18
33         ldc 100
34
35         ; --------------------------------------------------
36
37 loop:
38         swap
39         iinc 1 -1
40         iload 1
41         ifge loop
42
43         ; --------------------------------------------------
44
45         invokestatic test_swap_interface_slots/checkI(I)V
46         ; OUTPUT: 18
47         invokestatic test_swap_interface_slots/checkI(I)V
48         ; OUTPUT: 100
49
50         ldc 7
51         istore 1
52
53         ldc 28
54         ldc 200
55
56         ; --------------------------------------------------
57
58 loop2:
59         iinc 1 -1
60         swap
61         iload 1
62         ifge loop2
63
64         ; --------------------------------------------------
65
66         invokestatic test_swap_interface_slots/checkI(I)V
67         ; OUTPUT: 200
68         invokestatic test_swap_interface_slots/checkI(I)V
69         ; OUTPUT: 28
70
71         return
72 .end method