use of com.oracle.truffle.api.CallTarget in project graal by oracle.
the class IntegerLiteralGuardsTest method testDecimalLiteral.
@Test
public void testDecimalLiteral() {
CallTarget root = createCallTarget(DecimalLiteralTestFactory.getInstance());
assertEquals("do1", root.call(14));
}
use of com.oracle.truffle.api.CallTarget in project graal by oracle.
the class LimitTest method testConstantLimit.
@Test
public void testConstantLimit() {
CallTarget root = TestHelper.createCallTarget(ConstantLimitTestFactory.getInstance());
assertEquals(42, root.call(42));
assertEquals(43, root.call(43));
try {
root.call(44);
fail();
} catch (UnsupportedSpecializationException e) {
}
}
use of com.oracle.truffle.api.CallTarget in project graal by oracle.
the class LimitTest method testMethodLimit.
@Test
public void testMethodLimit() {
MethodLimitTest.invocations = 0;
CallTarget root = TestHelper.createCallTarget(MethodLimitTestFactory.getInstance());
assertEquals(42, root.call(42));
assertEquals(43, root.call(43));
try {
root.call(44);
fail();
} catch (UnsupportedSpecializationException e) {
}
Assert.assertTrue(MethodLimitTest.invocations >= 3);
}
use of com.oracle.truffle.api.CallTarget in project graal by oracle.
the class MethodGuardsTest method testGuardLessEqual.
@Test
public void testGuardLessEqual() {
CallTarget root = createCallTarget(GuardLessEqualTestFactory.getInstance());
assertEquals("do1", root.call(1));
assertEquals("do1", root.call(0));
assertEquals("do2", root.call(2));
assertEquals("do1", root.call(0));
}
use of com.oracle.truffle.api.CallTarget in project graal by oracle.
the class MethodGuardsTest method testGuardNot.
@Test
public void testGuardNot() {
CallTarget root = createCallTarget(GuardNotTestFactory.getInstance());
assertEquals("do1", root.call(0));
assertEquals("do1", root.call(2));
assertEquals("do2", root.call(1));
assertEquals("do1", root.call(0));
}
Aggregations