Mercurial > hg > truffle
diff graal/com.oracle.truffle.sl.test/tests/LoopPolymorphic.sl @ 13836:64c77f0577bb
More documentation and improvements of Simple Language
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Thu, 30 Jan 2014 17:53:27 -0800 |
parents | |
children | afd6fa5e8229 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.truffle.sl.test/tests/LoopPolymorphic.sl Thu Jan 30 17:53:27 2014 -0800 @@ -0,0 +1,16 @@ +function add(a, b) { + return a + b; +} + +function loop(n) { + i = 0; + while (i < n) { + i = add(i, 1); + } + return i; +} + +function main() { + add("a", "b"); + println(loop(1000)); +}