diff options
author | Thomas Lively <tlively@google.com> | 2022-10-18 13:54:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-18 13:54:22 -0500 |
commit | 8377174c3bb56b58cda054b3210799439004e229 (patch) | |
tree | 0d172db76ef1409b4c2e4134a39e1418dfbb52fc /test/lit/binary/annotated-array-len.test | |
parent | 6bef18672fae68ee4976a7b26f277f6caa32734f (diff) | |
download | binaryen-8377174c3bb56b58cda054b3210799439004e229.tar.gz binaryen-8377174c3bb56b58cda054b3210799439004e229.tar.bz2 binaryen-8377174c3bb56b58cda054b3210799439004e229.zip |
Parse and emit `array.len` without a type annotation (#5151)
Test that we can still parse the old annotated form as well.
Diffstat (limited to 'test/lit/binary/annotated-array-len.test')
-rw-r--r-- | test/lit/binary/annotated-array-len.test | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/lit/binary/annotated-array-len.test b/test/lit/binary/annotated-array-len.test new file mode 100644 index 000000000..a8eb08fe7 --- /dev/null +++ b/test/lit/binary/annotated-array-len.test @@ -0,0 +1,18 @@ +;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. + +;; Test the we can properly parse the annotated array.len format that we no +;; longer emit. + +;; RUN: wasm-dis %s.wasm -all --nominal | filecheck %s + +;; CHECK: (type $none_=>_i32 (func_subtype (result i32) func)) + +;; CHECK: (type $[mut:i8] (array_subtype (mut i8) data)) + +;; CHECK: (func $0 (type $none_=>_i32) (result i32) +;; CHECK-NEXT: (array.len +;; CHECK-NEXT: (array.new_default $[mut:i8] +;; CHECK-NEXT: (i32.const 0) +;; CHECK-NEXT: ) +;; CHECK-NEXT: ) +;; CHECK-NEXT: ) |