Search in sources :

Example 6 with ValueNode

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

the class CachedTest method testChildrenAdoption2.

@Test
public void testChildrenAdoption2() {
    ChildrenAdoption2 root = createNode(ChildrenAdoption2Factory.getInstance(), false);
    Node child = new ValueNode();
    root.execute(child);
    root.adoptChildren();
    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 7 with ValueNode

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

the class CachedTest method testChildrenAdoption6.

@Test
public void testChildrenAdoption6() {
    ChildrenAdoption6 root = createNode(ChildrenAdoption6Factory.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 8 with ValueNode

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

the class NodeChildNoNameTest method testTwoArg.

@Test
public void testTwoArg() {
    ValueNode node1 = new ConstantNode();
    ValueNode node2 = new ConstantNode();
    TwoArgsNoName arg = TwoArgsNoNameFactory.create(node1, node2);
    Assert.assertEquals(node1, arg.getChild0());
    Assert.assertEquals(node2, arg.getChild1());
    Assert.assertEquals(84, TestHelper.createCallTarget(arg).call());
}
Also used : 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