aboutsummaryrefslogtreecommitdiff
path: root/tools/test-js-optimizer-asm-regs.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-01-11 16:17:16 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-01-11 16:17:16 -0800
commitc47f7eba9be951c8e308e66c2541091c6b057af8 (patch)
tree59aed1cd174e91921e867955507c13f63303f40e /tools/test-js-optimizer-asm-regs.js
parentada59f0a9d23d8ec19ee6a1326977ddf6e93f5f9 (diff)
parent2113958017b5def518bd4bcf0bf77e8be233a93f (diff)
Merge branch 'incoming'
Diffstat (limited to 'tools/test-js-optimizer-asm-regs.js')
-rw-r--r--tools/test-js-optimizer-asm-regs.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/tools/test-js-optimizer-asm-regs.js b/tools/test-js-optimizer-asm-regs.js
new file mode 100644
index 00000000..9192f32e
--- /dev/null
+++ b/tools/test-js-optimizer-asm-regs.js
@@ -0,0 +1,38 @@
+function asm(x, y) {
+ x = +x;
+ y = y | 0;
+ var int1 = 0, int2 = 0; // do not mix the types!
+ var double1 = +0, double2 = +0;
+ int1 = (x+x)|0;
+ double1 = d(Math.max(10, Math_min(5, f())));
+ int2 = (int1+2)|0;
+ print(int2);
+ double2 = double1*5;
+ return double2;
+}
+function _doit($x, $y$0, $y$1) {
+ $x = $x | 0;
+ $y$0 = $y$0 | 0;
+ $y$1 = $y$1 | 0;
+ var __stackBase__ = 0;
+ __stackBase__ = STACKTOP;
+ _printf(__str | 0, (tempInt = STACKTOP, STACKTOP = STACKTOP + 8 | 0, HEAP32[(tempInt & 16777215) >> 2] = $y$0, HEAP32[(tempInt + 4 & 16777215) >> 2] = $y$1, tempInt));
+ STACKTOP = __stackBase__;
+ return 0 | 0;
+}
+function rett() {
+ if (f()) {
+ g();
+ return 5;
+ }
+ // missing final return, need to add it
+}
+function ret2t() {
+ if (f()) {
+ g();
+ return;
+ }
+ // missing final return, but no need
+}
+// EMSCRIPTEN_GENERATED_FUNCTIONS: ["asm", "_doit", "rett", "ret2t"]
+