Skip to content

Commit 8cacd7d

Browse files
author
Matthias Güdemann
committed
Add regression test for getfield, getstatic
1 parent 0aec9b1 commit 8cacd7d

File tree

8 files changed

+65
-0
lines changed

8 files changed

+65
-0
lines changed
601 Bytes
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
public class stack_test {
2+
public static void main(String[] args) {
3+
stack_var8 s = new stack_var8();
4+
int n = s.f();
5+
assert(n==0);
6+
}
7+
}
238 Bytes
Binary file not shown.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.class public stack_var8
2+
.super java/lang/Object
3+
4+
.field private n I
5+
6+
.method public <init>()V
7+
.limit stack 5
8+
aload_0
9+
invokenonvirtual java/lang/Object/<init>()V
10+
aload_0
11+
iconst_0
12+
putfield stack_var8/n I
13+
return
14+
.end method
15+
16+
.method public f()I
17+
.limit stack 8
18+
.limit locals 5
19+
20+
aload_0
21+
getfield stack_var8/n I
22+
aload_0
23+
iconst_1
24+
putfield stack_var8/n I
25+
26+
ireturn
27+
.end method
601 Bytes
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
public class stack_test {
2+
public static void main(String[] args) {
3+
stack_var9 s = new stack_var9();
4+
int n = s.f();
5+
assert(n==0);
6+
}
7+
}
235 Bytes
Binary file not shown.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.class public stack_var9
2+
.super java/lang/Object
3+
4+
.field private static n I
5+
6+
.method public <init>()V
7+
.limit stack 5
8+
aload_0
9+
invokenonvirtual java/lang/Object/<init>()V
10+
iconst_0
11+
putstatic stack_var9/n I
12+
return
13+
.end method
14+
15+
.method public f()I
16+
.limit stack 8
17+
.limit locals 5
18+
19+
getstatic stack_var9/n I
20+
iconst_1
21+
putstatic stack_var9/n I
22+
23+
ireturn
24+
.end method

0 commit comments

Comments
 (0)