From 55bb13e768f77d0677489a5e58eaf1ec1d125749 Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 25 Jul 1999 08:09:46 +0000 Subject: [PATCH] Some JSR tests git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1130 379699f6-c40d-0410-875b-85095c16579e --- jode/test/JsrTest.j | 63 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 jode/test/JsrTest.j diff --git a/jode/test/JsrTest.j b/jode/test/JsrTest.j new file mode 100644 index 0000000..2351658 --- /dev/null +++ b/jode/test/JsrTest.j @@ -0,0 +1,63 @@ +.class public JsrTest +.super java/lang/Object + +.method public static main([Ljava/lang/String;)V + .limit locals 3 + .limit stack 5 + + jsr big_sub + jsr evil_jsrret + astore_1 +returninstr: + return + +evil_jsrret: + astore_2 + jsr retinstr +retinstr: + ret 2 + +big_sub: + astore_2 + aload_0 + astore_1 + aload_0 + ifnull skip + jsr subroutine +skip: + aload_0 + ifnull end + jsr sub2 +end: + ret 2 + + + +subroutine: + astore_1 + aload_0 + ifnull gotoend1 + aload_0 + ifnonnull bothsubs + ret 1 +gotoend1: + jsr innermostSub + goto returninstr + + +sub2: + astore_1 + aconst_null + ifnonnull bothsubs + ret 1 +bothsubs: + aload_0 + ifnull end + jsr innermostSub + goto end + +innermostSub: + astore_1 + ret 1 + +.end method