diff options
author | Thomas Lively <tlively@google.com> | 2024-04-24 11:07:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-24 11:07:28 -0700 |
commit | c183dc9ce6b6e14581078ba42ff1824f922234ca (patch) | |
tree | 75efc6dde4de579fa3e347d7e8b2cc31224cd3ca /test/lit/basic | |
parent | ff02ea0bbe7e3288a2463bb449eb74a2753dda10 (diff) | |
download | binaryen-c183dc9ce6b6e14581078ba42ff1824f922234ca.tar.gz binaryen-c183dc9ce6b6e14581078ba42ff1824f922234ca.tar.bz2 binaryen-c183dc9ce6b6e14581078ba42ff1824f922234ca.zip |
[Parser] Use the new parser in wasm-shell and wasm-as (#6529)
Updating just one or the other of these tools would cause the tests
spec/import-after-*.fail.wast to fail, since only the updated tool would
correctly fail to parse its contents. To avoid this, update both tools at
once. (The tests erroneously pass before this change because check.py does not
ensure that .fail.wast tests fail, only that failing tests end in .fail.wast.)
In wasm-shell, to minimize the diff, only use the new parser to parse modules
and instructions. Continue using the legacy parsing based on s-expressions for
the other wast commands. Updating the parsing of the other commands to use
`Lexer` instead of `SExpressionParser` is left as future work. The boundary
between the two parsing styles is somewhat hacky, but it is worth it to enable
incremental development.
Update the tests to fix incorrect wast rejected by the new parser. Many of the
spec/old_* tests use non-standard forms from before Wasm MVP was standardized,
so fixing them would have been onerous. All of these tests have non-old_*
variants, so simply delete them.
Diffstat (limited to 'test/lit/basic')
-rw-r--r-- | test/lit/basic/types-function-references.wast | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/test/lit/basic/types-function-references.wast b/test/lit/basic/types-function-references.wast index 0f32cf3eb..c1687c706 100644 --- a/test/lit/basic/types-function-references.wast +++ b/test/lit/basic/types-function-references.wast @@ -16,6 +16,17 @@ ;; CHECK-BIN: (type $void (func)) (type $void (func)) ;; inline ref type in result + ;; CHECK-BIN: (type $i32-i32 (func (param i32) (result i32))) + + ;; CHECK-BIN: (type $3 (func (result i32 (ref null $mixed_results) f64))) + + ;; CHECK-BIN: (type $4 (func (param (ref $i32-i32)) (result i32))) + + ;; CHECK-BIN: (type $5 (func (param (ref null $i32-i32)) (result i32))) + + ;; CHECK-BIN: (type $6 (func (result i32))) + + ;; CHECK-BIN: (type $_=>_eqref (func (result eqref))) (type $_=>_eqref (func (result eqref))) ;; CHECK-TEXT: (type $i32-i32 (func (param i32) (result i32))) @@ -32,19 +43,7 @@ ;; CHECK-TEXT: (type $=>eqref (func (result eqref))) ;; CHECK-TEXT: (type $f64_=>_ref_null<_->_eqref> (func (param f64) (result (ref null $=>eqref)))) - ;; CHECK-BIN: (type $i32-i32 (func (param i32) (result i32))) - - ;; CHECK-BIN: (type $3 (func (result i32 (ref null $mixed_results) f64))) - - ;; CHECK-BIN: (type $4 (func (param (ref $i32-i32)) (result i32))) - - ;; CHECK-BIN: (type $5 (func (param (ref null $i32-i32)) (result i32))) - - ;; CHECK-BIN: (type $6 (func (result i32))) - - ;; CHECK-BIN: (type $=>eqref (func (result eqref))) - - ;; CHECK-BIN: (type $f64_=>_ref_null<_->_eqref> (func (param f64) (result (ref null $=>eqref)))) + ;; CHECK-BIN: (type $f64_=>_ref_null<_->_eqref> (func (param f64) (result (ref null $_=>_eqref)))) (type $f64_=>_ref_null<_->_eqref> (func (param f64) (result (ref null $_=>_eqref)))) (type $=>eqref (func (result eqref))) ;; CHECK-TEXT: (type $=>anyref (func (result anyref))) @@ -166,7 +165,7 @@ ;; CHECK-TEXT: (func $ref-in-sig (type $f64_=>_ref_null<_->_eqref>) (param $0 f64) (result (ref null $=>eqref)) ;; CHECK-TEXT-NEXT: (ref.null nofunc) ;; CHECK-TEXT-NEXT: ) - ;; CHECK-BIN: (func $ref-in-sig (type $f64_=>_ref_null<_->_eqref>) (param $0 f64) (result (ref null $=>eqref)) + ;; CHECK-BIN: (func $ref-in-sig (type $f64_=>_ref_null<_->_eqref>) (param $0 f64) (result (ref null $_=>_eqref)) ;; CHECK-BIN-NEXT: (ref.null nofunc) ;; CHECK-BIN-NEXT: ) (func $ref-in-sig (param $0 f64) (result (ref null $=>eqref)) |