diff options
author | Alon Zakai <azakai@google.com> | 2021-01-21 22:09:47 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-21 14:09:47 -0800 |
commit | 3f4d3b3eff5d8112a9da3674a5f5eea696ca3c7d (patch) | |
tree | 30d3ddedf6ae2de10f56d6acea64f2b17640041b /test | |
parent | 527e9f9ed76cee0baaa67e89569c282a3782be08 (diff) | |
download | binaryen-3f4d3b3eff5d8112a9da3674a5f5eea696ca3c7d.tar.gz binaryen-3f4d3b3eff5d8112a9da3674a5f5eea696ca3c7d.tar.bz2 binaryen-3f4d3b3eff5d8112a9da3674a5f5eea696ca3c7d.zip |
[GC] Add dataref type (#3500)
This is not 100% of everything, but is enough to get tests passing, which
includes full binary and text format support, getting all switches to compile
without error, and some additions to InstrumentLocals.
Diffstat (limited to 'test')
-rw-r--r-- | test/binaryen.js/kitchen-sink.js.txt | 4 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 2 | ||||
-rw-r--r-- | test/gc.wast | 3 | ||||
-rw-r--r-- | test/gc.wast.from-wast | 3 | ||||
-rw-r--r-- | test/gc.wast.fromBinary | 3 | ||||
-rw-r--r-- | test/gc.wast.fromBinary.noDebugInfo | 31 | ||||
-rw-r--r-- | test/passes/instrument-locals_all-features_disable-typed-function-references.txt | 3 |
7 files changed, 32 insertions, 17 deletions
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt index ef15d8a00..204dd800c 100644 --- a/test/binaryen.js/kitchen-sink.js.txt +++ b/test/binaryen.js/kitchen-sink.js.txt @@ -22,8 +22,8 @@ // 10 // BinaryenTypeEqref: 11 // 11 - // BinaryenTypeI31ref: 12 - // 12 + // BinaryenTypeI31ref: 13 + // 13 // BinaryenTypeAuto: -1 // 2,2 // 2,2 diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index 7fa387daa..90634550b 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -10,7 +10,7 @@ // BinaryenTypeExnref: 9 // BinaryenTypeAnyref: 10 // BinaryenTypeEqref: 11 - // BinaryenTypeI31ref: 12 + // BinaryenTypeI31ref: 13 // BinaryenTypeAuto: -1 BinaryenFeatureMVP: 0 BinaryenFeatureAtomics: 1 diff --git a/test/gc.wast b/test/gc.wast index 2fa99a9ac..b4a45421a 100644 --- a/test/gc.wast +++ b/test/gc.wast @@ -18,6 +18,7 @@ (local $local_i32 i32) (local $local_anyref anyref) (local $local_eqref eqref) + (local $local_dataref dataref) (local $local_i31ref i31ref) ;; Test types for local.get/set @@ -70,6 +71,8 @@ ) (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)) ) diff --git a/test/gc.wast.from-wast b/test/gc.wast.from-wast index 776500087..f9892b417 100644 --- a/test/gc.wast.from-wast +++ b/test/gc.wast.from-wast @@ -16,6 +16,7 @@ (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.set $local_anyref (local.get $local_anyref) @@ -149,6 +150,8 @@ ) ) (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)) (nop) diff --git a/test/gc.wast.fromBinary b/test/gc.wast.fromBinary index 3e5315f2c..c68900c38 100644 --- a/test/gc.wast.fromBinary +++ b/test/gc.wast.fromBinary @@ -16,6 +16,7 @@ (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.set $local_anyref (local.get $local_anyref) @@ -149,6 +150,8 @@ ) ) (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)) (nop) diff --git a/test/gc.wast.fromBinary.noDebugInfo b/test/gc.wast.fromBinary.noDebugInfo index d423e65ba..aff17028b 100644 --- a/test/gc.wast.fromBinary.noDebugInfo +++ b/test/gc.wast.fromBinary.noDebugInfo @@ -16,7 +16,8 @@ (local $0 i32) (local $1 anyref) (local $2 eqref) - (local $3 (ref null i31)) + (local $3 (ref null data)) + (local $4 (ref null i31)) (local.set $1 (local.get $1) ) @@ -35,13 +36,13 @@ (local.set $2 (ref.null eq) ) - (local.set $3 - (local.get $3) + (local.set $4 + (local.get $4) ) - (local.set $3 + (local.set $4 (global.get $global$2) ) - (local.set $3 + (local.set $4 (i31.new (i32.const 0) ) @@ -56,7 +57,7 @@ (ref.null eq) ) (local.set $1 - (local.get $3) + (local.get $4) ) (local.set $1 (global.get $global$2) @@ -67,7 +68,7 @@ ) ) (local.set $2 - (local.get $3) + (local.get $4) ) (local.set $2 (global.get $global$2) @@ -96,7 +97,7 @@ (ref.null eq) ) (global.set $global$2 - (local.get $3) + (local.get $4) ) (global.set $global$2 (global.get $global$2) @@ -116,7 +117,7 @@ (ref.null eq) ) (global.set $global$0 - (local.get $3) + (local.get $4) ) (global.set $global$0 (global.get $global$2) @@ -127,7 +128,7 @@ ) ) (global.set $global$1 - (local.get $3) + (local.get $4) ) (global.set $global$1 (global.get $global$2) @@ -139,18 +140,20 @@ ) (local.set $0 (i31.get_s - (local.get $3) + (local.get $4) ) ) (local.set $0 (i31.get_u - (local.get $3) + (local.get $4) ) ) ) (func $1 - (local $0 (ref null i31)) - (local $1 (ref null i31)) + (local $0 (ref null data)) + (local $1 (ref null data)) + (local $2 (ref null i31)) + (local $3 (ref null i31)) (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 5fc177d9d..f320f0421 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 @@ -9,6 +9,7 @@ (type $i32_i32_exnref_=>_exnref (func (param i32 i32 exnref) (result exnref))) (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 $none_=>_none (func)) (type $i32_=>_none (func (param i32))) @@ -30,6 +31,8 @@ (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_v128" (func $get_v128 (param i32 i32 v128) (result v128))) |