Search in sources :

Example 1 with ClawRange

use of claw.wani.language.ClawRange in project claw-compiler by C2SM-RCM.

the class ClawRangeTest method compareWithLoopIterationRangeTest.

@Test
public void compareWithLoopIterationRangeTest() {
    Xnode iterationRange1 = XmlHelper.createXnode(beginLoop + inductionVar1 + indexRange1 + endLoop);
    assertNotNull(iterationRange1);
    Xnode iterationRange2 = XmlHelper.createXnode(beginLoop + inductionVar1 + indexRange2 + endLoop);
    assertNotNull(iterationRange1);
    ClawRange range1 = new ClawRange("i", "1", "10", "1");
    assertTrue(range1.compareToDoStmt(iterationRange1));
    assertFalse(range1.compareToDoStmt(iterationRange2));
    ClawRange range2 = new ClawRange("i", "1", "10", "2");
    assertFalse(range2.compareToDoStmt(iterationRange1));
    assertFalse(range2.compareToDoStmt(iterationRange2));
    ClawRange range3 = new ClawRange("i", "1", "11", "1");
    assertFalse(range3.compareToDoStmt(iterationRange1));
    assertFalse(range3.compareToDoStmt(iterationRange2));
    ClawRange range4 = new ClawRange("i", "2", "10", "1");
    assertFalse(range4.compareToDoStmt(iterationRange1));
    assertFalse(range4.compareToDoStmt(iterationRange2));
    ClawRange range5 = new ClawRange("j", "1", "10", "1");
    assertFalse(range5.compareToDoStmt(iterationRange1));
    assertFalse(range5.compareToDoStmt(iterationRange2));
    ClawRange range6 = new ClawRange("i", "istart", "iend", "1");
    assertTrue(range6.compareToDoStmt(iterationRange2));
    assertFalse(range6.compareToDoStmt(iterationRange1));
    ClawRange range7 = new ClawRange("i", "istart", "iend", "2");
    assertFalse(range7.compareToDoStmt(iterationRange2));
    assertFalse(range7.compareToDoStmt(iterationRange1));
    ClawRange range8 = new ClawRange("i", "istart", "ieend", "1");
    assertFalse(range8.compareToDoStmt(iterationRange2));
    assertFalse(range8.compareToDoStmt(iterationRange1));
    ClawRange range9 = new ClawRange("i", "istarter", "iend", "1");
    assertFalse(range9.compareToDoStmt(iterationRange2));
    assertFalse(range9.compareToDoStmt(iterationRange1));
    ClawRange range10 = new ClawRange("j", "istart", "iend", "1");
    assertFalse(range10.compareToDoStmt(iterationRange2));
    assertFalse(range10.compareToDoStmt(iterationRange1));
    ClawRange range11 = new ClawRange();
    range11.setInductionVar("i");
    range11.setLowerBound("istart");
    range11.setUpperBound("iend");
    assertTrue(range11.compareToDoStmt(iterationRange2));
}
Also used : Xnode(claw.tatsu.xcodeml.xnode.common.Xnode) ClawRange(claw.wani.language.ClawRange) Test(org.junit.Test)

Aggregations

Xnode (claw.tatsu.xcodeml.xnode.common.Xnode)1 ClawRange (claw.wani.language.ClawRange)1 Test (org.junit.Test)1