import org.allspice.bytecode.instructions.Store;
public class TestArrStr extends MyTestCase {
public ClassDef defadd(String type) {
ClassDef cd = makeClassDef() ;
FieldDef fd = new FieldDef(Scope.PUBLIC,new TypeName(type),"foo") ;
fd = fd.setStatic(true) ;
cd = cd.addField(fd) ;
{
Var x = new Var(0,new TypeName(type+"[]")) ;
Var y = new Var(1,TypeName.INT) ;
Var z = new Var(2,new TypeName(type)) ;
MethodDef md = new MethodDef(TypeName.VOID,"setFoo",x,y,z) ;
md = md.setStatic(true) ;
md = md.addInstructions(
new Load(x),
new Load(y),
new Load(z),
new Store(new ArrLValue(new TypeName(type))),
new Return(TypeCode.VOID)
) ;
cd = cd.addMethod(md) ;
}
return cd ;