use of com.oracle.truffle.api.dsl.test.TypeSystemTest.ArgumentNode in project graal by oracle.
the class ExecuteEvaluatedTest method testSingleEvaluated.
@Test
public void testSingleEvaluated() {
ArgumentNode arg0 = new ArgumentNode(0);
CallTarget callTarget = TestHelper.createCallTarget(UseEvaluatedNodeFactory.create(arg0, EvaluatedNodeFactory.create(null)));
Assert.assertEquals(43, callTarget.call(new Object[] { 42 }));
Assert.assertEquals(1, arg0.getInvocationCount());
}
use of com.oracle.truffle.api.dsl.test.TypeSystemTest.ArgumentNode in project graal by oracle.
the class ExecuteEvaluatedTest method testDoubleEvaluated2.
@Test
public void testDoubleEvaluated2() {
ArgumentNode arg0 = new ArgumentNode(0);
ArgumentNode arg1 = new ArgumentNode(1);
CallTarget callTarget = TestHelper.createCallTarget(UseDoubleEvaluated2NodeFactory.create(arg0, arg1, DoubleEvaluatedNodeFactory.create(null, null)));
Assert.assertEquals(42, callTarget.call(new Object[] { 1, 43 }));
Assert.assertEquals(1, arg0.getInvocationCount());
Assert.assertEquals(1, arg1.getInvocationCount());
}
use of com.oracle.truffle.api.dsl.test.TypeSystemTest.ArgumentNode in project graal by oracle.
the class ExecuteEvaluatedTest method testDoubleEvaluated1.
@Test
public void testDoubleEvaluated1() {
ArgumentNode arg0 = new ArgumentNode(0);
ArgumentNode arg1 = new ArgumentNode(1);
CallTarget callTarget = TestHelper.createCallTarget(UseDoubleEvaluated1NodeFactory.create(arg0, arg1, DoubleEvaluatedNodeFactory.create(null, null)));
Assert.assertEquals(42, callTarget.call(new Object[] { 43, 1 }));
Assert.assertEquals(1, arg0.getInvocationCount());
Assert.assertEquals(1, arg1.getInvocationCount());
}
Aggregations