diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/Oz_fuzz-exec_all-features.txt | 1 | ||||
-rw-r--r-- | test/passes/dae_all-features.txt | 1 | ||||
-rw-r--r-- | test/passes/duplicate-function-elimination_all-features.txt | 1 | ||||
-rw-r--r-- | test/passes/fuzz-exec_all-features.txt | 1 | ||||
-rw-r--r-- | test/passes/inlining_all-features.txt | 1 | ||||
-rw-r--r-- | test/passes/instrument-locals_all-features_disable-typed-function-references.txt | 1 | ||||
-rw-r--r-- | test/passes/legalize-js-interface_all-features.txt | 1 | ||||
-rw-r--r-- | test/passes/precompute_all-features.txt | 1 | ||||
-rw-r--r-- | test/passes/remove-unused-module-elements_all-features.txt | 1 | ||||
-rw-r--r-- | test/passes/simplify-globals_all-features_fuzz-exec.txt | 1 | ||||
-rw-r--r-- | test/reference-types.wast | 10 | ||||
-rw-r--r-- | test/reference-types.wast.from-wast | 11 | ||||
-rw-r--r-- | test/reference-types.wast.fromBinary | 11 | ||||
-rw-r--r-- | test/reference-types.wast.fromBinary.noDebugInfo | 11 | ||||
-rw-r--r-- | test/typed-function-references.wast.from-wast | 1 | ||||
-rw-r--r-- | test/typed-function-references.wast.fromBinary | 1 | ||||
-rw-r--r-- | test/typed-function-references.wast.fromBinary.noDebugInfo | 1 |
17 files changed, 53 insertions, 3 deletions
diff --git a/test/passes/Oz_fuzz-exec_all-features.txt b/test/passes/Oz_fuzz-exec_all-features.txt index 0c918e3b4..377d936fd 100644 --- a/test/passes/Oz_fuzz-exec_all-features.txt +++ b/test/passes/Oz_fuzz-exec_all-features.txt @@ -41,6 +41,7 @@ (type $anyref_=>_none (func (param anyref))) (type $int_func (func (result i32))) (import "fuzzing-support" "log-i32" (func $log (param i32))) + (elem declare func $a-void-func) (export "structs" (func $0)) (export "arrays" (func $1)) (export "rtts" (func $2)) diff --git a/test/passes/dae_all-features.txt b/test/passes/dae_all-features.txt index d4769ac16..4ca21576f 100644 --- a/test/passes/dae_all-features.txt +++ b/test/passes/dae_all-features.txt @@ -282,6 +282,7 @@ (module (type $funcref_i32_f64_=>_i64 (func (param funcref i32 f64) (result i64))) (type $f32_=>_funcref (func (param f32) (result funcref))) + (elem declare func $0) (export "export" (func $1)) (func $0 (param $0 funcref) (param $1 i32) (param $2 f64) (result i64) (nop) diff --git a/test/passes/duplicate-function-elimination_all-features.txt b/test/passes/duplicate-function-elimination_all-features.txt index aa234da67..a7a751f76 100644 --- a/test/passes/duplicate-function-elimination_all-features.txt +++ b/test/passes/duplicate-function-elimination_all-features.txt @@ -1,6 +1,7 @@ (module (type $none_=>_i32 (func (result i32))) (type $none_=>_funcref (func (result funcref))) + (elem declare func $0) (func $0 (result i32) (i32.const 0) ) diff --git a/test/passes/fuzz-exec_all-features.txt b/test/passes/fuzz-exec_all-features.txt index 22e342fc1..8785d088a 100644 --- a/test/passes/fuzz-exec_all-features.txt +++ b/test/passes/fuzz-exec_all-features.txt @@ -211,6 +211,7 @@ [fuzz-exec] note result: func => funcref(func) (module (type $none_=>_funcref (func (result funcref))) + (elem declare func $func) (export "func" (func $func)) (func $func (result funcref) (ref.func $func) diff --git a/test/passes/inlining_all-features.txt b/test/passes/inlining_all-features.txt index f255ed8ff..e4a563dec 100644 --- a/test/passes/inlining_all-features.txt +++ b/test/passes/inlining_all-features.txt @@ -1,6 +1,7 @@ (module (type $none_=>_none (func)) (type $none_=>_funcref (func (result funcref))) + (elem declare func $foo) (export "ref_func_test" (func $ref_func_test)) (func $foo (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 481d7a72b..3d8a0b651 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 @@ -34,6 +34,7 @@ (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))) + (elem declare func $test) (event $e (attr 0) (param i32)) (func $test (local $x i32) diff --git a/test/passes/legalize-js-interface_all-features.txt b/test/passes/legalize-js-interface_all-features.txt index 90353c4c9..d05d1bc30 100644 --- a/test/passes/legalize-js-interface_all-features.txt +++ b/test/passes/legalize-js-interface_all-features.txt @@ -11,6 +11,7 @@ (import "env" "imported" (func $legalimport$imported (result i32))) (import "env" "other" (func $legalimport$other (param i32 i32 i32 i32 i32))) (import "env" "ref-func-arg" (func $legalimport$ref-func-arg (result i32))) + (elem declare func $ref-func-arg) (export "func" (func $legalstub$func)) (export "ref-func-test" (func $ref-func-test)) (export "imported" (func $legalstub$imported)) diff --git a/test/passes/precompute_all-features.txt b/test/passes/precompute_all-features.txt index b35bef77d..7ee4db1f2 100644 --- a/test/passes/precompute_all-features.txt +++ b/test/passes/precompute_all-features.txt @@ -8,6 +8,7 @@ (type $none_=>_i32_i64 (func (result i32 i64))) (memory $0 512 512) (data (i32.const 0) "passive") + (elem declare func $dummy) (global $global i32 (i32.const 1)) (global $global-mut (mut i32) (i32.const 2)) (func $x (param $x i32) diff --git a/test/passes/remove-unused-module-elements_all-features.txt b/test/passes/remove-unused-module-elements_all-features.txt index c2f86125d..025079225 100644 --- a/test/passes/remove-unused-module-elements_all-features.txt +++ b/test/passes/remove-unused-module-elements_all-features.txt @@ -316,6 +316,7 @@ ) (module (type $none_=>_none (func)) + (elem declare func $foo) (export "test" (func $test)) (func $foo (nop) diff --git a/test/passes/simplify-globals_all-features_fuzz-exec.txt b/test/passes/simplify-globals_all-features_fuzz-exec.txt index fa236fbc1..141fe9f01 100644 --- a/test/passes/simplify-globals_all-features_fuzz-exec.txt +++ b/test/passes/simplify-globals_all-features_fuzz-exec.txt @@ -3,6 +3,7 @@ (module (type $f32_ref?|i31|_i64_f64_funcref_=>_none (func (param f32 (ref null i31) i64 f64 funcref))) (type $none_=>_funcref (func (result funcref))) + (elem declare func $0) (global $global$0 (mut funcref) (ref.null func)) (export "export" (func $1)) (func $0 (param $0 f32) (param $1 (ref null i31)) (param $2 i64) (param $3 f64) (param $4 funcref) diff --git a/test/reference-types.wast b/test/reference-types.wast index e79508839..28e24b4d7 100644 --- a/test/reference-types.wast +++ b/test/reference-types.wast @@ -17,6 +17,7 @@ (func $foo) (table funcref (elem $take_externref $take_funcref $take_anyref)) + (elem declare func $ref-taken-but-not-in-table) (import "env" "import_func" (func $import_func (param externref) (result funcref))) (import "env" "import_global" (global $import_global externref)) @@ -532,4 +533,13 @@ (return (ref.func $foo)) (return (ref.null func)) ) + + (func $ref-user + (drop + ;; an "elem declare func" must be emitted for this ref.func which is not + ;; in the table + (ref.func $ref-taken-but-not-in-table) + ) + ) + (func $ref-taken-but-not-in-table) ) diff --git a/test/reference-types.wast.from-wast b/test/reference-types.wast.from-wast index 1ccdc4d52..5a8147584 100644 --- a/test/reference-types.wast.from-wast +++ b/test/reference-types.wast.from-wast @@ -3,15 +3,16 @@ (type $sig_anyref (func (param anyref))) (type $sig_funcref (func (param funcref))) (type $none_=>_funcref (func (result funcref))) + (type $none_=>_none (func)) (type $sig_externref (func (param externref))) (type $none_=>_externref (func (result externref))) - (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) (type $externref_=>_funcref (func (param externref) (result funcref))) (import "env" "import_global" (global $import_global externref)) (import "env" "import_func" (func $import_func (param externref) (result funcref))) (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) (global $global_externref (mut externref) (ref.null extern)) (global $global_funcref (mut funcref) (ref.null func)) (global $global_funcref_func (mut funcref) (ref.func $foo)) @@ -764,4 +765,12 @@ (ref.null func) ) ) + (func $ref-user + (drop + (ref.func $ref-taken-but-not-in-table) + ) + ) + (func $ref-taken-but-not-in-table + (nop) + ) ) diff --git a/test/reference-types.wast.fromBinary b/test/reference-types.wast.fromBinary index 283a1efe3..f55aae6be 100644 --- a/test/reference-types.wast.fromBinary +++ b/test/reference-types.wast.fromBinary @@ -3,15 +3,16 @@ (type $sig_anyref (func (param anyref))) (type $sig_funcref (func (param funcref))) (type $none_=>_funcref (func (result funcref))) + (type $none_=>_none (func)) (type $sig_externref (func (param externref))) (type $none_=>_externref (func (result externref))) - (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) (type $externref_=>_funcref (func (param externref) (result funcref))) (import "env" "import_global" (global $import_global externref)) (import "env" "import_func" (func $import_func (param externref) (result funcref))) (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) (global $global_externref (mut externref) (ref.null extern)) (global $global_funcref (mut funcref) (ref.null func)) (global $global_funcref_func (mut funcref) (ref.func $foo)) @@ -725,5 +726,13 @@ (local.get $local_funcref) ) ) + (func $ref-user + (drop + (ref.func $ref-taken-but-not-in-table) + ) + ) + (func $ref-taken-but-not-in-table + (nop) + ) ) diff --git a/test/reference-types.wast.fromBinary.noDebugInfo b/test/reference-types.wast.fromBinary.noDebugInfo index 9613c300b..970037571 100644 --- a/test/reference-types.wast.fromBinary.noDebugInfo +++ b/test/reference-types.wast.fromBinary.noDebugInfo @@ -3,15 +3,16 @@ (type $anyref_=>_none (func (param anyref))) (type $funcref_=>_none (func (param funcref))) (type $none_=>_funcref (func (result funcref))) + (type $none_=>_none (func)) (type $externref_=>_none (func (param externref))) (type $none_=>_externref (func (result externref))) - (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) (type $externref_=>_funcref (func (param externref) (result funcref))) (import "env" "import_global" (global $gimport$0 externref)) (import "env" "import_func" (func $fimport$0 (param externref) (result funcref))) (table $0 3 3 funcref) (elem (i32.const 0) $0 $1 $2) + (elem declare func $27 $3) (global $global$0 (mut externref) (ref.null extern)) (global $global$1 (mut funcref) (ref.null func)) (global $global$2 (mut funcref) (ref.func $3)) @@ -725,5 +726,13 @@ (local.get $1) ) ) + (func $26 + (drop + (ref.func $27) + ) + ) + (func $27 + (nop) + ) ) diff --git a/test/typed-function-references.wast.from-wast b/test/typed-function-references.wast.from-wast index f96303aa5..aa7d23477 100644 --- a/test/typed-function-references.wast.from-wast +++ b/test/typed-function-references.wast.from-wast @@ -8,6 +8,7 @@ (type $none_=>_i32_ref?|$mixed_results|_f64 (func (result i32 (ref null $mixed_results) f64))) (type $mixed_results (func (result anyref f32 anyref f32))) (type $f64_=>_ref_null<_->_eqref> (func (param f64) (result (ref null $=>eqref)))) + (elem declare func $call-ref $call-ref-more) (func $call-ref (call_ref (ref.func $call-ref) diff --git a/test/typed-function-references.wast.fromBinary b/test/typed-function-references.wast.fromBinary index b6dfd2a5d..047767ca6 100644 --- a/test/typed-function-references.wast.fromBinary +++ b/test/typed-function-references.wast.fromBinary @@ -8,6 +8,7 @@ (type $=>anyref (func (result anyref))) (type $none_=>_i32_ref?|$mixed_results|_f64 (func (result i32 (ref null $mixed_results) f64))) (type $f64_=>_ref_null<_->_eqref> (func (param f64) (result (ref null $=>eqref)))) + (elem declare func $call-ref $call-ref-more) (func $call-ref (call_ref (ref.func $call-ref) diff --git a/test/typed-function-references.wast.fromBinary.noDebugInfo b/test/typed-function-references.wast.fromBinary.noDebugInfo index 7d09438df..7cecbd5b1 100644 --- a/test/typed-function-references.wast.fromBinary.noDebugInfo +++ b/test/typed-function-references.wast.fromBinary.noDebugInfo @@ -8,6 +8,7 @@ (type $none_=>_anyref (func (result anyref))) (type $none_=>_i32_ref?|none_->_anyref_f32_anyref_f32|_f64 (func (result i32 (ref null $none_=>_anyref_f32_anyref_f32) f64))) (type $f64_=>_ref?|none_->_eqref| (func (param f64) (result (ref null $none_=>_eqref)))) + (elem declare func $0 $2) (func $0 (call_ref (ref.func $0) |