From 365a677c4b7dd889ceb342f910b382d299062c60 Mon Sep 17 00:00:00 2001 From: Andreas Haas Date: Wed, 20 May 2020 08:04:19 +0200 Subject: [PATCH 1/3] [tests] Fix various spec tests --- interpreter/script/js.ml | 2 ++ test/core/binary-leb128.wast | 5 +++-- test/core/ref_func.wast | 1 + test/core/table.wast | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/interpreter/script/js.ml b/interpreter/script/js.ml index 27a0b5da..804deef0 100644 --- a/interpreter/script/js.ml +++ b/interpreter/script/js.ml @@ -33,6 +33,8 @@ let spectest = { externref: externref, is_externref: is_externref, is_funcref: is_funcref, + eq_externref: eq_externref, + eq_funcref: eq_funcref, print: console.log.bind(console), print_i32: console.log.bind(console), print_i32_f32: console.log.bind(console), diff --git a/test/core/binary-leb128.wast b/test/core/binary-leb128.wast index 9afcb540..e147c980 100644 --- a/test/core/binary-leb128.wast +++ b/test/core/binary-leb128.wast @@ -33,9 +33,10 @@ "\00asm" "\01\00\00\00" "\04\04\01" ;; Table section with 1 entry "\70\00\00" ;; no max, minimum 0, funcref - "\09\07\01" ;; Element section with 1 entry + "\09\09\01" ;; Element section with 1 entry + "\02" ;; Element with explicit table index "\80\00" ;; Table index 0, encoded with 2 bytes - "\41\00\0b\00" ;; (i32.const 0) with no elements + "\41\00\0b\00\00" ;; (i32.const 0) with no elements ) (module binary "\00asm" "\01\00\00\00" diff --git a/test/core/ref_func.wast b/test/core/ref_func.wast index c0c5a0cc..a66793fb 100644 --- a/test/core/ref_func.wast +++ b/test/core/ref_func.wast @@ -93,6 +93,7 @@ (elem (table $t) (i32.const 0) funcref (ref.func $f4)) (elem func $f5) (elem funcref (ref.func $f6)) + (elem declare func $f1 $f2 $f3 $f4 $f5 $f6) (func (ref.func $f1) diff --git a/test/core/table.wast b/test/core/table.wast index 0bd04f5c..4913361b 100644 --- a/test/core/table.wast +++ b/test/core/table.wast @@ -6,7 +6,7 @@ (module (table 0 1 funcref)) (module (table 1 256 funcref)) (module (table 0 65536 funcref)) -(module (table 0 0xffff_ffff funcref)) +(module (table 0 0x8f_ffff funcref)) (module (table 0 funcref) (table 0 funcref)) (module (table (import "spectest" "table") 0 funcref) (table 0 funcref)) From eb9fa16e313f8105e3dc05b7b8a83e27ba0406a6 Mon Sep 17 00:00:00 2001 From: gahaas Date: Wed, 20 May 2020 10:43:13 +0200 Subject: [PATCH 2/3] Remove function declaration --- test/core/ref_func.wast | 1 - 1 file changed, 1 deletion(-) diff --git a/test/core/ref_func.wast b/test/core/ref_func.wast index a66793fb..c0c5a0cc 100644 --- a/test/core/ref_func.wast +++ b/test/core/ref_func.wast @@ -93,7 +93,6 @@ (elem (table $t) (i32.const 0) funcref (ref.func $f4)) (elem func $f5) (elem funcref (ref.func $f6)) - (elem declare func $f1 $f2 $f3 $f4 $f5 $f6) (func (ref.func $f1) From 85980aa9679cfa8d6df22de29cdb9088bb882335 Mon Sep 17 00:00:00 2001 From: gahaas Date: Wed, 20 May 2020 13:19:55 +0200 Subject: [PATCH 3/3] Revert change to table.wast --- test/core/table.wast | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core/table.wast b/test/core/table.wast index 4913361b..0bd04f5c 100644 --- a/test/core/table.wast +++ b/test/core/table.wast @@ -6,7 +6,7 @@ (module (table 0 1 funcref)) (module (table 1 256 funcref)) (module (table 0 65536 funcref)) -(module (table 0 0x8f_ffff funcref)) +(module (table 0 0xffff_ffff funcref)) (module (table 0 funcref) (table 0 funcref)) (module (table (import "spectest" "table") 0 funcref) (table 0 funcref))