Mercurial > hg > graal-compiler
diff graal/com.oracle.graal.truffle.test/sl/TestInliningMaxCallerSize.sl @ 17007:004e3f0a0517
Truffle: added new infrastructure for graal truffle runtime tests using SL.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 01 Sep 2014 20:08:19 +0200 |
parents | |
children | f735aa886cf6 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.truffle.test/sl/TestInliningMaxCallerSize.sl Mon Sep 01 20:08:19 2014 +0200 @@ -0,0 +1,26 @@ +/* + * This test verifies that CallTargets cannot exceed the TruffleInliningMaxCallerSize limit when inlining. + */ +function inlinableFunction() { + generateDummyNodes(getOption("TruffleInliningMaxCallerSize") - 8); +} + +function notInlinableFunction() { + generateDummyNodes(getOption("TruffleInliningMaxCallerSize") - 7); +} + +function test1() { + inlinableFunction(); +} + +function test2() { + notInlinableFunction(); +} + +function main() { + waitForOptimization(callUntilOptimized(test1)); + assertTrue(isInlined(test1, inlinableFunction), "inlinableFunction is not inlined"); + + waitForOptimization(callUntilOptimized(test2)); + assertFalse(isInlined(test2, notInlinableFunction), "notInlinableFunction is inlined"); +}