public void testJSRSingleBlock() throws Exception {
Block main = new Block("main");
Block sub = new Block("sub");
main.addOp(new Load(0, new Variable("this", JavaType.OBJECT, false, false)));
main.addOp(new JSR(0, sub));
main.addOp(new PutField(0, new FieldInfo(null, "a", JavaType.INT, false, false,
false)));
sub.addOp(new Load(0, new Constant(1, JavaType.INT)));
sub.addOp(new Return(0, JavaType.VOID));
Stack2Turing converter = new Stack2Turing(main);
List<Operation> operations = converter.translate();
assertEquals(1, operations.size());