Search in sources :

Example 1 with ValueNode

use of com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode in project graal by oracle.

the class CachedTest method testChildrenAdoption7.

@Test
public void testChildrenAdoption7() {
    ChildrenAdoption7 root = createNode(ChildrenAdoption7Factory.getInstance(), false);
    Node child = new ValueNode();
    root.execute(child);
    Assert.assertTrue(hasParent(root, child));
}
Also used : ValueNode(com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode) Node(com.oracle.truffle.api.nodes.Node) TestHelper.createNode(com.oracle.truffle.api.dsl.test.TestHelper.createNode) ValueNode(com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode) Test(org.junit.Test)

Example 2 with ValueNode

use of com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode in project graal by oracle.

the class CachedTest method testChildrenAdoption4.

@Test
public void testChildrenAdoption4() {
    ChildrenAdoption4 root = createNode(ChildrenAdoption4Factory.getInstance(), false);
    Node child = new ValueNode();
    root.execute(child);
    Assert.assertTrue(hasParent(root, child));
}
Also used : ValueNode(com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode) Node(com.oracle.truffle.api.nodes.Node) TestHelper.createNode(com.oracle.truffle.api.dsl.test.TestHelper.createNode) ValueNode(com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode) Test(org.junit.Test)

Example 3 with ValueNode

use of com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode in project graal by oracle.

the class NodeChildNoNameTest method testThreeArg.

@Test
public void testThreeArg() {
    ValueNode node1 = new ConstantNode();
    ValueNode node2 = new ConstantNode();
    ValueNode node3 = new ConstantNode();
    ThreeArgsNoName arg = ThreeArgsNoNameFactory.create(node1, node2, node3);
    Assert.assertEquals(node1, arg.getChild0());
    Assert.assertEquals(node2, arg.getChild1());
    Assert.assertEquals(node3, arg.getChild2());
    Assert.assertEquals(126, TestHelper.createCallTarget(arg).call());
}
Also used : ValueNode(com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode) Test(org.junit.Test)

Example 4 with ValueNode

use of com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode in project graal by oracle.

the class NodeChildNoNameTest method testOneArg.

@Test
public void testOneArg() {
    ValueNode node = new ConstantNode();
    OneArgNoName arg = OneArgNoNameFactory.create(node);
    Assert.assertEquals(node, arg.getChild0());
    Assert.assertEquals(43, TestHelper.createCallTarget(arg).call());
}
Also used : ValueNode(com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode) Test(org.junit.Test)

Example 5 with ValueNode

use of com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode in project graal by oracle.

the class CachedTest method testChildrenAdoption5.

@Test
public void testChildrenAdoption5() {
    ChildrenAdoption5 root = createNode(ChildrenAdoption5Factory.getInstance(), false);
    Node child = new ValueNode();
    root.execute(child);
    Assert.assertTrue(hasParent(root, child));
}
Also used : ValueNode(com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode) Node(com.oracle.truffle.api.nodes.Node) TestHelper.createNode(com.oracle.truffle.api.dsl.test.TestHelper.createNode) ValueNode(com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode) Test(org.junit.Test)

Aggregations

ValueNode (com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode)8 Test (org.junit.Test)8 TestHelper.createNode (com.oracle.truffle.api.dsl.test.TestHelper.createNode)5 Node (com.oracle.truffle.api.nodes.Node)5