diff options
Diffstat (limited to 'tools/eliminator')
-rw-r--r-- | tools/eliminator/asm-eliminator-test-output.js | 10 | ||||
-rw-r--r-- | tools/eliminator/asm-eliminator-test.js | 16 |
2 files changed, 25 insertions, 1 deletions
diff --git a/tools/eliminator/asm-eliminator-test-output.js b/tools/eliminator/asm-eliminator-test-output.js index e477c320..b519cdf9 100644 --- a/tools/eliminator/asm-eliminator-test-output.js +++ b/tools/eliminator/asm-eliminator-test-output.js @@ -123,4 +123,14 @@ function switchy() { continue; } } +function confuusion() { + var i = +0, j = +0; + func1(+i); + j = i; + func2(+j); +} +function tempDouble(a) { + a = +a; + f(a * a); +} diff --git a/tools/eliminator/asm-eliminator-test.js b/tools/eliminator/asm-eliminator-test.js index acc07edb..ff67af47 100644 --- a/tools/eliminator/asm-eliminator-test.js +++ b/tools/eliminator/asm-eliminator-test.js @@ -156,5 +156,19 @@ function switchy() { continue; } } -// EMSCRIPTEN_GENERATED_FUNCTIONS: ["asm", "__Z11printResultPiS_j", "_segment_holding", "__ZN5identC2EiPKcPci", "_vec2Length", "exc", "label"] +function confuusion() { + var i = +0; + func1(+i); + var j = i; // add this var in the middle. should show up with right type later, auto-inferred from i's type + func2(+j); +} +function tempDouble(a) { + a = +a; + var x = +0, y = +0; + // CastAway can leave things like this as variables no longer needed. We need to identify that x's value has no side effects so it can be completely cleaned up + x = (HEAP32[((tempDoublePtr)>>2)]=((HEAP32[(($_sroa_0_0__idx1)>>2)])|0),HEAP32[(((tempDoublePtr)+(4))>>2)]=((HEAP32[((($_sroa_0_0__idx1)+(4))>>2)])|0),(+(HEAPF64[(tempDoublePtr)>>3]))); + y = a*a; + f(y); +} +// EMSCRIPTEN_GENERATED_FUNCTIONS: ["asm", "__Z11printResultPiS_j", "_segment_holding", "__ZN5identC2EiPKcPci", "_vec2Length", "exc", "label", "confuusion", "tempDouble"] |