Mercurial > hg > truffle
comparison 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 |
comparison
equal
deleted
inserted
replaced
17256:88d5fd9e1a6c | 17257:f735aa886cf6 |
---|---|
1 /* | |
2 * This tests that simple arithmetic gets inlined. | |
3 */ | |
4 function add(a, b) { | |
5 return a + b; | |
6 } | |
7 | |
8 | |
9 function test() { | |
10 i = 0; | |
11 while (i < 100) { | |
12 i = add(i, 1); | |
13 } | |
14 return i; | |
15 } | |
16 | |
17 function main() { | |
18 waitForOptimization(callUntilOptimized(test)); | |
19 assertTrue(isInlined(test, test, add), "add is not inlined"); | |
20 } |