import org.allspice.bytecode.instructions.Nop;
import org.allspice.bytecode.instructions.Return;
public class TestIFNE extends MyTestCase {
public ClassDef defadd(String type,int i1,int i2) {
ClassDef cd = makeClassDef() ;
Var x = new Var(i1,new TypeName(type)) ;
Var y = new Var(i2,new TypeName(type)) ;
MethodDef md = new MethodDef(TypeName.BOOLEAN,"meth",x,y) ;
Mark one = new Mark() ;
md = md.addInstructions(
new Load(x),
new Load(y),
new IfNotEqual(TypeCode.getType(type),one),
new Const(false),
new Return(TypeCode.BOOLEAN),
new Nop(one),
new Const(true),
new Return(TypeCode.BOOLEAN)
) ;
return cd.addMethod(md) ;
}