use of com.dat3m.dartagnan.program.event.core.Label in project Dat3M by hernanponcedeleon.
the class VisitorBase method visitUnlock.
@Override
public List<Event> visitUnlock(Unlock e) {
Register resultRegister = e.getResultRegister();
IExpr address = e.getAddress();
String mo = e.getMo();
List<Event> events = eventSequence(newLoad(resultRegister, address, mo), newJump(new Atom(resultRegister, NEQ, IValue.ONE), (Label) e.getThread().getExit()), newStore(address, IValue.ZERO, mo));
for (Event child : events) {
child.addFilters(C11.LOCK, RMW);
}
return events;
}
use of com.dat3m.dartagnan.program.event.core.Label in project Dat3M by hernanponcedeleon.
the class UnrollExceptionsTest method RMWStoreCon.
@Test(expected = ProgramProcessingException.class)
public void RMWStoreCon() throws Exception {
ProgramBuilder pb = new ProgramBuilder(SourceLanguage.LITMUS);
pb.initThread(0);
MemoryObject object = pb.getOrNewObject("X");
Label start = pb.getOrCreateLabel("loopStart");
pb.addChild(0, start);
RMWReadCond load = Linux.newRMWReadCondCmp(pb.getOrCreateRegister(0, "r1", 32), BConst.TRUE, object, null);
pb.addChild(0, Linux.newRMWStoreCond(load, object, IValue.ONE, null));
pb.addChild(0, EventFactory.newGoto(start));
LoopUnrolling processor = LoopUnrolling.newInstance();
processor.setUnrollingBound(2);
processor.run(pb.build());
}
use of com.dat3m.dartagnan.program.event.core.Label in project Dat3M by hernanponcedeleon.
the class UnrollExceptionsTest method ExecutionStatus.
@Test(expected = ProgramProcessingException.class)
public void ExecutionStatus() throws Exception {
ProgramBuilder pb = new ProgramBuilder(SourceLanguage.LITMUS);
pb.initThread(0);
Label start = pb.getOrCreateLabel("loopStart");
pb.addChild(0, start);
MemoryObject object = pb.getOrNewObject("X");
RMWStoreExclusive store = newRMWStoreExclusive(object, IValue.ONE, null);
pb.addChild(0, EventFactory.newExecutionStatus(pb.getOrCreateRegister(0, "r1", 32), store));
pb.addChild(0, EventFactory.newGoto(start));
LoopUnrolling processor = LoopUnrolling.newInstance();
processor.setUnrollingBound(2);
processor.run(pb.build());
}
Aggregations