Search in sources :

Example 16 with Program

use of com.dat3m.dartagnan.program.Program in project Dat3M by hernanponcedeleon.

the class ExceptionsTest method unrollBeforeDCEException.

@Test(expected = IllegalArgumentException.class)
public void unrollBeforeDCEException() throws Exception {
    ProgramBuilder pb = new ProgramBuilder(SourceLanguage.LITMUS);
    pb.initThread(0);
    Program p = pb.build();
    LoopUnrolling.newInstance().run(p);
    // DCE cannot be called after unrolling
    DeadCodeElimination.newInstance().run(p);
}
Also used : Program(com.dat3m.dartagnan.program.Program) ProgramBuilder(com.dat3m.dartagnan.parsers.program.utils.ProgramBuilder) Test(org.junit.Test)

Example 17 with Program

use of com.dat3m.dartagnan.program.Program in project Dat3M by hernanponcedeleon.

the class WrongTargetTest method X86CompiledToPower.

@Test(expected = IllegalArgumentException.class)
public void X86CompiledToPower() throws Exception {
    Program p = new ProgramParser().parse(new File(ResourceHelper.LITMUS_RESOURCE_PATH + "litmus/X86/2+2W+mfence-rmws.litmus"));
    LoopUnrolling.newInstance().run(p);
    Compilation comp = Compilation.newInstance();
    comp.setTarget(Arch.POWER);
    comp.run(p);
}
Also used : Program(com.dat3m.dartagnan.program.Program) Compilation(com.dat3m.dartagnan.program.processing.compilation.Compilation) ProgramParser(com.dat3m.dartagnan.parsers.program.ProgramParser) File(java.io.File) Test(org.junit.Test)

Example 18 with Program

use of com.dat3m.dartagnan.program.Program in project Dat3M by hernanponcedeleon.

the class PrinterTest method PrintX86.

@Test()
public void PrintX86() throws Exception {
    Program p = new ProgramParser().parse(new File(ResourceHelper.TEST_RESOURCE_PATH + "litmus/MP+mfence-rmw+rmw-mfence.litmus"));
    assertNotNull(new Printer().print(p));
    assertNotNull(p.getAss().toString());
}
Also used : Program(com.dat3m.dartagnan.program.Program) ProgramParser(com.dat3m.dartagnan.parsers.program.ProgramParser) Printer(com.dat3m.dartagnan.utils.printer.Printer) File(java.io.File) Test(org.junit.Test)

Example 19 with Program

use of com.dat3m.dartagnan.program.Program in project Dat3M by hernanponcedeleon.

the class PrinterTest method PrintPPC.

@Test()
public void PrintPPC() throws Exception {
    Program p = new ProgramParser().parse(new File(ResourceHelper.TEST_RESOURCE_PATH + "litmus/MP+lwsync+data-wsi-rfi-ctrlisync.litmus"));
    assertNotNull(new Printer().print(p));
    assertNotNull(p.getAss().toString());
}
Also used : Program(com.dat3m.dartagnan.program.Program) ProgramParser(com.dat3m.dartagnan.parsers.program.ProgramParser) Printer(com.dat3m.dartagnan.utils.printer.Printer) File(java.io.File) Test(org.junit.Test)

Example 20 with Program

use of com.dat3m.dartagnan.program.Program in project Dat3M by hernanponcedeleon.

the class PrinterTest method PrintLinux2.

@Test()
public void PrintLinux2() throws Exception {
    Program p = new ProgramParser().parse(new File(ResourceHelper.LITMUS_RESOURCE_PATH + "litmus/C/dart/C-atomic-fetch-simple-01.litmus"));
    assertNotNull(new Printer().print(p));
    assertNotNull(p.getAss().toString());
}
Also used : Program(com.dat3m.dartagnan.program.Program) ProgramParser(com.dat3m.dartagnan.parsers.program.ProgramParser) Printer(com.dat3m.dartagnan.utils.printer.Printer) File(java.io.File) Test(org.junit.Test)

Aggregations

Program (com.dat3m.dartagnan.program.Program)41 Test (org.junit.Test)22 File (java.io.File)21 ProgramParser (com.dat3m.dartagnan.parsers.program.ProgramParser)20 ProgramBuilder (com.dat3m.dartagnan.parsers.program.utils.ProgramBuilder)10 Printer (com.dat3m.dartagnan.utils.printer.Printer)8 VerificationTask (com.dat3m.dartagnan.verification.VerificationTask)6 Configuration (org.sosy_lab.common.configuration.Configuration)6 ParserErrorListener (com.dat3m.dartagnan.exception.ParserErrorListener)5 Compilation (com.dat3m.dartagnan.program.processing.compilation.Compilation)5 Collectors (java.util.stream.Collectors)5 SolverContext (org.sosy_lab.java_smt.api.SolverContext)5 ParserCat (com.dat3m.dartagnan.parsers.cat.ParserCat)4 Tag (com.dat3m.dartagnan.program.event.Tag)4 Event (com.dat3m.dartagnan.program.event.core.Event)4 Result (com.dat3m.dartagnan.utils.Result)4 Wmm (com.dat3m.dartagnan.wmm.Wmm)4 InvalidConfigurationException (org.sosy_lab.common.configuration.InvalidConfigurationException)4 ProverEnvironment (org.sosy_lab.java_smt.api.ProverEnvironment)4 FilterBasic (com.dat3m.dartagnan.program.filter.FilterBasic)3