diff options
Diffstat (limited to 'test/binaryen.js/stackir.js')
-rw-r--r-- | test/binaryen.js/stackir.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/binaryen.js/stackir.js b/test/binaryen.js/stackir.js new file mode 100644 index 000000000..5c4b14f9d --- /dev/null +++ b/test/binaryen.js/stackir.js @@ -0,0 +1,27 @@ +var wast = ` +(module + (type $i (func (param i32) (result i32))) + (memory $0 0) + (export "test" (func $test)) + (func $test (; 0 ;) (type $i) (param $0 i32) (result i32) + (block (result i32) + (block (result i32) + (if (result i32) + (get_local $0) + (get_local $0) + (i32.const 0) + ) + ) + ) + ) +) +`; +console.log("=== input wast ===" + wast); + +var module = Binaryen.parseText(wast); + +console.log("=== default ==="); +console.log(module.emitStackIR()); + +console.log("=== optimize ==="); // should omit the second block +console.log(module.emitStackIR(true)); |