Mercurial > hg > truffle
diff graal/com.oracle.graal.truffle.test/sl/TestInlining.sl @ 17257:f735aa886cf6
Truffle: add new inlining tests; adapt tests for context sensitive inlining.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 29 Sep 2014 18:46:40 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.truffle.test/sl/TestInlining.sl Mon Sep 29 18:46:40 2014 +0200 @@ -0,0 +1,20 @@ +/* + * This tests that simple arithmetic gets inlined. + */ +function add(a, b) { + return a + b; +} + + +function test() { + i = 0; + while (i < 100) { + i = add(i, 1); + } + return i; +} + +function main() { + waitForOptimization(callUntilOptimized(test)); + assertTrue(isInlined(test, test, add), "add is not inlined"); +}