diff options
Diffstat (limited to 'test/binaryen.js')
-rw-r--r-- | test/binaryen.js/exception-handling.js.txt | 8 | ||||
-rw-r--r-- | test/binaryen.js/kitchen-sink.js | 21 | ||||
-rw-r--r-- | test/binaryen.js/kitchen-sink.js.txt | 47 | ||||
-rw-r--r-- | test/binaryen.js/push-pop.js | 43 | ||||
-rw-r--r-- | test/binaryen.js/push-pop.js.txt | 43 |
5 files changed, 37 insertions, 125 deletions
diff --git a/test/binaryen.js/exception-handling.js.txt b/test/binaryen.js/exception-handling.js.txt index a2b10d37f..380ce34d6 100644 --- a/test/binaryen.js/exception-handling.js.txt +++ b/test/binaryen.js/exception-handling.js.txt @@ -28,7 +28,7 @@ ) ) -getExpressionInfo(throw) = {"id":44,"type":1,"event":"e"} -getExpressionInfo(br_on_exn) = {"id":46,"type":10,"name":"l","event":"e"} -getExpressionInfo(rethrow) = {"id":45,"type":1} -getExpressionInfo(try) = {"id":43,"type":0} +getExpressionInfo(throw) = {"id":43,"type":1,"event":"e"} +getExpressionInfo(br_on_exn) = {"id":45,"type":10,"name":"l","event":"e"} +getExpressionInfo(rethrow) = {"id":44,"type":1} +getExpressionInfo(try) = {"id":42,"type":0} diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js index b0b81433d..6c5afa169 100644 --- a/test/binaryen.js/kitchen-sink.js +++ b/test/binaryen.js/kitchen-sink.js @@ -145,7 +145,6 @@ function test_ids() { console.log("ThrowId: " + binaryen.ThrowId); console.log("RethrowId: " + binaryen.RethrowId); console.log("BrOnExnId: " + binaryen.BrOnExnId); - console.log("PushId: " + binaryen.PushId); console.log("PopId: " + binaryen.PopId); } @@ -548,16 +547,16 @@ function test_core() { ), 2 ), - // Push and pop - module.push(module.i32.pop()), - module.push(module.i64.pop()), - module.push(module.f32.pop()), - module.push(module.f64.pop()), - module.push(module.v128.pop()), - module.push(module.anyref.pop()), - module.push(module.funcref.pop()), - module.push(module.nullref.pop()), - module.push(module.exnref.pop()), + // Pop + module.i32.pop(), + module.i64.pop(), + module.f32.pop(), + module.f64.pop(), + module.v128.pop(), + module.anyref.pop(), + module.funcref.pop(), + module.nullref.pop(), + module.exnref.pop(), // TODO: Host module.nop(), module.unreachable(), diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt index b27d147b3..14f8c0d03 100644 --- a/test/binaryen.js/kitchen-sink.js.txt +++ b/test/binaryen.js/kitchen-sink.js.txt @@ -69,12 +69,11 @@ MemoryInitId: 34 DataDropId: 35 MemoryCopyId: 36 MemoryFillId: 37 -TryId: 43 -ThrowId: 44 -RethrowId: 45 -BrOnExnId: 46 -PushId: 38 -PopId: 39 +TryId: 42 +ThrowId: 43 +RethrowId: 44 +BrOnExnId: 45 +PopId: 38 getExpressionInfo={"id":15,"type":4,"op":6} (f32.neg (f32.const -33.61199951171875) @@ -1846,31 +1845,31 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} ) ) ) - (push + (drop (i32.pop) ) - (push + (drop (i64.pop) ) - (push + (drop (f32.pop) ) - (push + (drop (f64.pop) ) - (push + (drop (v128.pop) ) - (push + (drop (anyref.pop) ) - (push + (drop (funcref.pop) ) - (push + (drop (nullref.pop) ) - (push + (drop (exnref.pop) ) (nop) @@ -3644,31 +3643,31 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} ) ) ) - (push + (drop (i32.pop) ) - (push + (drop (i64.pop) ) - (push + (drop (f32.pop) ) - (push + (drop (f64.pop) ) - (push + (drop (v128.pop) ) - (push + (drop (anyref.pop) ) - (push + (drop (funcref.pop) ) - (push + (drop (nullref.pop) ) - (push + (drop (exnref.pop) ) (nop) diff --git a/test/binaryen.js/push-pop.js b/test/binaryen.js/push-pop.js deleted file mode 100644 index 042ed17d6..000000000 --- a/test/binaryen.js/push-pop.js +++ /dev/null @@ -1,43 +0,0 @@ -function cleanInfo(info) { - var ret = {}; - for (var x in info) { - if (x !== 'value') { - ret[x] = info[x]; - } - } - return ret; -} - -function stringify(expr) { - return JSON.stringify(cleanInfo(binaryen.getExpressionInfo(expr))); -} - -var module = new binaryen.Module(); - -var func = module.addFunction("func", binaryen.none, binaryen.none, [], - module.block(null, [ - module.push(module.i32.pop()), - module.push(module.i64.pop()), - module.push(module.f32.pop()), - module.push(module.f64.pop()), - module.push(module.v128.pop()), - module.push(module.funcref.pop()), - module.push(module.anyref.pop()), - module.push(module.nullref.pop()), - module.push(module.exnref.pop()) - ]) -) - -assert(module.validate()); -console.log(module.emitText()); - -console.log("getExpressionInfo(i32.pop) = " + stringify(module.i32.pop())); -console.log("getExpressionInfo(i64.pop) = " + stringify(module.i64.pop())); -console.log("getExpressionInfo(f32.pop) = " + stringify(module.f32.pop())); -console.log("getExpressionInfo(f64.pop) = " + stringify(module.f64.pop())); -console.log("getExpressionInfo(v128.pop) = " + stringify(module.v128.pop())); -console.log("getExpressionInfo(funcref.pop) = " + stringify(module.funcref.pop())); -console.log("getExpressionInfo(anyref.pop) = " + stringify(module.anyref.pop())); -console.log("getExpressionInfo(nullref.pop) = " + stringify(module.nullref.pop())); -console.log("getExpressionInfo(exnref.pop) = " + stringify(module.exnref.pop())); -console.log("getExpressionInfo(push) = " + stringify(module.push(module.i32.const(0)))); diff --git a/test/binaryen.js/push-pop.js.txt b/test/binaryen.js/push-pop.js.txt deleted file mode 100644 index e5d5437f9..000000000 --- a/test/binaryen.js/push-pop.js.txt +++ /dev/null @@ -1,43 +0,0 @@ -(module - (type $none_=>_none (func)) - (func $func - (push - (i32.pop) - ) - (push - (i64.pop) - ) - (push - (f32.pop) - ) - (push - (f64.pop) - ) - (push - (v128.pop) - ) - (push - (funcref.pop) - ) - (push - (anyref.pop) - ) - (push - (nullref.pop) - ) - (push - (exnref.pop) - ) - ) -) - -getExpressionInfo(i32.pop) = {"id":39,"type":2} -getExpressionInfo(i64.pop) = {"id":39,"type":3} -getExpressionInfo(f32.pop) = {"id":39,"type":4} -getExpressionInfo(f64.pop) = {"id":39,"type":5} -getExpressionInfo(v128.pop) = {"id":39,"type":6} -getExpressionInfo(funcref.pop) = {"id":39,"type":7} -getExpressionInfo(anyref.pop) = {"id":39,"type":8} -getExpressionInfo(nullref.pop) = {"id":39,"type":9} -getExpressionInfo(exnref.pop) = {"id":39,"type":10} -getExpressionInfo(push) = {"id":38} |