assertThat(block.getInstructions().get(0), instanceOf(EmptyInstruction.class));
}
@Test
public void constants() {
Program program = new Program();
BasicBlock block = program.createBasicBlock();
ClassConstantInstruction classConstInsn = new ClassConstantInstruction();
classConstInsn.setConstant(ValueType.BYTE);
classConstInsn.setReceiver(program.createVariable());
block.getInstructions().add(classConstInsn);
NullConstantInstruction nullConstInsn = new NullConstantInstruction();
nullConstInsn.setReceiver(program.createVariable());
block.getInstructions().add(nullConstInsn);
IntegerConstantInstruction intConsInsn = new IntegerConstantInstruction();
intConsInsn.setReceiver(program.createVariable());
intConsInsn.setConstant(23);
block.getInstructions().add(intConsInsn);
LongConstantInstruction longConsInsn = new LongConstantInstruction();
longConsInsn.setReceiver(program.createVariable());
longConsInsn.setConstant(234);
block.getInstructions().add(longConsInsn);
FloatConstantInstruction floatConsInsn = new FloatConstantInstruction();
floatConsInsn.setReceiver(program.createVariable());
floatConsInsn.setConstant(3.14f);
block.getInstructions().add(floatConsInsn);
DoubleConstantInstruction doubleConsInsn = new DoubleConstantInstruction();
doubleConsInsn.setReceiver(program.createVariable());
doubleConsInsn.setConstant(3.14159);
block.getInstructions().add(doubleConsInsn);
StringConstantInstruction stringConsInsn = new StringConstantInstruction();
stringConsInsn.setReceiver(program.createVariable());
stringConsInsn.setConstant("foo");
block.getInstructions().add(stringConsInsn);
program = inputOutput(program);
block = program.basicBlockAt(0);
assertThat(block.getInstructions().size(), is(7));
assertThat(block.getInstructions().get(0), instanceOf(ClassConstantInstruction.class));
assertThat(block.getInstructions().get(1), instanceOf(NullConstantInstruction.class));
assertThat(block.getInstructions().get(2), instanceOf(IntegerConstantInstruction.class));