diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 14 | ||||
-rw-r--r-- | test/exception-handling.wast | 18 | ||||
-rw-r--r-- | test/exception-handling.wast.from-wast | 14 | ||||
-rw-r--r-- | test/exception-handling.wast.fromBinary | 14 | ||||
-rw-r--r-- | test/exception-handling.wast.fromBinary.noDebugInfo | 14 |
5 files changed, 67 insertions, 7 deletions
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index 2a3ecea9d..d682285d1 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -30,13 +30,13 @@ BinaryenHeapTypeEq: 3 BinaryenHeapTypeI31: 4 BinaryenHeapTypeStruct: 5 BinaryenHeapTypeArray: 6 -BinaryenHeapTypeString: 7 -BinaryenHeapTypeStringviewWTF8: 8 -BinaryenHeapTypeStringviewWTF16: 9 -BinaryenHeapTypeStringviewIter: 10 -BinaryenHeapTypeNone: 11 -BinaryenHeapTypeNoext: 12 -BinaryenHeapTypeNofunc: 13 +BinaryenHeapTypeString: 8 +BinaryenHeapTypeStringviewWTF8: 9 +BinaryenHeapTypeStringviewWTF16: 10 +BinaryenHeapTypeStringviewIter: 11 +BinaryenHeapTypeNone: 12 +BinaryenHeapTypeNoext: 13 +BinaryenHeapTypeNofunc: 14 BinaryenFeatureMVP: 0 BinaryenFeatureAtomics: 1 BinaryenFeatureBulkMemory: 16 diff --git a/test/exception-handling.wast b/test/exception-handling.wast index d37cc322b..1a484f9ac 100644 --- a/test/exception-handling.wast +++ b/test/exception-handling.wast @@ -8,6 +8,9 @@ (func $foo) (func $bar) + ;; --------------------------------------------------------------------------- + ;; Old Phase 3 exception handling + (func $eh-test (local $x (i32 i64)) ;; Simple try-catch (try @@ -365,4 +368,19 @@ ) (nop) ) + + ;; --------------------------------------------------------------------------- + ;; New exception handling + + (func $exnref-test (result exnref) (local $exn exnref) (local $null-exn nullexnref) + (if (result exnref) + (i32.const 1) + (if (result nullexnref) + (i32.const 1) + (local.get $null-exn) + (ref.null noexn) + ) + (local.get $exn) + ) + ) ) diff --git a/test/exception-handling.wast.from-wast b/test/exception-handling.wast.from-wast index da9a1031e..7e7bec6ff 100644 --- a/test/exception-handling.wast.from-wast +++ b/test/exception-handling.wast.from-wast @@ -4,6 +4,7 @@ (type $2 (func (param i64))) (type $3 (func (param i32 i64))) (type $4 (func (param eqref))) + (type $5 (func (result exnref))) (tag $e-i32 (param i32)) (tag $e-i64 (param i64)) (tag $e-i32-i64 (param i32 i64)) @@ -406,4 +407,17 @@ ) (nop) ) + (func $exnref-test (type $5) (result exnref) + (local $exn exnref) + (local $null-exn nullexnref) + (if (result exnref) + (i32.const 1) + (if (result nullexnref) + (i32.const 1) + (local.get $null-exn) + (ref.null noexn) + ) + (local.get $exn) + ) + ) ) diff --git a/test/exception-handling.wast.fromBinary b/test/exception-handling.wast.fromBinary index e9cfce409..93678bc6f 100644 --- a/test/exception-handling.wast.fromBinary +++ b/test/exception-handling.wast.fromBinary @@ -4,6 +4,7 @@ (type $2 (func (param i64))) (type $3 (func (param i32 i64))) (type $4 (func (param eqref))) + (type $5 (func (result exnref))) (tag $e-i32 (param i32)) (tag $e-i64 (param i64)) (tag $e-i32-i64 (param i32 i64)) @@ -428,5 +429,18 @@ ) (nop) ) + (func $exnref-test (type $5) (result exnref) + (local $exn exnref) + (local $null-exn nullexnref) + (if (result exnref) + (i32.const 1) + (if (result nullexnref) + (i32.const 1) + (local.get $null-exn) + (ref.null noexn) + ) + (local.get $exn) + ) + ) ) diff --git a/test/exception-handling.wast.fromBinary.noDebugInfo b/test/exception-handling.wast.fromBinary.noDebugInfo index 4bc460630..beea8498b 100644 --- a/test/exception-handling.wast.fromBinary.noDebugInfo +++ b/test/exception-handling.wast.fromBinary.noDebugInfo @@ -4,6 +4,7 @@ (type $2 (func (param i64))) (type $3 (func (param i32 i64))) (type $4 (func (param eqref))) + (type $5 (func (result exnref))) (tag $tag$0 (param i32)) (tag $tag$1 (param i64)) (tag $tag$2 (param i32 i64)) @@ -428,5 +429,18 @@ ) (nop) ) + (func $8 (type $5) (result exnref) + (local $0 exnref) + (local $1 nullexnref) + (if (result exnref) + (i32.const 1) + (if (result nullexnref) + (i32.const 1) + (local.get $1) + (ref.null noexn) + ) + (local.get $0) + ) + ) ) |