comparison graal/com.oracle.graal.truffle.test/src/sl/TestInliningRecursive1.sl @ 22720:bba4e91a2d63

Move .sl testcases/outputs (resources) into projects src directory
author Stefan Anzinger <stefan.anzinger@oracle.com>
date Tue, 29 Sep 2015 15:02:34 +0200
parents graal/com.oracle.graal.truffle.test/sl/TestInliningRecursive1.sl@e66a6f8d63e3
children
comparison
equal deleted inserted replaced
22719:f035cf1d2e5a 22720:bba4e91a2d63
1 /*
2 * Test recursive calls do not get inlined and do not crash.
3 */
4 function fib(a) {
5 if (a == 2 || a == 1) {
6 return 1;
7 }
8 return fib(a-1) + fib(a-2);
9 }
10
11 function test() {
12 i = 0;
13 sum = 0;
14 while (i < 100) {
15 sum = sum + fib(7);
16 i = i + 1;
17 }
18 return sum;
19 }
20
21 function main() {
22 callUntilOptimized(test);
23 }