diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/binaryen.js/kitchen-sink.js | 4 | ||||
-rw-r--r-- | test/binaryen.js/kitchen-sink.js.txt | 10 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.c | 6 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 3 | ||||
-rw-r--r-- | test/gc.wast | 6 | ||||
-rw-r--r-- | test/gc.wast.from-wast | 6 | ||||
-rw-r--r-- | test/gc.wast.fromBinary | 6 | ||||
-rw-r--r-- | test/gc.wast.fromBinary.noDebugInfo | 34 | ||||
-rw-r--r-- | test/passes/instrument-locals_all-features_disable-typed-function-references.txt | 6 |
9 files changed, 50 insertions, 31 deletions
diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js index 160054fde..9655d5607 100644 --- a/test/binaryen.js/kitchen-sink.js +++ b/test/binaryen.js/kitchen-sink.js @@ -83,6 +83,9 @@ function test_types() { console.log(" // BinaryenTypeI31ref: " + binaryen.i31ref); console.log(" //", binaryen.expandType(binaryen.i31ref).join(",")); + console.log(" // BinaryenTypeDataref: " + binaryen.dataref); + console.log(" //", binaryen.expandType(binaryen.dataref).join(",")); + console.log(" // BinaryenTypeAuto: " + binaryen.auto); var i32_pair = binaryen.createType([binaryen.i32, binaryen.i32]); @@ -590,6 +593,7 @@ function test_core() { module.anyref.pop(), module.eqref.pop(), module.i31ref.pop(), + module.dataref.pop(), // Memory module.memory.size(), diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt index f73990493..1b1a29de6 100644 --- a/test/binaryen.js/kitchen-sink.js.txt +++ b/test/binaryen.js/kitchen-sink.js.txt @@ -20,7 +20,9 @@ // 9 // BinaryenTypeEqref: 10 // 10 - // BinaryenTypeI31ref: 12 + // BinaryenTypeI31ref: 11 + // 11 + // BinaryenTypeDataref: 12 // 12 // BinaryenTypeAuto: -1 // 2,2 @@ -1936,6 +1938,9 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} (pop i31ref) ) (drop + (pop dataref) + ) + (drop (memory.size) ) (drop @@ -3795,6 +3800,9 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} (pop i31ref) ) (drop + (pop dataref) + ) + (drop (memory.size) ) (drop diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index d70ad11eb..c4973d317 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -223,6 +223,12 @@ void test_types() { BinaryenTypeExpand(i31ref, &valueType); assert(valueType == i31ref); + BinaryenType dataref = BinaryenTypeDataref(); + printf(" // BinaryenTypeDataref: %d\n", dataref); + assert(BinaryenTypeArity(dataref) == 1); + BinaryenTypeExpand(dataref, &valueType); + assert(valueType == dataref); + printf(" // BinaryenTypeAuto: %d\n", BinaryenTypeAuto()); BinaryenType pair[] = {i32, i32}; diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index 350c5555f..8b06c1109 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -9,7 +9,8 @@ // BinaryenTypeExternref: 8 // BinaryenTypeAnyref: 9 // BinaryenTypeEqref: 10 - // BinaryenTypeI31ref: 12 + // BinaryenTypeI31ref: 11 + // BinaryenTypeDataref: 12 // BinaryenTypeAuto: -1 BinaryenFeatureMVP: 0 BinaryenFeatureAtomics: 1 diff --git a/test/gc.wast b/test/gc.wast index b4a45421a..c3a814c38 100644 --- a/test/gc.wast +++ b/test/gc.wast @@ -18,8 +18,8 @@ (local $local_i32 i32) (local $local_anyref anyref) (local $local_eqref eqref) - (local $local_dataref dataref) (local $local_i31ref i31ref) + (local $local_dataref dataref) ;; Test types for local.get/set (local.set $local_anyref (local.get $local_anyref)) @@ -71,9 +71,9 @@ ) (func $test-variants - (local $local_datarefnull (ref null data)) - (local $local_datarefnonnull (ref data)) (local $local_i31refnull (ref null i31)) (local $local_i31refnonnull (ref i31)) + (local $local_datarefnull (ref null data)) + (local $local_datarefnonnull (ref data)) ) ) diff --git a/test/gc.wast.from-wast b/test/gc.wast.from-wast index f9892b417..f38c7416d 100644 --- a/test/gc.wast.from-wast +++ b/test/gc.wast.from-wast @@ -16,8 +16,8 @@ (local $local_i32 i32) (local $local_anyref anyref) (local $local_eqref eqref) - (local $local_dataref (ref null data)) (local $local_i31ref (ref null i31)) + (local $local_dataref (ref null data)) (local.set $local_anyref (local.get $local_anyref) ) @@ -150,10 +150,10 @@ ) ) (func $test-variants - (local $local_datarefnull (ref null data)) - (local $local_datarefnonnull (ref null data)) (local $local_i31refnull (ref null i31)) (local $local_i31refnonnull (ref null i31)) + (local $local_datarefnull (ref null data)) + (local $local_datarefnonnull (ref null data)) (nop) ) ) diff --git a/test/gc.wast.fromBinary b/test/gc.wast.fromBinary index c68900c38..066928de4 100644 --- a/test/gc.wast.fromBinary +++ b/test/gc.wast.fromBinary @@ -16,8 +16,8 @@ (local $local_i32 i32) (local $local_anyref anyref) (local $local_eqref eqref) - (local $local_dataref (ref null data)) (local $local_i31ref (ref null i31)) + (local $local_dataref (ref null data)) (local.set $local_anyref (local.get $local_anyref) ) @@ -150,10 +150,10 @@ ) ) (func $test-variants - (local $local_datarefnull (ref null data)) - (local $local_datarefnonnull (ref null data)) (local $local_i31refnull (ref null i31)) (local $local_i31refnonnull (ref null i31)) + (local $local_datarefnull (ref null data)) + (local $local_datarefnonnull (ref null data)) (nop) ) ) diff --git a/test/gc.wast.fromBinary.noDebugInfo b/test/gc.wast.fromBinary.noDebugInfo index aff17028b..77f520257 100644 --- a/test/gc.wast.fromBinary.noDebugInfo +++ b/test/gc.wast.fromBinary.noDebugInfo @@ -16,8 +16,8 @@ (local $0 i32) (local $1 anyref) (local $2 eqref) - (local $3 (ref null data)) - (local $4 (ref null i31)) + (local $3 (ref null i31)) + (local $4 (ref null data)) (local.set $1 (local.get $1) ) @@ -36,13 +36,13 @@ (local.set $2 (ref.null eq) ) - (local.set $4 - (local.get $4) + (local.set $3 + (local.get $3) ) - (local.set $4 + (local.set $3 (global.get $global$2) ) - (local.set $4 + (local.set $3 (i31.new (i32.const 0) ) @@ -57,7 +57,7 @@ (ref.null eq) ) (local.set $1 - (local.get $4) + (local.get $3) ) (local.set $1 (global.get $global$2) @@ -68,7 +68,7 @@ ) ) (local.set $2 - (local.get $4) + (local.get $3) ) (local.set $2 (global.get $global$2) @@ -97,7 +97,7 @@ (ref.null eq) ) (global.set $global$2 - (local.get $4) + (local.get $3) ) (global.set $global$2 (global.get $global$2) @@ -117,7 +117,7 @@ (ref.null eq) ) (global.set $global$0 - (local.get $4) + (local.get $3) ) (global.set $global$0 (global.get $global$2) @@ -128,7 +128,7 @@ ) ) (global.set $global$1 - (local.get $4) + (local.get $3) ) (global.set $global$1 (global.get $global$2) @@ -140,20 +140,20 @@ ) (local.set $0 (i31.get_s - (local.get $4) + (local.get $3) ) ) (local.set $0 (i31.get_u - (local.get $4) + (local.get $3) ) ) ) (func $1 - (local $0 (ref null data)) - (local $1 (ref null data)) - (local $2 (ref null i31)) - (local $3 (ref null i31)) + (local $0 (ref null i31)) + (local $1 (ref null i31)) + (local $2 (ref null data)) + (local $3 (ref null data)) (nop) ) ) diff --git a/test/passes/instrument-locals_all-features_disable-typed-function-references.txt b/test/passes/instrument-locals_all-features_disable-typed-function-references.txt index 18bd1a10d..edd927851 100644 --- a/test/passes/instrument-locals_all-features_disable-typed-function-references.txt +++ b/test/passes/instrument-locals_all-features_disable-typed-function-references.txt @@ -8,8 +8,8 @@ (type $i32_i32_externref_=>_externref (func (param i32 i32 externref) (result externref))) (type $i32_i32_anyref_=>_anyref (func (param i32 i32 anyref) (result anyref))) (type $i32_i32_eqref_=>_eqref (func (param i32 i32 eqref) (result eqref))) - (type $i32_i32_dataref_=>_dataref (func (param i32 i32 dataref) (result dataref))) (type $i32_i32_i31ref_=>_i31ref (func (param i32 i32 i31ref) (result i31ref))) + (type $i32_i32_dataref_=>_dataref (func (param i32 i32 dataref) (result dataref))) (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) (import "env" "get_i32" (func $get_i32 (param i32 i32 i32) (result i32))) @@ -28,10 +28,10 @@ (import "env" "set_anyref" (func $set_anyref (param i32 i32 anyref) (result anyref))) (import "env" "get_eqref" (func $get_eqref (param i32 i32 eqref) (result eqref))) (import "env" "set_eqref" (func $set_eqref (param i32 i32 eqref) (result eqref))) - (import "env" "get_dataref" (func $get_dataref (param i32 i32 dataref) (result dataref))) - (import "env" "set_dataref" (func $set_dataref (param i32 i32 dataref) (result dataref))) (import "env" "get_i31ref" (func $get_i31ref (param i32 i32 i31ref) (result i31ref))) (import "env" "set_i31ref" (func $set_i31ref (param i32 i32 i31ref) (result i31ref))) + (import "env" "get_dataref" (func $get_dataref (param i32 i32 dataref) (result dataref))) + (import "env" "set_dataref" (func $set_dataref (param i32 i32 dataref) (result dataref))) (import "env" "get_v128" (func $get_v128 (param i32 i32 v128) (result v128))) (import "env" "set_v128" (func $set_v128 (param i32 i32 v128) (result v128))) (event $e (attr 0) (param i32)) |