aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-07-16 18:24:44 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-16 18:24:44 -0700
commit295b89e59b926e4e5e00386cb981eef3036c9e76 (patch)
tree2e9d594ae9efdd2a582ef7c4ae90593ee1b2d305
parent105a9678505f3f34242f89aa0d5a28ee9dacfee6 (diff)
test for forwarding variables to outlined code
-rw-r--r--tools/test-js-optimizer-asm-outline1-output.js30
-rw-r--r--tools/test-js-optimizer-asm-outline1.js15
2 files changed, 45 insertions, 0 deletions
diff --git a/tools/test-js-optimizer-asm-outline1-output.js b/tools/test-js-optimizer-asm-outline1-output.js
index 00ba667d..a95fdc72 100644
--- a/tools/test-js-optimizer-asm-outline1-output.js
+++ b/tools/test-js-optimizer-asm-outline1-output.js
@@ -97,6 +97,16 @@ function mix() {
}
return 20;
}
+function vars(x, y) {
+ x = x | 0;
+ y = +y;
+ HEAP32[sp + 0 >> 2] = x;
+ HEAPF32[sp + 8 >> 2] = y;
+ vars$1(sp);
+ HEAP32[sp + 0 >> 2] = x;
+ HEAPF32[sp + 8 >> 2] = y;
+ vars$0(sp);
+}
function lin$0(sp) {
sp = sp | 0;
c(13);
@@ -246,4 +256,24 @@ function mix$1(sp) {
c(14);
c(15);
}
+function vars$0(sp) {
+ sp = sp | 0;
+ var x = 0, y = +0;
+ y = HEAPF32[sp + 8 >> 2];
+ x = HEAP32[sp + 0 >> 2];
+ c(5 + (x + y));
+ c(6 + y * x);
+ c(7 + (x + y));
+ c(8 + y * x);
+}
+function vars$1(sp) {
+ sp = sp | 0;
+ var x = 0, y = +0;
+ y = HEAPF32[sp + 8 >> 2];
+ x = HEAP32[sp + 0 >> 2];
+ c(1 + (x + y));
+ c(2 + y * x);
+ c(3 + (x + y));
+ c(4 + y * x);
+}
diff --git a/tools/test-js-optimizer-asm-outline1.js b/tools/test-js-optimizer-asm-outline1.js
index 838cbd4e..db9ab685 100644
--- a/tools/test-js-optimizer-asm-outline1.js
+++ b/tools/test-js-optimizer-asm-outline1.js
@@ -157,5 +157,20 @@ function mix() {
}
return 20;
}
+function vars(x, y) {
+ x = x | 0;
+ y = +y;
+ var a = 0, b = +0;
+ a = x+y;
+ b = y*x;
+ c(1+a);
+ c(2+b);
+ c(3+a);
+ c(4+b);
+ c(5+a);
+ c(6+b);
+ c(7+a);
+ c(8+b);
+}
// EMSCRIPTEN_GENERATED_FUNCTIONS
// EXTRA_INFO: { "sizeToOutline": 30 }