Mercurial > hg > truffle
annotate graal/com.oracle.truffle.sl.test/tests/Inlining.sl @ 16705:13f8c249edb8
NFI: more cleanup
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 06 Aug 2014 10:59:42 +0200 |
parents | 2caa107f51ce |
children |
rev | line source |
---|---|
13866
2caa107f51ce
SL: added testcase for inlining.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
1 |
2caa107f51ce
SL: added testcase for inlining.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
2 function a() {return 42;} |
2caa107f51ce
SL: added testcase for inlining.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
3 function b() {return a();} |
2caa107f51ce
SL: added testcase for inlining.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
4 function c() {return b();} |
2caa107f51ce
SL: added testcase for inlining.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
5 function d() {return c();} |
2caa107f51ce
SL: added testcase for inlining.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
6 function e() {return c();} |
2caa107f51ce
SL: added testcase for inlining.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
7 function f() {return c();} |
2caa107f51ce
SL: added testcase for inlining.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
8 function g() {return d() + e() + f();} |
2caa107f51ce
SL: added testcase for inlining.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
9 |
2caa107f51ce
SL: added testcase for inlining.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
10 function main() { |
2caa107f51ce
SL: added testcase for inlining.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
11 i = 0; |
2caa107f51ce
SL: added testcase for inlining.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
12 result = 0; |
2caa107f51ce
SL: added testcase for inlining.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
13 while (i < 10000) { |
2caa107f51ce
SL: added testcase for inlining.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
14 result = result + g(); |
2caa107f51ce
SL: added testcase for inlining.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
15 i = i + 1; |
2caa107f51ce
SL: added testcase for inlining.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
16 } |
2caa107f51ce
SL: added testcase for inlining.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
17 return result; |
2caa107f51ce
SL: added testcase for inlining.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
18 } |