diff options
Diffstat (limited to 'test')
75 files changed, 410 insertions, 411 deletions
diff --git a/test/binaryen.js/event.js.txt b/test/binaryen.js/event.js.txt deleted file mode 100644 index 94e1b1a7a..000000000 --- a/test/binaryen.js/event.js.txt +++ /dev/null @@ -1,15 +0,0 @@ -GetEvent is equal: true -getEventInfo={"name":"a-event","module":"","base":"","attribute":0,"params":2,"results":0} -(module - (type $i32_=>_none (func (param i32))) - (type $i32_f32_=>_none (func (param i32 f32))) - (import "module" "base" (event $a-event-imp (attr 0) (param i32 f32))) - (event $a-event (attr 0) (param i32)) - (export "a-event-exp" (event $a-event)) -) - -(module - (type $i32_f32_=>_none (func (param i32 f32))) - (import "module" "base" (event $a-event-imp (attr 0) (param i32 f32))) -) - diff --git a/test/binaryen.js/exception-handling.js b/test/binaryen.js/exception-handling.js index a8d3dd3a4..1f512bbe8 100644 --- a/test/binaryen.js/exception-handling.js +++ b/test/binaryen.js/exception-handling.js @@ -2,7 +2,7 @@ function cleanInfo(info) { var ret = {}; for (var x in info) { // Filter out address pointers and only print meaningful info - if (x == 'id' || x == 'type' || x == 'name' || x == 'event' || + if (x == 'id' || x == 'type' || x == 'name' || x == 'tag' || x == 'target' || x == 'hasCatchAll' || x == 'delegateTarget' || x == 'isDelegate') { ret[x] = info[x]; @@ -19,7 +19,7 @@ var module = new binaryen.Module(); module.setFeatures(binaryen.Features.ReferenceTypes | binaryen.Features.ExceptionHandling); -var event_ = module.addEvent("e", 0, binaryen.i32, binaryen.none); +module.addTag("e", 0, binaryen.i32, binaryen.none); // (try $l0 // (do @@ -52,7 +52,7 @@ var try_catch = module.try( // (do // (try // (do -// (throw $a-event (i32.const 0)) +// (throw $a-tag (i32.const 0)) // ) // (delegate $try_outer) // ) diff --git a/test/binaryen.js/exception-handling.js.txt b/test/binaryen.js/exception-handling.js.txt index 0fbdc3668..e711f7bfd 100644 --- a/test/binaryen.js/exception-handling.js.txt +++ b/test/binaryen.js/exception-handling.js.txt @@ -1,7 +1,7 @@ (module (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) - (event $e (attr 0) (param i32)) + (tag $e (attr 0) (param i32)) (func $test (try $l0 (do @@ -34,7 +34,7 @@ ) ) -getExpressionInfo(throw) = {"id":46,"type":1,"event":"e"} +getExpressionInfo(throw) = {"id":46,"type":1,"tag":"e"} getExpressionInfo(rethrow) = {"id":47,"type":1,"target":"l0"} getExpressionInfo(try_catch) = {"id":45,"type":1,"name":"l0","hasCatchAll":0,"delegateTarget":"","isDelegate":0} getExpressionInfo(try_delegate) = {"id":45,"type":0,"name":"try_outer","hasCatchAll":1,"delegateTarget":"","isDelegate":0} diff --git a/test/binaryen.js/expressions.js b/test/binaryen.js/expressions.js index ca45933a7..40d4194fd 100644 --- a/test/binaryen.js/expressions.js +++ b/test/binaryen.js/expressions.js @@ -1565,22 +1565,22 @@ console.log("# RefEq"); console.log("# Try"); (function testTry() { const module = new binaryen.Module(); - module.addEvent("event1", 0, binaryen.none, binaryen.none); - module.addEvent("event2", 0, binaryen.none, binaryen.none); - module.addEvent("event3", 0, binaryen.none, binaryen.none); + module.addTag("tag1", 0, binaryen.none, binaryen.none); + module.addTag("tag2", 0, binaryen.none, binaryen.none); + module.addTag("tag3", 0, binaryen.none, binaryen.none); var body = module.i32.const(1); var catchBodies = [ module.i32.const(2), module.i32.const(3) ]; - const theTry = binaryen.Try(module.try('', body, ["event1"], catchBodies, '')); + const theTry = binaryen.Try(module.try('', body, ["tag1"], catchBodies, '')); assert(theTry instanceof binaryen.Try); assert(theTry instanceof binaryen.Expression); assert(theTry.body === body); assertDeepEqual(theTry.catchBodies, catchBodies); assert(theTry.type === binaryen.i32); - assert(theTry.getNumCatchEvents() == 1); + assert(theTry.getNumCatchTags() == 1); assert(theTry.getNumCatchBodies() == 2); assert(theTry.hasCatchAll() == 1); console.log(theTry.toText()); @@ -1596,31 +1596,31 @@ console.log("# Try"); assertDeepEqual(theTry.getCatchBodies(), catchBodies); console.log(theTry.toText()); - theTry.insertCatchEventAt(1, "event2"); + theTry.insertCatchTagAt(1, "tag2"); theTry.insertCatchBodyAt(0, module.i32.const(6)); - assert(theTry.getNumCatchEvents() == 2); + assert(theTry.getNumCatchTags() == 2); assert(theTry.getNumCatchBodies() == 2); assert(theTry.hasCatchAll() == 0); console.log(theTry.toText()); - assert(theTry.removeCatchEventAt(1) == "event2"); + assert(theTry.removeCatchTagAt(1) == "tag2"); theTry.removeCatchBodyAt(1); - assert(theTry.getNumCatchEvents() == 1); + assert(theTry.getNumCatchTags() == 1); assert(theTry.getNumCatchBodies() == 1); console.log(theTry.toText()); - theTry.appendCatchEvent("event3"); + theTry.appendCatchTag("tag3"); theTry.appendCatchBody(module.drop(module.i32.const(7))); - assert(theTry.getCatchEventAt(0) == "event1"); - assert(theTry.getCatchEventAt(1) == "event3"); - theTry.setCatchEvents(["event2", "event3"]); - assertDeepEqual(theTry.getCatchEvents(), ["event2", "event3"]); + assert(theTry.getCatchTagAt(0) == "tag1"); + assert(theTry.getCatchTagAt(1) == "tag3"); + theTry.setCatchTags(["tag2", "tag3"]); + assertDeepEqual(theTry.getCatchTags(), ["tag2", "tag3"]); theTry.setCatchBodies([module.i32.const(8), module.i32.const(9)]); - assert(theTry.getCatchEventAt(0) == "event2"); - assert(theTry.getCatchEventAt(1) == "event3"); - theTry.setCatchEventAt(1, "event1"); + assert(theTry.getCatchTagAt(0) == "tag2"); + assert(theTry.getCatchTagAt(1) == "tag3"); + theTry.setCatchTagAt(1, "tag1"); theTry.setCatchBodyAt(1, module.i32.const(10)); - assert(theTry.getCatchEventAt(1) == "event1"); + assert(theTry.getCatchTagAt(1) == "tag1"); console.log(theTry.toText()); theTry.type = binaryen.f64; @@ -1643,20 +1643,20 @@ console.log("# Throw"); (function testThrow() { const module = new binaryen.Module(); - var event = "foo"; + var tag = "foo"; var operands = [ module.i32.const(1), module.i32.const(2) ]; - const theThrow = binaryen.Throw(module.throw(event, operands)); + const theThrow = binaryen.Throw(module.throw(tag, operands)); assert(theThrow instanceof binaryen.Throw); assert(theThrow instanceof binaryen.Expression); - assert(theThrow.event === event); + assert(theThrow.tag === tag); assertDeepEqual(theThrow.operands, operands); assert(theThrow.type === binaryen.unreachable); - theThrow.event = "bar"; - assert(theThrow.event === "bar"); + theThrow.tag = "bar"; + assert(theThrow.tag === "bar"); theThrow.operands = operands = [ module.i32.const(3), // set module.i32.const(4), // set diff --git a/test/binaryen.js/expressions.js.txt b/test/binaryen.js/expressions.js.txt index 1d38104af..b9107f5c1 100644 --- a/test/binaryen.js/expressions.js.txt +++ b/test/binaryen.js/expressions.js.txt @@ -238,7 +238,7 @@ (do (i32.const 1) ) - (catch $event1 + (catch $tag1 (i32.const 2) ) (catch_all @@ -250,7 +250,7 @@ (do (i32.const 4) ) - (catch $event1 + (catch $tag1 (i32.const 5) ) ) @@ -259,10 +259,10 @@ (do (i32.const 4) ) - (catch $event1 + (catch $tag1 (i32.const 6) ) - (catch $event2 + (catch $tag2 (i32.const 5) ) ) @@ -271,7 +271,7 @@ (do (i32.const 4) ) - (catch $event1 + (catch $tag1 (i32.const 6) ) ) @@ -280,10 +280,10 @@ (do (i32.const 4) ) - (catch $event2 + (catch $tag2 (i32.const 8) ) - (catch $event1 + (catch $tag1 (i32.const 10) ) ) @@ -292,10 +292,10 @@ (do (i32.const 4) ) - (catch $event2 + (catch $tag2 (i32.const 8) ) - (catch $event1 + (catch $tag1 (i32.const 10) ) ) diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js index a8e69e381..dd942b7d7 100644 --- a/test/binaryen.js/kitchen-sink.js +++ b/test/binaryen.js/kitchen-sink.js @@ -191,8 +191,8 @@ function test_core() { module = new binaryen.Module(); - // Create an event - var event_ = module.addEvent("a-event", 0, binaryen.i32, binaryen.none); + // Create a tag + var tag = module.addTag("a-tag", 0, binaryen.i32, binaryen.none); // Literals and consts @@ -593,8 +593,8 @@ function test_core() { // Exception handling module.try( '', - module.throw("a-event", [module.i32.const(0)]), - ["a-event"], + module.throw("a-tag", [module.i32.const(0)]), + ["a-tag"], [module.drop(module.i32.pop())], '' ), @@ -702,13 +702,13 @@ function test_core() { module.addFunctionImport("an-imported", "module", "base", iF, binaryen.f32); module.addGlobalImport("a-global-imp", "module", "base", binaryen.i32, false); module.addGlobalImport("a-mut-global-imp", "module", "base", binaryen.i32, true); - module.addEventImport("a-event-imp", "module", "base", 0, binaryen.i32, binaryen.none); + module.addTagImport("a-tag-imp", "module", "base", 0, binaryen.i32, binaryen.none); // Exports module.addFunctionExport("kitchen()sinker", "kitchen_sinker"); module.addGlobalExport("a-global", "a-global-exp"); - module.addEventExport("a-event", "a-event-exp"); + module.addTagExport("a-tag", "a-tag-exp"); // Tables module.addTable("t1", 0, 2); @@ -973,7 +973,7 @@ function test_binaries() { var adder = module.addFunction("adder", ii, binaryen.i32, [], add); var initExpr = module.i32.const(3); var global = module.addGlobal("a-global", binaryen.i32, false, initExpr) - var event_ = module.addEvent("a-event", 0, binaryen.createType([binaryen.i32, binaryen.i32]), binaryen.none); + var tag = module.addTag("a-tag", 0, binaryen.createType([binaryen.i32, binaryen.i32]), binaryen.none); binaryen.setDebugInfo(true); // include names section buffer = module.emitBinary(); binaryen.setDebugInfo(false); @@ -1038,7 +1038,7 @@ function test_parsing() { var adder = module.addFunction("adder", ii, binaryen.i32, [], add); var initExpr = module.i32.const(3); var global = module.addGlobal("a-global", binaryen.i32, false, initExpr) - var event_ = module.addEvent("a-event", 0, binaryen.i32, binaryen.none); + var tag = module.addTag("a-tag", 0, binaryen.i32, binaryen.none); text = module.emitText(); module.dispose(); module = null; diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt index b8b671de5..745df85f0 100644 --- a/test/binaryen.js/kitchen-sink.js.txt +++ b/test/binaryen.js/kitchen-sink.js.txt @@ -128,17 +128,17 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} (import "module" "base" (global $a-global-imp i32)) (import "module" "base" (global $a-mut-global-imp (mut i32))) (import "module" "base" (func $an-imported (param i32 f64) (result f32))) - (import "module" "base" (event $a-event-imp (attr 0) (param i32))) + (import "module" "base" (tag $a-tag-imp (attr 0) (param i32))) (global $a-global i32 (i32.const 1)) (memory $0 (shared 1 256)) (data (i32.const 10) "hello, world") (data "I am passive") (table $t0 1 funcref) (elem $e0 (i32.const 0) "$kitchen()sinker") - (event $a-event (attr 0) (param i32)) + (tag $a-tag (attr 0) (param i32)) (export "kitchen_sinker" (func "$kitchen()sinker")) (export "a-global-exp" (global $a-global)) - (export "a-event-exp" (event $a-event)) + (export "a-tag-exp" (tag $a-tag)) (export "mem" (memory $0)) (start $starter) (func "$kitchen()sinker" (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32) @@ -2091,11 +2091,11 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} ) (try (do - (throw $a-event + (throw $a-tag (i32.const 0) ) ) - (catch $a-event + (catch $a-tag (drop (pop i32) ) @@ -2220,17 +2220,17 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} (import "module" "base" (global $a-global-imp i32)) (import "module" "base" (global $a-mut-global-imp (mut i32))) (import "module" "base" (func $an-imported (param i32 f64) (result f32))) - (import "module" "base" (event $a-event-imp (attr 0) (param i32))) + (import "module" "base" (tag $a-tag-imp (attr 0) (param i32))) (global $a-global i32 (i32.const 1)) (memory $0 (shared 1 256)) (data (i32.const 10) "hello, world") (data "I am passive") (table $t0 1 funcref) (elem $e0 (i32.const 0) "$kitchen()sinker") - (event $a-event (attr 0) (param i32)) + (tag $a-tag (attr 0) (param i32)) (export "kitchen_sinker" (func "$kitchen()sinker")) (export "a-global-exp" (global $a-global)) - (export "a-event-exp" (event $a-event)) + (export "a-tag-exp" (tag $a-tag)) (export "mem" (memory $0)) (start $starter) (func "$kitchen()sinker" (param $0 i32) (param $1 i64) (param $2 f32) (param $3 f64) (result i32) @@ -4183,11 +4183,11 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} ) (try (do - (throw $a-event + (throw $a-tag (i32.const 0) ) ) - (catch $a-event + (catch $a-tag (drop (pop i32) ) @@ -4779,7 +4779,7 @@ module loaded from binary form: (type $i32_i32_=>_none (func (param i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (global $a-global i32 (i32.const 3)) - (event $event$0 (attr 0) (param i32 i32)) + (tag $tag$0 (attr 0) (param i32 i32)) (func $adder (param $0 i32) (param $1 i32) (result i32) (i32.add (local.get $0) @@ -4821,7 +4821,7 @@ test_parsing text: (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (global $a-global i32 (i32.const 3)) - (event $a-event (attr 0) (param i32)) + (tag $a-tag (attr 0) (param i32)) (func $adder (param $0 i32) (param $1 i32) (result i32) (i32.add (local.get $0) @@ -4835,7 +4835,7 @@ module loaded from text form: (type $i32_=>_none (func (param i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (global $a-global i32 (i32.const 3)) - (event $a-event (attr 0) (param i32)) + (tag $a-tag (attr 0) (param i32)) (func $ADD_ER (param $0 i32) (param $1 i32) (result i32) (i32.add (local.get $0) diff --git a/test/binaryen.js/event.js b/test/binaryen.js/tag.js index f705edc38..17822236d 100644 --- a/test/binaryen.js/event.js +++ b/test/binaryen.js/tag.js @@ -13,21 +13,21 @@ module.setFeatures(binaryen.Features.ReferenceTypes | var pairType = binaryen.createType([binaryen.i32, binaryen.f32]); -var event_ = module.addEvent("a-event", 0, binaryen.i32, binaryen.none); +var tag = module.addTag("a-tag", 0, binaryen.i32, binaryen.none); -console.log("GetEvent is equal: " + (event_ === module.getEvent("a-event"))); +console.log("GetTag is equal: " + (tag === module.getTag("a-tag"))); -var eventInfo = binaryen.getEventInfo(event_); -console.log("getEventInfo=" + JSON.stringify(cleanInfo(eventInfo))); +var tagInfo = binaryen.getTagInfo(tag); +console.log("getTagInfo=" + JSON.stringify(cleanInfo(tagInfo))); -module.addEventExport("a-event", "a-event-exp"); -module.addEventImport("a-event-imp", "module", "base", 0, pairType, binaryen.none); +module.addTagExport("a-tag", "a-tag-exp"); +module.addTagImport("a-tag-imp", "module", "base", 0, pairType, binaryen.none); assert(module.validate()); console.log(module.emitText()); -module.removeExport("a-event-exp"); -module.removeEvent("a-event"); +module.removeExport("a-tag-exp"); +module.removeTag("a-tag"); assert(module.validate()); console.log(module.emitText()); diff --git a/test/binaryen.js/tag.js.txt b/test/binaryen.js/tag.js.txt new file mode 100644 index 000000000..51a0d33ee --- /dev/null +++ b/test/binaryen.js/tag.js.txt @@ -0,0 +1,15 @@ +GetTag is equal: true +getTagInfo={"name":"a-tag","module":"","base":"","attribute":0,"params":2,"results":0} +(module + (type $i32_=>_none (func (param i32))) + (type $i32_f32_=>_none (func (param i32 f32))) + (import "module" "base" (tag $a-tag-imp (attr 0) (param i32 f32))) + (tag $a-tag (attr 0) (param i32)) + (export "a-tag-exp" (tag $a-tag)) +) + +(module + (type $i32_f32_=>_none (func (param i32 f32))) + (import "module" "base" (tag $a-tag-imp (attr 0) (param i32 f32))) +) + diff --git a/test/br_to_try.wasm.fromBinary b/test/br_to_try.wasm.fromBinary index 1deebd37d..e52b8dcf8 100644 --- a/test/br_to_try.wasm.fromBinary +++ b/test/br_to_try.wasm.fromBinary @@ -1,7 +1,7 @@ (module (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) - (event $event$0 (attr 0) (param i32)) + (tag $tag$0 (attr 0) (param i32)) (func $0 (try $label$3 (do @@ -9,7 +9,7 @@ (br $label$1) ) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) diff --git a/test/break-within-catch.wasm.fromBinary b/test/break-within-catch.wasm.fromBinary index 74418c177..ecde70f3e 100644 --- a/test/break-within-catch.wasm.fromBinary +++ b/test/break-within-catch.wasm.fromBinary @@ -1,14 +1,14 @@ (module (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) - (event $event$0 (attr 0) (param i32)) + (tag $tag$0 (attr 0) (param i32)) (func $0 (block $label$2 (try $label$3 (do (nop) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) diff --git a/test/events.wast b/test/events.wast deleted file mode 100644 index f96cf6c95..000000000 --- a/test/events.wast +++ /dev/null @@ -1,16 +0,0 @@ -;; Test events - -(module - (event (attr 0) (param i32)) - (event $e (attr 0) (param i32 f32)) - (event $empty (attr 0)) - - (event $e-params0 (attr 0) (param i32 f32)) - (event $e-params1 (attr 0) (param i32) (param f32)) - - (event $e-export (export "ex0") (attr 0) (param i32)) - (event $e-import (import "env" "im0") (attr 0) (param i32)) - - (import "env" "im1" (event (attr 0) (param i32 f32))) - (export "ex1" (event $e)) -) diff --git a/test/events.wast.from-wast b/test/events.wast.from-wast deleted file mode 100644 index fca3041ab..000000000 --- a/test/events.wast.from-wast +++ /dev/null @@ -1,14 +0,0 @@ -(module - (type $i32_f32_=>_none (func (param i32 f32))) - (type $i32_=>_none (func (param i32))) - (type $none_=>_none (func)) - (import "env" "im0" (event $e-import (attr 0) (param i32))) - (import "env" "im1" (event $eimport$1 (attr 0) (param i32 f32))) - (event $2 (attr 0) (param i32)) - (event $e (attr 0) (param i32 f32)) - (event $empty (attr 0) (param)) - (event $e-params0 (attr 0) (param i32 f32)) - (event $e-params1 (attr 0) (param i32 f32)) - (event $e-export (attr 0) (param i32)) - (export "ex1" (event $e)) -) diff --git a/test/events.wast.fromBinary b/test/events.wast.fromBinary deleted file mode 100644 index 2576ff887..000000000 --- a/test/events.wast.fromBinary +++ /dev/null @@ -1,15 +0,0 @@ -(module - (type $i32_f32_=>_none (func (param i32 f32))) - (type $i32_=>_none (func (param i32))) - (type $none_=>_none (func)) - (import "env" "im0" (event $eimport$0 (attr 0) (param i32))) - (import "env" "im1" (event $eimport$1 (attr 0) (param i32 f32))) - (event $event$0 (attr 0) (param i32)) - (event $event$1 (attr 0) (param i32 f32)) - (event $event$2 (attr 0) (param)) - (event $event$3 (attr 0) (param i32 f32)) - (event $event$4 (attr 0) (param i32 f32)) - (event $event$5 (attr 0) (param i32)) - (export "ex1" (event $event$1)) -) - diff --git a/test/events.wast.fromBinary.noDebugInfo b/test/events.wast.fromBinary.noDebugInfo deleted file mode 100644 index 2576ff887..000000000 --- a/test/events.wast.fromBinary.noDebugInfo +++ /dev/null @@ -1,15 +0,0 @@ -(module - (type $i32_f32_=>_none (func (param i32 f32))) - (type $i32_=>_none (func (param i32))) - (type $none_=>_none (func)) - (import "env" "im0" (event $eimport$0 (attr 0) (param i32))) - (import "env" "im1" (event $eimport$1 (attr 0) (param i32 f32))) - (event $event$0 (attr 0) (param i32)) - (event $event$1 (attr 0) (param i32 f32)) - (event $event$2 (attr 0) (param)) - (event $event$3 (attr 0) (param i32 f32)) - (event $event$4 (attr 0) (param i32 f32)) - (event $event$5 (attr 0) (param i32)) - (export "ex1" (event $event$1)) -) - diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index 9b9c7aa6e..cb2f29c77 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -316,9 +316,8 @@ void test_core() { BinaryenRefFunc(module, "kitchen()sinker", BinaryenTypeFuncref()); BinaryenExpressionRef i31refExpr = BinaryenI31New(module, makeInt32(module, 1)); - // Events - BinaryenAddEvent( - module, "a-event", 0, BinaryenTypeInt32(), BinaryenTypeNone()); + // Tags + BinaryenAddTag(module, "a-tag", 0, BinaryenTypeInt32(), BinaryenTypeNone()); BinaryenAddTable(module, "tab", 0, 100); @@ -326,21 +325,21 @@ void test_core() { // (try // (do - // (throw $a-event (i32.const 0)) + // (throw $a-tag (i32.const 0)) // ) - // (catch $a-event + // (catch $a-tag // (drop (i32 pop)) // ) // (catch_all) // ) BinaryenExpressionRef tryBody = BinaryenThrow( - module, "a-event", (BinaryenExpressionRef[]){makeInt32(module, 0)}, 1); + module, "a-tag", (BinaryenExpressionRef[]){makeInt32(module, 0)}, 1); BinaryenExpressionRef catchBody = BinaryenDrop(module, BinaryenPop(module, BinaryenTypeInt32())); BinaryenExpressionRef catchAllBody = BinaryenNop(module); - const char* catchEvents[] = {"a-event"}; + const char* catchTags[] = {"a-tag"}; BinaryenExpressionRef catchBodies[] = {catchBody, catchAllBody}; - const char* emptyCatchEvents[] = {}; + const char* emptyCatchTags[] = {}; BinaryenExpressionRef emptyCatchBodies[] = {}; BinaryenExpressionRef nopCatchBody[] = {BinaryenNop(module)}; @@ -829,12 +828,12 @@ void test_core() { BinaryenRefAsI31(), BinaryenRefNull(module, BinaryenTypeAnyref())), // Exception handling - BinaryenTry(module, NULL, tryBody, catchEvents, 1, catchBodies, 2, NULL), + BinaryenTry(module, NULL, tryBody, catchTags, 1, catchBodies, 2, NULL), // (try $try_outer // (do // (try // (do - // (throw $a-event (i32.const 0)) + // (throw $a-tag (i32.const 0)) // ) // (delegate $try_outer) // ) @@ -846,12 +845,12 @@ void test_core() { BinaryenTry(module, NULL, tryBody, - emptyCatchEvents, + emptyCatchTags, 0, emptyCatchBodies, 0, "try_outer"), - emptyCatchEvents, + emptyCatchTags, 0, nopCatchBody, 1, diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index eb83ffb33..77c433472 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -45,7 +45,7 @@ BinaryenFeatureAll: 16383 (table $0 1 1 funcref) (elem $0 (table $0) (i32.const 0) func "$kitchen()sinker") (elem $passive func "$kitchen()sinker") - (event $a-event (attr 0) (param i32)) + (tag $a-tag (attr 0) (param i32)) (export "kitchen_sinker" (func "$kitchen()sinker")) (export "mem" (memory $0)) (start $starter) @@ -1990,11 +1990,11 @@ BinaryenFeatureAll: 16383 ) (try (do - (throw $a-event + (throw $a-tag (i32.const 0) ) ) - (catch $a-event + (catch $a-tag (drop (pop i32) ) @@ -2007,7 +2007,7 @@ BinaryenFeatureAll: 16383 (do (try (do - (throw $a-event + (throw $a-tag (i32.const 0) ) ) diff --git a/test/example/module-splitting.cpp b/test/example/module-splitting.cpp index 9ff2818be..a379717f1 100644 --- a/test/example/module-splitting.cpp +++ b/test/example/module-splitting.cpp @@ -76,7 +76,7 @@ int main() { (memory $mem (shared 3 42)) (table $tab 3 42 funcref) (global $glob (mut i32) (i32.const 7)) - (event $e (attr 0) (param i32)) + (tag $e (attr 0) (param i32)) ))"); // Imported global stuff @@ -85,7 +85,7 @@ int main() { (import "env" "mem" (memory $mem (shared 3 42))) (import "env" "tab" (table $tab 3 42 funcref)) (import "env" "glob" (global $glob (mut i32))) - (import "env" "e" (event $e (attr 0) (param i32))) + (import "env" "e" (tag $e (attr 0) (param i32))) ))"); // Exported global stuff @@ -94,11 +94,11 @@ int main() { (memory $mem (shared 3 42)) (table $tab 3 42 funcref) (global $glob (mut i32) (i32.const 7)) - (event $e (attr 0) (param i32)) + (tag $e (attr 0) (param i32)) (export "mem" (memory $mem)) (export "tab" (table $tab)) (export "glob" (global $glob)) - (export "e" (event $e)) + (export "e" (tag $e)) ))"); // Non-deferred function diff --git a/test/example/module-splitting.txt b/test/example/module-splitting.txt index 2b92e9dd6..61529e9ad 100644 --- a/test/example/module-splitting.txt +++ b/test/example/module-splitting.txt @@ -16,7 +16,7 @@ Before: (global $glob (mut i32) (i32.const 7)) (memory $mem (shared 3 42)) (table $tab 3 42 funcref) - (event $e (attr 0) (param i32)) + (tag $e (attr 0) (param i32)) ) Keeping: <none> After: @@ -25,11 +25,11 @@ After: (global $glob (mut i32) (i32.const 7)) (memory $mem (shared 3 42)) (table $tab 3 42 funcref) - (event $e (attr 0) (param i32)) + (tag $e (attr 0) (param i32)) (export "%memory" (memory $mem)) (export "%table" (table $tab)) (export "%global" (global $glob)) - (export "%event" (event $e)) + (export "%tag" (tag $e)) ) Secondary: (module @@ -37,7 +37,7 @@ Secondary: (import "primary" "%memory" (memory $mem (shared 3 42))) (import "primary" "%table" (table $tab 3 42 funcref)) (import "primary" "%global" (global $glob (mut i32))) - (import "primary" "%event" (event $e (attr 0) (param i32))) + (import "primary" "%tag" (tag $e (attr 0) (param i32))) ) @@ -47,7 +47,7 @@ Before: (import "env" "mem" (memory $mem (shared 3 42))) (import "env" "tab" (table $tab 3 42 funcref)) (import "env" "glob" (global $glob (mut i32))) - (import "env" "e" (event $e (attr 0) (param i32))) + (import "env" "e" (tag $e (attr 0) (param i32))) ) Keeping: <none> After: @@ -56,11 +56,11 @@ After: (import "env" "mem" (memory $mem (shared 3 42))) (import "env" "tab" (table $tab 3 42 funcref)) (import "env" "glob" (global $glob (mut i32))) - (import "env" "e" (event $e (attr 0) (param i32))) + (import "env" "e" (tag $e (attr 0) (param i32))) (export "%memory" (memory $mem)) (export "%table" (table $tab)) (export "%global" (global $glob)) - (export "%event" (event $e)) + (export "%tag" (tag $e)) ) Secondary: (module @@ -68,7 +68,7 @@ Secondary: (import "primary" "%memory" (memory $mem (shared 3 42))) (import "primary" "%table" (table $tab 3 42 funcref)) (import "primary" "%global" (global $glob (mut i32))) - (import "primary" "%event" (event $e (attr 0) (param i32))) + (import "primary" "%tag" (tag $e (attr 0) (param i32))) ) @@ -78,11 +78,11 @@ Before: (global $glob (mut i32) (i32.const 7)) (memory $mem (shared 3 42)) (table $tab 3 42 funcref) - (event $e (attr 0) (param i32)) + (tag $e (attr 0) (param i32)) (export "mem" (memory $mem)) (export "tab" (table $tab)) (export "glob" (global $glob)) - (export "e" (event $e)) + (export "e" (tag $e)) ) Keeping: <none> After: @@ -91,11 +91,11 @@ After: (global $glob (mut i32) (i32.const 7)) (memory $mem (shared 3 42)) (table $tab 3 42 funcref) - (event $e (attr 0) (param i32)) + (tag $e (attr 0) (param i32)) (export "mem" (memory $mem)) (export "tab" (table $tab)) (export "glob" (global $glob)) - (export "e" (event $e)) + (export "e" (tag $e)) ) Secondary: (module @@ -103,7 +103,7 @@ Secondary: (import "primary" "mem" (memory $mem (shared 3 42))) (import "primary" "tab" (table $tab 3 42 funcref)) (import "primary" "glob" (global $glob (mut i32))) - (import "primary" "e" (event $e (attr 0) (param i32))) + (import "primary" "e" (tag $e (attr 0) (param i32))) ) diff --git a/test/exception-handling.wast b/test/exception-handling.wast index ee5ffbf54..95f177b2d 100644 --- a/test/exception-handling.wast +++ b/test/exception-handling.wast @@ -1,8 +1,8 @@ (module - (event $e-i32 (attr 0) (param i32)) - (event $e-i64 (attr 0) (param i64)) - (event $e-i32-i64 (attr 0) (param i32 i64)) - (event $e-empty (attr 0)) + (tag $e-i32 (attr 0) (param i32)) + (tag $e-i64 (attr 0) (param i64)) + (tag $e-i32-i64 (attr 0) (param i32 i64)) + (tag $e-empty (attr 0)) (func $foo) (func $bar) @@ -18,7 +18,7 @@ ) ) - ;; try-catch with multivalue event + ;; try-catch with multivalue tag (try (do (throw $e-i32-i64 (i32.const 0) (i64.const 0)) @@ -197,7 +197,7 @@ (delegate 0) ) - ;; 'catch' body can be empty when the event's type is none. + ;; 'catch' body can be empty when the tag's type is none. (try (do) (catch $e-empty) diff --git a/test/exception-handling.wast.from-wast b/test/exception-handling.wast.from-wast index 68034653f..429127a6a 100644 --- a/test/exception-handling.wast.from-wast +++ b/test/exception-handling.wast.from-wast @@ -3,10 +3,10 @@ (type $i32_=>_none (func (param i32))) (type $i64_=>_none (func (param i64))) (type $i32_i64_=>_none (func (param i32 i64))) - (event $e-i32 (attr 0) (param i32)) - (event $e-i64 (attr 0) (param i64)) - (event $e-i32-i64 (attr 0) (param i32 i64)) - (event $e-empty (attr 0) (param)) + (tag $e-i32 (attr 0) (param i32)) + (tag $e-i64 (attr 0) (param i64)) + (tag $e-i32-i64 (attr 0) (param i32 i64)) + (tag $e-empty (attr 0) (param)) (func $foo (nop) ) diff --git a/test/exception-handling.wast.fromBinary b/test/exception-handling.wast.fromBinary index ff9a71f28..e50d18f3a 100644 --- a/test/exception-handling.wast.fromBinary +++ b/test/exception-handling.wast.fromBinary @@ -3,10 +3,10 @@ (type $i32_=>_none (func (param i32))) (type $i64_=>_none (func (param i64))) (type $i32_i64_=>_none (func (param i32 i64))) - (event $event$0 (attr 0) (param i32)) - (event $event$1 (attr 0) (param i64)) - (event $event$2 (attr 0) (param i32 i64)) - (event $event$3 (attr 0) (param)) + (tag $tag$0 (attr 0) (param i32)) + (tag $tag$1 (attr 0) (param i64)) + (tag $tag$2 (attr 0) (param i32 i64)) + (tag $tag$3 (attr 0) (param)) (func $foo (nop) ) @@ -21,11 +21,11 @@ (local $4 i32) (try $label$3 (do - (throw $event$0 + (throw $tag$0 (i32.const 0) ) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -33,12 +33,12 @@ ) (try $label$6 (do - (throw $event$2 + (throw $tag$2 (i32.const 0) (i64.const 0) ) ) - (catch $event$2 + (catch $tag$2 (local.set $2 (pop i32 i64) ) @@ -75,7 +75,7 @@ (do (br $label$7) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -87,7 +87,7 @@ (do (nop) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -98,7 +98,7 @@ (call $foo) (call $bar) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -108,16 +108,16 @@ ) (try $label$19 (do - (throw $event$0 + (throw $tag$0 (i32.const 0) ) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) ) - (catch $event$1 + (catch $tag$1 (drop (pop i64) ) @@ -125,7 +125,7 @@ ) (try $label$22 (do - (throw $event$0 + (throw $tag$0 (i32.const 0) ) ) @@ -135,16 +135,16 @@ ) (try $label$25 (do - (throw $event$0 + (throw $tag$0 (i32.const 0) ) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) ) - (catch $event$1 + (catch $tag$1 (drop (pop i64) ) @@ -158,11 +158,11 @@ (do (try $label$29 (do - (throw $event$0 + (throw $tag$0 (i32.const 0) ) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -172,7 +172,7 @@ ) ) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -180,11 +180,11 @@ (catch_all (try $label$33 (do - (throw $event$0 + (throw $tag$0 (i32.const 0) ) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -197,7 +197,7 @@ ) (try (do - (throw $event$0 + (throw $tag$0 (i32.const 0) ) ) @@ -269,7 +269,7 @@ (do (nop) ) - (catch $event$3 + (catch $tag$3 (nop) ) ) @@ -279,7 +279,7 @@ (do (call $foo) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -294,7 +294,7 @@ (do (call $foo) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -314,7 +314,7 @@ (do (call $foo) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -335,7 +335,7 @@ (do (call $foo) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) diff --git a/test/exception-handling.wast.fromBinary.noDebugInfo b/test/exception-handling.wast.fromBinary.noDebugInfo index 5a0e3331b..c748ca024 100644 --- a/test/exception-handling.wast.fromBinary.noDebugInfo +++ b/test/exception-handling.wast.fromBinary.noDebugInfo @@ -3,10 +3,10 @@ (type $i32_=>_none (func (param i32))) (type $i64_=>_none (func (param i64))) (type $i32_i64_=>_none (func (param i32 i64))) - (event $event$0 (attr 0) (param i32)) - (event $event$1 (attr 0) (param i64)) - (event $event$2 (attr 0) (param i32 i64)) - (event $event$3 (attr 0) (param)) + (tag $tag$0 (attr 0) (param i32)) + (tag $tag$1 (attr 0) (param i64)) + (tag $tag$2 (attr 0) (param i32 i64)) + (tag $tag$3 (attr 0) (param)) (func $0 (nop) ) @@ -21,11 +21,11 @@ (local $4 i32) (try $label$3 (do - (throw $event$0 + (throw $tag$0 (i32.const 0) ) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -33,12 +33,12 @@ ) (try $label$6 (do - (throw $event$2 + (throw $tag$2 (i32.const 0) (i64.const 0) ) ) - (catch $event$2 + (catch $tag$2 (local.set $2 (pop i32 i64) ) @@ -75,7 +75,7 @@ (do (br $label$7) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -87,7 +87,7 @@ (do (nop) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -98,7 +98,7 @@ (call $0) (call $1) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -108,16 +108,16 @@ ) (try $label$19 (do - (throw $event$0 + (throw $tag$0 (i32.const 0) ) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) ) - (catch $event$1 + (catch $tag$1 (drop (pop i64) ) @@ -125,7 +125,7 @@ ) (try $label$22 (do - (throw $event$0 + (throw $tag$0 (i32.const 0) ) ) @@ -135,16 +135,16 @@ ) (try $label$25 (do - (throw $event$0 + (throw $tag$0 (i32.const 0) ) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) ) - (catch $event$1 + (catch $tag$1 (drop (pop i64) ) @@ -158,11 +158,11 @@ (do (try $label$29 (do - (throw $event$0 + (throw $tag$0 (i32.const 0) ) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -172,7 +172,7 @@ ) ) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -180,11 +180,11 @@ (catch_all (try $label$33 (do - (throw $event$0 + (throw $tag$0 (i32.const 0) ) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -197,7 +197,7 @@ ) (try (do - (throw $event$0 + (throw $tag$0 (i32.const 0) ) ) @@ -269,7 +269,7 @@ (do (nop) ) - (catch $event$3 + (catch $tag$3 (nop) ) ) @@ -279,7 +279,7 @@ (do (call $0) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -294,7 +294,7 @@ (do (call $0) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -314,7 +314,7 @@ (do (call $0) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -335,7 +335,7 @@ (do (call $0) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) diff --git a/test/lit/passes/coalesce-locals-eh.wast b/test/lit/passes/coalesce-locals-eh.wast index f564c2991..f13ba5550 100644 --- a/test/lit/passes/coalesce-locals-eh.wast +++ b/test/lit/passes/coalesce-locals-eh.wast @@ -9,7 +9,7 @@ (i32.const 1984) ) - (event $e (attr 0)) + (tag $e (attr 0)) ;; CHECK: (func $bug-cfg-traversal (param $0 i32) (result i32) ;; CHECK-NEXT: (try $try ;; CHECK-NEXT: (do diff --git a/test/lit/passes/code-folding-eh.wast b/test/lit/passes/code-folding-eh.wast index 6a1a1eb36..e810e5c01 100644 --- a/test/lit/passes/code-folding-eh.wast +++ b/test/lit/passes/code-folding-eh.wast @@ -3,7 +3,7 @@ ;; RUN: | filecheck %s (module - (event $e-i32 (attr 0) (param i32)) + (tag $e-i32 (attr 0) (param i32)) ;; CHECK: (func $pop-test ;; CHECK-NEXT: (block $folding-inner0 diff --git a/test/lit/passes/code-pushing-eh.wast b/test/lit/passes/code-pushing-eh.wast index fe406ec2b..37ca0cc5a 100644 --- a/test/lit/passes/code-pushing-eh.wast +++ b/test/lit/passes/code-pushing-eh.wast @@ -2,7 +2,7 @@ ;; RUN: wasm-opt %s --code-pushing -all -S -o - | filecheck %s (module - (event $e (attr 0) (param i32)) + (tag $e (attr 0) (param i32)) ;; CHECK: (func $cant-push-past-call ;; CHECK-NEXT: (local $x i32) diff --git a/test/lit/passes/dce-eh.wast b/test/lit/passes/dce-eh.wast index 1bb6358dd..d29056c41 100644 --- a/test/lit/passes/dce-eh.wast +++ b/test/lit/passes/dce-eh.wast @@ -5,7 +5,7 @@ ;; reachable (module (func $foo) - (event $e (attr 0)) + (tag $e (attr 0)) ;; CHECK: (func $try_unreachable ;; CHECK-NEXT: (try $try diff --git a/test/lit/passes/inlining-eh.wast b/test/lit/passes/inlining-eh.wast index 9879978e1..6b648d380 100644 --- a/test/lit/passes/inlining-eh.wast +++ b/test/lit/passes/inlining-eh.wast @@ -4,11 +4,11 @@ (module ;; --------------------------------------------------------------------------- (import "a" "b" (func $foo (result i32))) - (event $event$0 (attr 0) (param i32)) + (tag $tag$0 (attr 0) (param i32)) (func $callee-with-label (try $label (do) - (catch $event$0 + (catch $tag$0 (nop) ) ) @@ -24,7 +24,7 @@ ;; CHECK-NEXT: (do ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (catch $event$0 + ;; CHECK-NEXT: (catch $tag$0 ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/instrument-locals-eh.wast b/test/lit/passes/instrument-locals-eh.wast index 99ba94583..88b4d5526 100644 --- a/test/lit/passes/instrument-locals-eh.wast +++ b/test/lit/passes/instrument-locals-eh.wast @@ -2,7 +2,7 @@ ;; RUN: wasm-opt %s --instrument-locals -all -S -o - | filecheck %s (module - (event $e (attr 0) (param i32)) + (tag $e (attr 0) (param i32)) ;; CHECK: (func $test ;; CHECK-NEXT: (local $x i32) diff --git a/test/lit/passes/optimize-instructions-eh.wast b/test/lit/passes/optimize-instructions-eh.wast index 50ae665e2..23c8f9fa5 100644 --- a/test/lit/passes/optimize-instructions-eh.wast +++ b/test/lit/passes/optimize-instructions-eh.wast @@ -4,7 +4,7 @@ (module (func $dummy) - (event $e (attr 0) (param i32)) + (tag $e (attr 0) (param i32)) ;; The following are the unit tests for Properties::getFallthrough for EH ;; instructions, which are used in one of binary optimizations in diff --git a/test/lit/passes/poppify.wast b/test/lit/passes/poppify.wast index bc88dd878..69e6fc17e 100644 --- a/test/lit/passes/poppify.wast +++ b/test/lit/passes/poppify.wast @@ -3,7 +3,7 @@ ;; RUN: wasm-opt %s --poppify --no-validation -all -S -o - | filecheck %s (module - (event $e (attr 0) (param i32)) + (tag $e (attr 0) (param i32)) ;; CHECK: (func $id (param $x i32) (result i32) ;; CHECK-NEXT: (local.get $x) diff --git a/test/lit/passes/remove-unused-module-elements-eh.wast b/test/lit/passes/remove-unused-module-elements-eh.wast index 7e0c66af4..2a6a3b6b9 100644 --- a/test/lit/passes/remove-unused-module-elements-eh.wast +++ b/test/lit/passes/remove-unused-module-elements-eh.wast @@ -1,20 +1,20 @@ ;; RUN: wasm-opt %s --remove-unused-module-elements -all -S -o - | filecheck %s -;; Non-exported and unused events can be removed +;; Non-exported and unused tags can be removed (module (type $0 (func (param i32))) - ;; CHECK-NOT: (event $e-remove - ;; CHECK: (event $e-export - ;; CHECK: (event $e-throw - ;; CHECK: (event $e-catch - (event $e-remove (attr 0) (type $0)) ;; can be removed - (event $e-export (attr 0) (param i64)) ;; cannot be removed (exported) - (event $e-throw (attr 0) (type $0)) ;; cannot be removed (used in throw) - (event $e-catch (attr 0) (type $0)) ;; cannot be removed (used in catch) + ;; CHECK-NOT: (tag $e-remove + ;; CHECK: (tag $e-export + ;; CHECK: (tag $e-throw + ;; CHECK: (tag $e-catch + (tag $e-remove (attr 0) (type $0)) ;; can be removed + (tag $e-export (attr 0) (param i64)) ;; cannot be removed (exported) + (tag $e-throw (attr 0) (type $0)) ;; cannot be removed (used in throw) + (tag $e-catch (attr 0) (type $0)) ;; cannot be removed (used in catch) - (export "e-export" (event $e-export)) - (import "env" "e" (event $e-import (attr 0) (param i32))) + (export "e-export" (tag $e-export)) + (import "env" "e" (tag $e-import (attr 0) (param i32))) (start $start) (func $start diff --git a/test/lit/passes/remove-unused-names-eh.wast b/test/lit/passes/remove-unused-names-eh.wast index fd20c07e4..3244bd375 100644 --- a/test/lit/passes/remove-unused-names-eh.wast +++ b/test/lit/passes/remove-unused-names-eh.wast @@ -2,14 +2,14 @@ ;; RUN: wasm-opt %s --remove-unused-names -all -S -o - | filecheck %s (module - (event $event$0 (attr 0) (param i32)) + (tag $tag$0 (attr 0) (param i32)) ;; CHECK: (func $func0 ;; CHECK-NEXT: (try $label$9 ;; CHECK-NEXT: (do ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (catch $event$0 + ;; CHECK-NEXT: (catch $tag$0 ;; CHECK-NEXT: (try $label$8 ;; CHECK-NEXT: (do ;; CHECK-NEXT: (try @@ -19,7 +19,7 @@ ;; CHECK-NEXT: (delegate $label$8) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (catch $event$0 + ;; CHECK-NEXT: (catch $tag$0 ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (pop i32) ;; CHECK-NEXT: ) @@ -31,7 +31,7 @@ (func $func0 (try $label$9 ;; needed due to a rethrow (do) - (catch $event$0 + (catch $tag$0 (try $label$8 ;; needed due to a delegate (do (try $label$6 ;; this one is not needed @@ -41,7 +41,7 @@ (delegate $label$8) ) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) diff --git a/test/lit/passes/rse-eh.wast b/test/lit/passes/rse-eh.wast index d6f7074e7..f71c4886d 100644 --- a/test/lit/passes/rse-eh.wast +++ b/test/lit/passes/rse-eh.wast @@ -2,8 +2,8 @@ ;; RUN: wasm-opt %s --rse -all -S -o - | filecheck %s (module - (event $e (attr 0) (param i32)) - (event $e2 (attr 0)) + (tag $e (attr 0) (param i32)) + (tag $e2 (attr 0)) ;; CHECK: (func $try1 ;; CHECK-NEXT: (local $x i32) diff --git a/test/lit/passes/simplify-locals-eh.wast b/test/lit/passes/simplify-locals-eh.wast index fb5f671f3..9a7a94cf7 100644 --- a/test/lit/passes/simplify-locals-eh.wast +++ b/test/lit/passes/simplify-locals-eh.wast @@ -2,7 +2,7 @@ ;; RUN: wasm-opt %s --simplify-locals -all -S -o - | filecheck %s (module - (event $e-i32 (attr 0) (param i32)) + (tag $e-i32 (attr 0) (param i32)) ;; CHECK: (func $foo (param $0 i32) (param $1 i32) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/stack-ir-eh.wast b/test/lit/passes/stack-ir-eh.wast index a398be325..86ada5059 100644 --- a/test/lit/passes/stack-ir-eh.wast +++ b/test/lit/passes/stack-ir-eh.wast @@ -2,7 +2,7 @@ ;; RUN: -all -S -o - | filecheck %s (module - (event $e0 (attr 0) (param i32)) + (tag $e0 (attr 0) (param i32)) ;; CHECK: (func $eh ;; CHECK-NEXT: try $l0 diff --git a/test/lit/passes/stack-ir-roundtrip-eh.wast b/test/lit/passes/stack-ir-roundtrip-eh.wast index b9bb22d3e..cbc81f294 100644 --- a/test/lit/passes/stack-ir-roundtrip-eh.wast +++ b/test/lit/passes/stack-ir-roundtrip-eh.wast @@ -2,7 +2,7 @@ ;; RUN: wasm-opt %s --generate-stack-ir --roundtrip -all -S -o - | filecheck %s (module - (event $event (attr 0) (param i32)) + (tag $tag (attr 0) (param i32)) ;; CHECK: (func $delegate-child ;; CHECK-NEXT: (try $label$9 ;; CHECK-NEXT: (do @@ -10,7 +10,7 @@ ;; CHECK-NEXT: (do ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (catch $event$0 + ;; CHECK-NEXT: (catch $tag$0 ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (pop i32) ;; CHECK-NEXT: ) @@ -23,7 +23,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (catch $event$0 + ;; CHECK-NEXT: (catch $tag$0 ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (pop i32) ;; CHECK-NEXT: ) @@ -35,7 +35,7 @@ (do (try (do) - (catch $event + (catch $tag (drop (pop i32) ) @@ -51,7 +51,7 @@ ) ) ) - (catch $event + (catch $tag (drop (pop i32) ) diff --git a/test/lit/passes/vacuum-eh.wast b/test/lit/passes/vacuum-eh.wast index d69278319..705f423f0 100644 --- a/test/lit/passes/vacuum-eh.wast +++ b/test/lit/passes/vacuum-eh.wast @@ -2,8 +2,8 @@ ;; RUN: wasm-opt %s --vacuum -all -S -o - | filecheck %s (module - (event $e (attr 0) (param i32)) - (event $e2 (attr 0) (param i32)) + (tag $e (attr 0) (param i32)) + (tag $e2 (attr 0) (param i32)) ;; CHECK: (func $try-test ;; CHECK-NEXT: (nop) diff --git a/test/metadce/rooted-export.wast b/test/metadce/rooted-export.wast index 4b93969b4..790ce802f 100644 --- a/test/metadce/rooted-export.wast +++ b/test/metadce/rooted-export.wast @@ -9,10 +9,10 @@ (unreachable) ) - (export "wasm_event_a" (event $a_wasm_event)) - (export "wasm_event_b" (event $b_wasm_event)) + (export "wasm_tag_a" (tag $a_wasm_tag)) + (export "wasm_tag_b" (tag $b_wasm_tag)) - (event $a_wasm_event (attr 0) (param i32)) - (event $b_wasm_event (attr 0) (param i32)) + (tag $a_wasm_tag (attr 0) (param i32)) + (tag $b_wasm_tag (attr 0) (param i32)) ) diff --git a/test/metadce/rooted-export.wast.dced b/test/metadce/rooted-export.wast.dced index ba0390928..dd9913ab2 100644 --- a/test/metadce/rooted-export.wast.dced +++ b/test/metadce/rooted-export.wast.dced @@ -1,9 +1,9 @@ (module (type $i32_=>_none (func (param i32))) (type $none_=>_none (func)) - (event $b_wasm_event (attr 0) (param i32)) + (tag $b_wasm_tag (attr 0) (param i32)) (export "wasm_func_b" (func $b_wasm_func)) - (export "wasm_event_b" (event $b_wasm_event)) + (export "wasm_tag_b" (tag $b_wasm_tag)) (func $b_wasm_func (unreachable) ) diff --git a/test/metadce/rooted-export.wast.dced.stdout b/test/metadce/rooted-export.wast.dced.stdout index 5b6a25c02..583f248d6 100644 --- a/test/metadce/rooted-export.wast.dced.stdout +++ b/test/metadce/rooted-export.wast.dced.stdout @@ -1,4 +1,4 @@ -unused: event$a_wasm_event$2 -unused: export$wasm_event_a$5 unused: export$wasm_func_a$4 +unused: export$wasm_tag_a$5 unused: func$a_wasm_func$0 +unused: tag$a_wasm_tag$2 diff --git a/test/metadce/rooted-export.wast.graph.txt b/test/metadce/rooted-export.wast.graph.txt index 8ecd66dc0..0137d34f1 100644 --- a/test/metadce/rooted-export.wast.graph.txt +++ b/test/metadce/rooted-export.wast.graph.txt @@ -5,9 +5,9 @@ "export": "wasm_func_b" }, { - "name": "rooted-export-event", + "name": "rooted-export-tag", "root": true, - "export": "wasm_event_b" + "export": "wasm_tag_b" } ] diff --git a/test/passes/O3_low-memory-unused_metrics.txt b/test/passes/O3_low-memory-unused_metrics.txt index 6e937ea11..3de2d66fe 100644 --- a/test/passes/O3_low-memory-unused_metrics.txt +++ b/test/passes/O3_low-memory-unused_metrics.txt @@ -1,5 +1,4 @@ total - [events] : 0 [exports] : 1 [funcs] : 1 [globals] : 0 @@ -7,6 +6,7 @@ total [memory-data] : 0 [table-data] : 0 [tables] : 0 + [tags] : 0 [total] : 1964 [vars] : 9 Binary : 240 diff --git a/test/passes/converge_O3_metrics.bin.txt b/test/passes/converge_O3_metrics.bin.txt index 1441d577a..5c41b3146 100644 --- a/test/passes/converge_O3_metrics.bin.txt +++ b/test/passes/converge_O3_metrics.bin.txt @@ -1,5 +1,4 @@ total - [events] : 0 [exports] : 2 [funcs] : 6 [globals] : 1 @@ -7,6 +6,7 @@ total [memory-data] : 28 [table-data] : 429 [tables] : 0 + [tags] : 0 [total] : 553 [vars] : 2 Binary : 12 @@ -229,7 +229,6 @@ total ) ) total - [events] : 0 [exports] : 2 [funcs] : 6 [globals] : 0 -1 @@ -237,6 +236,7 @@ total [memory-data] : 28 [table-data] : 429 [tables] : 0 + [tags] : 0 [total] : 549 -4 [vars] : 2 Binary : 12 @@ -452,7 +452,6 @@ total ) ) total - [events] : 0 [exports] : 2 [funcs] : 6 [globals] : 0 @@ -460,6 +459,7 @@ total [memory-data] : 28 [table-data] : 429 [tables] : 0 + [tags] : 0 [total] : 549 [vars] : 2 Binary : 12 diff --git a/test/passes/dwarf_with_exceptions.bin.txt b/test/passes/dwarf_with_exceptions.bin.txt index a08ecf9e5..ebd6be03d 100644 --- a/test/passes/dwarf_with_exceptions.bin.txt +++ b/test/passes/dwarf_with_exceptions.bin.txt @@ -8,7 +8,7 @@ (import "env" "_ZSt9terminatev" (func $std::terminate\28\29)) (global $__stack_pointer (mut i32) (i32.const 66560)) (memory $0 2) - (event $event$0 (attr 0) (param i32)) + (tag $tag$0 (attr 0) (param i32)) (export "memory" (memory $0)) (func $__wasm_call_ctors ) @@ -27,7 +27,7 @@ (call $foo\28\29) ) ;; code offset: 0x18 - (catch $event$0 + (catch $tag$0 ;; code offset: 0x1e (local.set $1 (pop i32) @@ -65,7 +65,7 @@ (call $__cxa_end_catch) ) ;; code offset: 0x4a - (catch $event$0 + (catch $tag$0 ;; code offset: 0x50 (local.set $1 (pop i32) @@ -429,7 +429,7 @@ file_names[ 1]: (import "env" "_ZSt9terminatev" (func $std::terminate\28\29)) (global $__stack_pointer (mut i32) (i32.const 66560)) (memory $0 2) - (event $event$0 (attr 0) (param i32)) + (tag $tag$0 (attr 0) (param i32)) (export "memory" (memory $0)) (func $__wasm_call_ctors ) @@ -448,7 +448,7 @@ file_names[ 1]: (call $foo\28\29) ) ;; code offset: 0x12 - (catch $event$0 + (catch $tag$0 ;; code offset: 0x14 (local.set $1 (pop i32) @@ -486,7 +486,7 @@ file_names[ 1]: (call $__cxa_end_catch) ) ;; code offset: 0x2c - (catch $event$0 + (catch $tag$0 ;; code offset: 0x2e (local.set $1 (pop i32) diff --git a/test/passes/func-metrics.txt b/test/passes/func-metrics.txt index 7782599e7..a8b6885c4 100644 --- a/test/passes/func-metrics.txt +++ b/test/passes/func-metrics.txt @@ -1,5 +1,4 @@ global - [events] : 0 [exports] : 0 [funcs] : 3 [globals] : 1 @@ -7,6 +6,7 @@ global [memory-data] : 9 [table-data] : 3 [tables] : 1 + [tags] : 0 [total] : 6 Const : 3 RefFunc : 3 @@ -92,22 +92,22 @@ func: ifs ) ) global - [events] : 0 [exports] : 0 [funcs] : 0 [globals] : 0 [imports] : 0 [tables] : 0 + [tags] : 0 [total] : 0 (module ) global - [events] : 0 [exports] : 2 [funcs] : 3 [globals] : 0 [imports] : 1 [tables] : 0 + [tags] : 0 [total] : 0 func: func_a [binary-bytes] : 16 @@ -178,12 +178,12 @@ export: b (func_b) ) ) global - [events] : 0 [exports] : 1 [funcs] : 1 [globals] : 0 [imports] : 1 [tables] : 0 + [tags] : 0 [total] : 0 func: func_a [binary-bytes] : 12 @@ -211,12 +211,12 @@ start: func_a ) ) global - [events] : 0 [exports] : 0 [funcs] : 1 [globals] : 0 [imports] : 1 [tables] : 0 + [tags] : 0 [total] : 0 func: func_a [binary-bytes] : 12 @@ -240,12 +240,12 @@ start: func_a ) ) global - [events] : 0 [exports] : 1 [funcs] : 1 [globals] : 1 [imports] : 1 [tables] : 0 + [tags] : 0 [total] : 1 GlobalGet : 1 func: 0 diff --git a/test/passes/fuzz_metrics_noprint.bin.txt b/test/passes/fuzz_metrics_noprint.bin.txt index 5e0a25330..2b5dad46a 100644 --- a/test/passes/fuzz_metrics_noprint.bin.txt +++ b/test/passes/fuzz_metrics_noprint.bin.txt @@ -1,5 +1,4 @@ total - [events] : 0 [exports] : 57 [funcs] : 82 [globals] : 7 @@ -7,6 +6,7 @@ total [memory-data] : 4 [table-data] : 17 [tables] : 1 + [tags] : 0 [total] : 3244 [vars] : 178 Binary : 261 diff --git a/test/passes/metrics_all-features.txt b/test/passes/metrics_all-features.txt index 7462e768c..d58bd54f9 100644 --- a/test/passes/metrics_all-features.txt +++ b/test/passes/metrics_all-features.txt @@ -1,5 +1,4 @@ total - [events] : 2 [exports] : 0 [funcs] : 1 [globals] : 1 @@ -7,6 +6,7 @@ total [memory-data] : 9 [table-data] : 3 [tables] : 1 + [tags] : 2 [total] : 30 [vars] : 1 Binary : 1 @@ -23,8 +23,8 @@ total (data (i32.const 0) "\ff\ef\0f\1f 0@P\99") (table $0 256 256 funcref) (elem (i32.const 0) $ifs $ifs $ifs) - (event $e0 (attr 0) (param i32)) - (event $e1 (attr 0) (param i32 i32)) + (tag $e0 (attr 0) (param i32)) + (tag $e1 (attr 0) (param i32 i32)) (func $ifs (param $x i32) (local $y f32) (block $block0 @@ -66,12 +66,12 @@ total ) ) total - [events] : 0 [exports] : 0 [funcs] : 0 [globals] : 0 [imports] : 0 [tables] : 0 + [tags] : 0 [total] : 0 [vars] : 0 (module diff --git a/test/passes/metrics_all-features.wast b/test/passes/metrics_all-features.wast index 018262f22..c5894fd67 100644 --- a/test/passes/metrics_all-features.wast +++ b/test/passes/metrics_all-features.wast @@ -5,8 +5,8 @@ (data (i32.const 0) "\ff\ef\0f\1f\20\30\40\50\99") (type $0 (func (param i32))) (global $glob i32 (i32.const 1337)) - (event $e0 (attr 0) (param i32)) - (event $e1 (attr 0) (param i32 i32)) + (tag $e0 (attr 0) (param i32)) + (tag $e1 (attr 0) (param i32 i32)) (func $ifs (type $0) (param $x i32) (local $y f32) (block $block0 diff --git a/test/passes/metrics_strip-debug_metrics.bin.txt b/test/passes/metrics_strip-debug_metrics.bin.txt index 5df5c0772..9760353e0 100644 --- a/test/passes/metrics_strip-debug_metrics.bin.txt +++ b/test/passes/metrics_strip-debug_metrics.bin.txt @@ -1,20 +1,20 @@ total - [events] : 0 [exports] : 1 [funcs] : 1 [globals] : 0 [imports] : 0 [tables] : 0 + [tags] : 0 [total] : 1 [vars] : 0 Nop : 1 total - [events] : 0 [exports] : 1 [funcs] : 1 [globals] : 0 [imports] : 0 [tables] : 0 + [tags] : 0 [total] : 1 [vars] : 0 Nop : 1 diff --git a/test/passes/metrics_strip-producers_metrics.bin.txt b/test/passes/metrics_strip-producers_metrics.bin.txt index a7ae38f9a..072f7c827 100644 --- a/test/passes/metrics_strip-producers_metrics.bin.txt +++ b/test/passes/metrics_strip-producers_metrics.bin.txt @@ -1,20 +1,20 @@ total - [events] : 0 [exports] : 1 [funcs] : 1 [globals] : 0 [imports] : 0 [tables] : 0 + [tags] : 0 [total] : 1 [vars] : 0 Nop : 1 total - [events] : 0 [exports] : 1 [funcs] : 1 [globals] : 0 [imports] : 0 [tables] : 0 + [tags] : 0 [total] : 1 [vars] : 0 Nop : 1 diff --git a/test/passes/minify-imports-and-exports_all-features.txt b/test/passes/minify-imports-and-exports_all-features.txt index e5b99a84a..8336e47c6 100644 --- a/test/passes/minify-imports-and-exports_all-features.txt +++ b/test/passes/minify-imports-and-exports_all-features.txt @@ -1221,7 +1221,7 @@ longname3489 => M9 longname1491 => MA longname4947 => MAa longname1545 => MB -eventname1 => MBa +tagname1 => MBa longname1599 => MC longname1653 => MD longname1707 => ME @@ -1500,7 +1500,7 @@ longname3492 => P9 longname1494 => PA longname4950 => PAa longname1548 => PB -event1 => PBa +tag1 => PBa longname1602 => PC longname1656 => PD longname1710 => PE @@ -10014,11 +10014,11 @@ longname4880 => zza (import "other" "anything" (func $internalInfinity)) (import "wasi_unstable" "f" (func $internal3_wasi)) (import "wasi_unstable" "LBa" (func $internal3_wasi_only)) - (import "env" "MBa" (event $eventname1 (attr 0) (param i32))) - (event $event1 (attr 0) (param i32 i32)) + (import "env" "MBa" (tag $tagname1 (attr 0) (param i32))) + (tag $tag1 (attr 0) (param i32 i32)) (export "NBa" (func $foo1)) (export "OBa" (func $foo2)) - (export "PBa" (event $event1)) + (export "PBa" (tag $tag1)) (func $foo1 (nop) ) diff --git a/test/passes/minify-imports-and-exports_all-features.wast b/test/passes/minify-imports-and-exports_all-features.wast index 19fdc4d02..169bb881d 100644 --- a/test/passes/minify-imports-and-exports_all-features.wast +++ b/test/passes/minify-imports-and-exports_all-features.wast @@ -5002,13 +5002,13 @@ (import "env" "__memory_base" (global i32)) (import "env" "__table_base" (global i32)) (import "other" "anything" (func $internalInfinity)) - (import "env" "eventname1" (event $eventname1 (attr 0) (param i32))) + (import "env" "tagname1" (tag $tagname1 (attr 0) (param i32))) (import "wasi_unstable" "longname3" (func $internal3_wasi)) ;; overlapping base (import "wasi_unstable" "longname3-only" (func $internal3_wasi_only)) (export "exp1" (func $foo1)) (export "exp2" (func $foo2)) (func $foo1) (func $foo2) - (export "event1" (event $event1)) - (event $event1 (attr 0) (param i32 i32)) + (export "tag1" (tag $tag1)) + (tag $tag1 (attr 0) (param i32 i32)) ) diff --git a/test/passes/minify-imports_all-features.txt b/test/passes/minify-imports_all-features.txt index 1be765254..529fac5be 100644 --- a/test/passes/minify-imports_all-features.txt +++ b/test/passes/minify-imports_all-features.txt @@ -1128,7 +1128,7 @@ longname3488 => L9 longname1490 => LA longname4946 => LAa longname1544 => LB -eventname1 => LBa +tagname1 => LBa longname1598 => LC longname1652 => LD longname1706 => LE @@ -10008,11 +10008,11 @@ longname4880 => zza (import "env" "JBa" (func $internal4998)) (import "env" "KBa" (func $internal4999)) (import "other" "anything" (func $internalInfinity)) - (import "env" "LBa" (event $eventname1 (attr 0) (param i32))) - (event $event1 (attr 0) (param i32 i32)) + (import "env" "LBa" (tag $tagname1 (attr 0) (param i32))) + (tag $tag1 (attr 0) (param i32 i32)) (export "foo1" (func $foo1)) (export "foo2" (func $foo2)) - (export "event1" (event $event1)) + (export "tag1" (tag $tag1)) (func $foo1 (nop) ) diff --git a/test/passes/minify-imports_all-features.wast b/test/passes/minify-imports_all-features.wast index 26c8062ba..ba16241cf 100644 --- a/test/passes/minify-imports_all-features.wast +++ b/test/passes/minify-imports_all-features.wast @@ -5002,11 +5002,11 @@ (import "env" "__memory_base" (global i32)) (import "env" "__table_base" (global i32)) (import "other" "anything" (func $internalInfinity)) - (import "env" "eventname1" (event $eventname1 (attr 0) (param i32))) + (import "env" "tagname1" (tag $tagname1 (attr 0) (param i32))) (export "foo1" (func $foo1)) (export "foo2" (func $foo2)) - (export "event1" (event $event1)) + (export "tag1" (tag $tag1)) (func $foo1) (func $foo2) - (event $event1 (attr 0) (param i32 i32)) + (tag $tag1 (attr 0) (param i32 i32)) ) diff --git a/test/passes/print_g_metrics.bin.txt b/test/passes/print_g_metrics.bin.txt index 0d8cd8a16..ac035635d 100644 --- a/test/passes/print_g_metrics.bin.txt +++ b/test/passes/print_g_metrics.bin.txt @@ -65,12 +65,12 @@ ) ) total - [events] : 0 [exports] : 3 [funcs] : 3 [globals] : 1 [imports] : 0 [tables] : 0 + [tags] : 0 [total] : 37 [vars] : 0 Binary : 11 diff --git a/test/passes/remove-unused-names_merge-blocks_all-features.txt b/test/passes/remove-unused-names_merge-blocks_all-features.txt index 2c06634d2..206373db6 100644 --- a/test/passes/remove-unused-names_merge-blocks_all-features.txt +++ b/test/passes/remove-unused-names_merge-blocks_all-features.txt @@ -1700,7 +1700,7 @@ (module (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) - (event $e (attr 0) (param i32)) + (tag $e (attr 0) (param i32)) (func $foo (nop) ) diff --git a/test/passes/remove-unused-names_merge-blocks_all-features.wast b/test/passes/remove-unused-names_merge-blocks_all-features.wast index 8e0145900..2e9af253c 100644 --- a/test/passes/remove-unused-names_merge-blocks_all-features.wast +++ b/test/passes/remove-unused-names_merge-blocks_all-features.wast @@ -1558,7 +1558,7 @@ ) (module - (event $e (attr 0) (param i32)) + (tag $e (attr 0) (param i32)) (func $foo) ;; 'nop' within 'block' of `throw' can be hoisted diff --git a/test/passes/remove-unused-nonfunction-module-elements_all-features.txt b/test/passes/remove-unused-nonfunction-module-elements_all-features.txt index d70ce61ce..f124d5c04 100644 --- a/test/passes/remove-unused-nonfunction-module-elements_all-features.txt +++ b/test/passes/remove-unused-nonfunction-module-elements_all-features.txt @@ -332,8 +332,8 @@ (module (type $i64_=>_none (func (param i64))) (type $0 (func (param i32))) - (event $e1 (attr 0) (param i64)) - (export "e1" (event $e1)) + (tag $e1 (attr 0) (param i64)) + (export "e1" (tag $e1)) (func $f (param $0 i32) (nop) ) diff --git a/test/passes/remove-unused-nonfunction-module-elements_all-features.wast b/test/passes/remove-unused-nonfunction-module-elements_all-features.wast index c1003ebb0..346acf432 100644 --- a/test/passes/remove-unused-nonfunction-module-elements_all-features.wast +++ b/test/passes/remove-unused-nonfunction-module-elements_all-features.wast @@ -261,11 +261,11 @@ ) ) ) -(module ;; non-exported events can be removed +(module ;; non-exported tags can be removed (type $0 (func (param i32))) - (event $e0 (attr 0) (type $0)) - (event $e1 (attr 0) (param i64)) - (export "e1" (event $e1)) - (import "env" "e" (event $e2 (attr 0) (param i32))) + (tag $e0 (attr 0) (type $0)) + (tag $e1 (attr 0) (param i64)) + (export "e1" (tag $e1)) + (import "env" "e" (tag $e2 (attr 0) (param i32))) (func $f (; 0 ;) (type $0)) ) diff --git a/test/passes/too_much_for_liveness.bin.txt b/test/passes/too_much_for_liveness.bin.txt index 6a9afb9bd..793f9578c 100644 --- a/test/passes/too_much_for_liveness.bin.txt +++ b/test/passes/too_much_for_liveness.bin.txt @@ -1,10 +1,10 @@ total - [events] : 0 [exports] : 1 [funcs] : 1 [globals] : 0 [imports] : 0 [tables] : 0 + [tags] : 0 [total] : 4 [vars] : 65536 Block : 1 @@ -12,12 +12,12 @@ total LocalGet : 1 LocalSet : 1 total - [events] : 0 [exports] : 1 [funcs] : 1 [globals] : 0 [imports] : 0 [tables] : 0 + [tags] : 0 [total] : 4 [vars] : 65536 Block : 1 diff --git a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt index 2fe8a8a9e..678cd710d 100644 --- a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt +++ b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt @@ -1,5 +1,4 @@ total - [events] : 2 [exports] : 7 [funcs] : 6 [globals] : 6 @@ -7,6 +6,7 @@ total [memory-data] : 22 [table-data] : 0 [tables] : 1 + [tags] : 2 [total] : 764 [vars] : 29 AtomicFence : 2 diff --git a/test/reference-types.wast b/test/reference-types.wast index 28e24b4d7..c8081182f 100644 --- a/test/reference-types.wast +++ b/test/reference-types.wast @@ -35,7 +35,7 @@ (global $global_anyref3 (mut anyref) (ref.null func)) (global $global_anyref4 (mut anyref) (ref.func $foo)) - (event $e-i32 (attr 0) (param i32)) + (tag $e-i32 (attr 0) (param i32)) (func $test (local $local_externref externref) diff --git a/test/reference-types.wast.from-wast b/test/reference-types.wast.from-wast index 6ac855a21..cb9c31088 100644 --- a/test/reference-types.wast.from-wast +++ b/test/reference-types.wast.from-wast @@ -20,7 +20,7 @@ (table $0 3 3 funcref) (elem (i32.const 0) $take_externref $take_funcref $take_anyref) (elem declare func $foo $ref-taken-but-not-in-table) - (event $e-i32 (attr 0) (param i32)) + (tag $e-i32 (attr 0) (param i32)) (export "export_func" (func $import_func)) (export "export_global" (global $import_global)) (func $take_externref (param $0 externref) diff --git a/test/reference-types.wast.fromBinary b/test/reference-types.wast.fromBinary index 00b621f44..57ef2f08b 100644 --- a/test/reference-types.wast.fromBinary +++ b/test/reference-types.wast.fromBinary @@ -20,7 +20,7 @@ (table $0 3 3 funcref) (elem (i32.const 0) $take_externref $take_funcref $take_anyref) (elem declare func $foo $ref-taken-but-not-in-table) - (event $event$0 (attr 0) (param i32)) + (tag $tag$0 (attr 0) (param i32)) (export "export_func" (func $import_func)) (export "export_global" (global $import_global)) (func $take_externref (param $0 externref) @@ -512,7 +512,7 @@ (do (local.get $local_externref) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -525,7 +525,7 @@ (do (ref.func $foo) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -538,7 +538,7 @@ (do (local.get $local_externref) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -551,7 +551,7 @@ (do (ref.func $foo) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) diff --git a/test/reference-types.wast.fromBinary.noDebugInfo b/test/reference-types.wast.fromBinary.noDebugInfo index 71f7e56ef..8162efa65 100644 --- a/test/reference-types.wast.fromBinary.noDebugInfo +++ b/test/reference-types.wast.fromBinary.noDebugInfo @@ -20,7 +20,7 @@ (table $0 3 3 funcref) (elem (i32.const 0) $0 $1 $2) (elem declare func $27 $3) - (event $event$0 (attr 0) (param i32)) + (tag $tag$0 (attr 0) (param i32)) (export "export_func" (func $fimport$0)) (export "export_global" (global $gimport$0)) (func $0 (param $0 externref) @@ -512,7 +512,7 @@ (do (local.get $0) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -525,7 +525,7 @@ (do (ref.func $3) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -538,7 +538,7 @@ (do (local.get $0) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) @@ -551,7 +551,7 @@ (do (ref.func $3) ) - (catch $event$0 + (catch $tag$0 (drop (pop i32) ) diff --git a/test/spec/events.wast b/test/spec/events.wast deleted file mode 100644 index c864a0c87..000000000 --- a/test/spec/events.wast +++ /dev/null @@ -1,33 +0,0 @@ -;; Test events - -(module - (event (attr 0) (param i32)) - (event $e (attr 0) (param i32 f32)) - - (event $e-params0 (attr 0) (param i32 f32)) - (event $e-params1 (attr 0) (param i32) (param f32)) - - (event $e-export (export "ex0") (attr 0) (param i32)) - (event $e-import (import "env" "im0") (attr 0) (param i32)) - - (import "env" "im1" (event (attr 0) (param i32 f32))) - (export "ex1" (event $e)) -) - -(assert_invalid - (module (event $e (attr 0) (param i32) (result i32))) - "Event type's result type should be none" -) - -(assert_invalid - (module (event $e (attr 1) (param i32))) - "Currently only attribute 0 is supported" -) - -(assert_invalid - (module - (type $t (param i32)) - (event $e (attr 0) (type $t) (param i32 f32)) - ) - "type and param don't match" -) diff --git a/test/spec/exception-handling.wast b/test/spec/exception-handling.wast index 21dc98bd4..d09c21806 100644 --- a/test/spec/exception-handling.wast +++ b/test/spec/exception-handling.wast @@ -1,8 +1,8 @@ (module - (event $e-v (attr 0)) - (event $e-i32 (attr 0) (param i32)) - (event $e-f32 (attr 0) (param f32)) - (event $e-i32-f32 (attr 0) (param i32 f32)) + (tag $e-v (attr 0)) + (tag $e-i32 (attr 0) (param i32)) + (tag $e-f32 (attr 0) (param f32)) + (tag $e-i32-f32 (attr 0) (param i32 f32)) (func $throw_single_value (export "throw_single_value") (throw $e-i32 (i32.const 5)) @@ -246,22 +246,22 @@ (assert_invalid (module - (event $e-i32 (attr 0) (param i32)) + (tag $e-i32 (attr 0) (param i32)) (func $f0 (throw $e-i32 (f32.const 0)) ) ) - "event param types must match" + "tag param types must match" ) (assert_invalid (module - (event $e-i32 (attr 0) (param i32 f32)) + (tag $e-i32 (attr 0) (param i32 f32)) (func $f0 (throw $e-i32 (f32.const 0)) ) ) - "event's param numbers must match" + "tag's param numbers must match" ) (assert_invalid diff --git a/test/spec/tags.wast b/test/spec/tags.wast new file mode 100644 index 000000000..33e24e093 --- /dev/null +++ b/test/spec/tags.wast @@ -0,0 +1,33 @@ +;; Test tags + +(module + (tag (attr 0) (param i32)) + (tag $e (attr 0) (param i32 f32)) + + (tag $e-params0 (attr 0) (param i32 f32)) + (tag $e-params1 (attr 0) (param i32) (param f32)) + + (tag $e-export (export "ex0") (attr 0) (param i32)) + (tag $e-import (import "env" "im0") (attr 0) (param i32)) + + (import "env" "im1" (tag (attr 0) (param i32 f32))) + (export "ex1" (tag $e)) +) + +(assert_invalid + (module (tag $e (attr 0) (param i32) (result i32))) + "Tag type's result type should be none" +) + +(assert_invalid + (module (tag $e (attr 1) (param i32))) + "Currently only attribute 0 is supported" +) + +(assert_invalid + (module + (type $t (param i32)) + (tag $e (attr 0) (type $t) (param i32 f32)) + ) + "type and param don't match" +) diff --git a/test/tags.wast b/test/tags.wast new file mode 100644 index 000000000..08867f876 --- /dev/null +++ b/test/tags.wast @@ -0,0 +1,16 @@ +;; Test tags + +(module + (tag (attr 0) (param i32)) + (tag $e (attr 0) (param i32 f32)) + (tag $empty (attr 0)) + + (tag $e-params0 (attr 0) (param i32 f32)) + (tag $e-params1 (attr 0) (param i32) (param f32)) + + (tag $e-export (export "ex0") (attr 0) (param i32)) + (tag $e-import (import "env" "im0") (attr 0) (param i32)) + + (import "env" "im1" (tag (attr 0) (param i32 f32))) + (export "ex1" (tag $e)) +) diff --git a/test/tags.wast.from-wast b/test/tags.wast.from-wast new file mode 100644 index 000000000..c81c1bc2c --- /dev/null +++ b/test/tags.wast.from-wast @@ -0,0 +1,14 @@ +(module + (type $i32_f32_=>_none (func (param i32 f32))) + (type $i32_=>_none (func (param i32))) + (type $none_=>_none (func)) + (import "env" "im0" (tag $e-import (attr 0) (param i32))) + (import "env" "im1" (tag $eimport$1 (attr 0) (param i32 f32))) + (tag $2 (attr 0) (param i32)) + (tag $e (attr 0) (param i32 f32)) + (tag $empty (attr 0) (param)) + (tag $e-params0 (attr 0) (param i32 f32)) + (tag $e-params1 (attr 0) (param i32 f32)) + (tag $e-export (attr 0) (param i32)) + (export "ex1" (tag $e)) +) diff --git a/test/tags.wast.fromBinary b/test/tags.wast.fromBinary new file mode 100644 index 000000000..e313e6291 --- /dev/null +++ b/test/tags.wast.fromBinary @@ -0,0 +1,15 @@ +(module + (type $i32_f32_=>_none (func (param i32 f32))) + (type $i32_=>_none (func (param i32))) + (type $none_=>_none (func)) + (import "env" "im0" (tag $eimport$0 (attr 0) (param i32))) + (import "env" "im1" (tag $eimport$1 (attr 0) (param i32 f32))) + (tag $tag$0 (attr 0) (param i32)) + (tag $tag$1 (attr 0) (param i32 f32)) + (tag $tag$2 (attr 0) (param)) + (tag $tag$3 (attr 0) (param i32 f32)) + (tag $tag$4 (attr 0) (param i32 f32)) + (tag $tag$5 (attr 0) (param i32)) + (export "ex1" (tag $tag$1)) +) + diff --git a/test/tags.wast.fromBinary.noDebugInfo b/test/tags.wast.fromBinary.noDebugInfo new file mode 100644 index 000000000..e313e6291 --- /dev/null +++ b/test/tags.wast.fromBinary.noDebugInfo @@ -0,0 +1,15 @@ +(module + (type $i32_f32_=>_none (func (param i32 f32))) + (type $i32_=>_none (func (param i32))) + (type $none_=>_none (func)) + (import "env" "im0" (tag $eimport$0 (attr 0) (param i32))) + (import "env" "im1" (tag $eimport$1 (attr 0) (param i32 f32))) + (tag $tag$0 (attr 0) (param i32)) + (tag $tag$1 (attr 0) (param i32 f32)) + (tag $tag$2 (attr 0) (param)) + (tag $tag$3 (attr 0) (param i32 f32)) + (tag $tag$4 (attr 0) (param i32 f32)) + (tag $tag$5 (attr 0) (param i32)) + (export "ex1" (tag $tag$1)) +) + diff --git a/test/try-delegate.wasm.fromBinary b/test/try-delegate.wasm.fromBinary index ee4dbaabe..1ff60fee9 100644 --- a/test/try-delegate.wasm.fromBinary +++ b/test/try-delegate.wasm.fromBinary @@ -1,6 +1,6 @@ (module (type $none_=>_none (func)) - (event $event$0 (attr 0) (param)) + (tag $tag$0 (attr 0) (param)) (func $0 (try $label$6 (do @@ -12,7 +12,7 @@ ) ) ) - (catch $event$0 + (catch $tag$0 ) ) ) @@ -23,7 +23,7 @@ (try $label$7 (do ) - (catch $event$0 + (catch $tag$0 (drop (i32.const 0) ) @@ -36,7 +36,7 @@ ) ) ) - (catch $event$0 + (catch $tag$0 ) ) ) diff --git a/test/unit/test_features.py b/test/unit/test_features.py index 0186e2ba7..06e2661d1 100644 --- a/test/unit/test_features.py +++ b/test/unit/test_features.py @@ -184,16 +184,16 @@ class FeatureValidationTest(utils.BinaryenTestCase): ''' self.check_reference_types(module, 'all used types should be allowed') - def test_event(self): + def test_tag(self): module = ''' (module - (event $e (attr 0) (param i32)) + (tag $e (attr 0) (param i32)) (func $foo (throw $e (i32.const 0)) ) ) ''' - self.check_exception_handling(module, 'Module has events') + self.check_exception_handling(module, 'Module has tags') def test_multivalue_import(self): module = ''' @@ -218,13 +218,13 @@ class FeatureValidationTest(utils.BinaryenTestCase): self.check_multivalue(module, 'Multivalue function results ' + '(multivalue is not enabled)') - def test_multivalue_event(self): + def test_multivalue_tag(self): module = ''' (module - (event $foo (attr 0) (param i32 i64)) + (tag $foo (attr 0) (param i32 i64)) ) ''' - self.check_multivalue_exception_handling(module, 'Multivalue event type ' + + self.check_multivalue_exception_handling(module, 'Multivalue tag type ' + '(multivalue is not enabled)') def test_multivalue_block(self): |