Checked in jasmin tests.
[cacao.git] / tests / regression / jasmin / test_dup2.j
1 .class public test_dup2
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 .method public static check(J)V
24         .limit locals 2
25         .limit stack 10
26         getstatic java/lang/System/out Ljava/io/PrintStream;
27         lload_0
28         invokevirtual java/io/PrintStream/println(J)V
29         return
30 .end method
31
32 ; ======================================================================
33
34 .method public static main([Ljava/lang/String;)V
35         .limit stack 4
36         .limit locals 2
37
38         ldc 35
39         istore 1
40
41         aload 0
42         ifnull force_basic_block_boundary
43
44         ; --------------------------------------------------
45
46         ldc 32
47         ldc 91
48         dup2 ; 32 91 32 91 (top)
49         isub ; 32 91 -59 (top)
50         invokestatic test_dup2/check(I)V
51         ; OUTPUT: -59
52         invokestatic test_dup2/check(I)V
53         ; OUTPUT: 91
54         invokestatic test_dup2/check(I)V
55         ; OUTPUT: 32
56
57         ldc 32
58         ldc2_w 91
59         dup2 ; 32 91 91 (top)
60         lsub ; 32 91 0 (top)
61         invokestatic test_dup2/check(J)V
62         ; OUTPUT: 0
63         invokestatic test_dup2/check(I)V
64         ; OUTPUT: 32
65
66         ; --------------------------------------------------
67
68 force_basic_block_boundary:
69
70         return
71 .end method