Offload int[] to byte[].
[SquirrelJME.git] / modules / cldc-compact / src / test / resources / lang / interfaces / TestInvokeVirtualOnAbstractImplInterface.j
blob53c4ffe375ff685584eaa026a737fa30e7772c50
1 ; -*- Mode: Jasmin; indent-tabs-mode: t; tab-width: 4 -*-
2 ; ---------------------------------------------------------------------------
3 ; SquirrelJME
4 ; Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 ; ---------------------------------------------------------------------------
6 ; SquirrelJME is under the Mozilla Public License Version 2.0.
7 ; See license.mkd for licensing and copyright information.
8 ; ---------------------------------------------------------------------------
10 .class public lang/interfaces/TestInvokeVirtualOnAbstractImplInterface
11 .super net/multiphasicapps/tac/TestInteger
13 .method public <init>()V
14 aload 0
15 invokenonvirtual net/multiphasicapps/tac/TestInteger/<init>()V
16 return
17 .end method
19 .method public test()I
20 .limit stack 3
21 ; Allocate and initialize an implementation
22 new lang/interfaces/ImplAbstractImplAWithMethod
23 dup
24 invokespecial lang/interfaces/ImplAbstractImplAWithMethod/<init>()V
26 ; Duplicate for the second and third call
27 dup
28 dup
30 ; Call the first virtually, it should still be valid
31 invokevirtual lang/interfaces/AbstractImplANoMethod/methodA()I
33 ; Then call it on the sub-class
34 swap
35 invokevirtual lang/interfaces/ImplAbstractImplAWithMethod/methodA()I
37 ; Add both together
38 iadd
40 ; Call via interface next
41 swap
42 invokeinterface lang/interfaces/InterfaceA/methodA()I 1
44 ; Add both values together which becomes the result
45 iadd
46 ireturn
47 .end method