Mercurial > hg > truffle
annotate graal/com.oracle.truffle.sl.test/tests/Inlining.sl @ 15479:4f397be8f424
TruffleDSL: NodeCodeGenerator: remove always-true assertion
author | Andreas Woess <andreas.woess@jku.at> |
---|---|
date | Fri, 02 May 2014 17:07:44 +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 } |