diff options
author | Thomas Lively <tlively@google.com> | 2024-07-12 13:02:00 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-12 10:02:00 -0700 |
commit | c0286b61a0eedde936ce1adff4284859ce4c6510 (patch) | |
tree | 109c9f7fcf5beb803a8df8aa5f9bfab2160d7dcd /test/lit/passes | |
parent | 22c28bd5a108f9bdacd1b60468e312903bcdf451 (diff) | |
download | binaryen-c0286b61a0eedde936ce1adff4284859ce4c6510.tar.gz binaryen-c0286b61a0eedde936ce1adff4284859ce4c6510.tar.bz2 binaryen-c0286b61a0eedde936ce1adff4284859ce4c6510.zip |
Do not abbreviate items in element segments (#6737)
The full syntax for an expression in an element syntax looks like
`(item (ref.null none))`, but we have been printing the abbreviated
version, which omits the `(item ...)`. This abbreviation is only valid
when the item has only a single instruction, so it is not always correct
to use it. Rather than determining whether or not to use the
abbreviation on a case-by-case basis, always print the full syntax.
Diffstat (limited to 'test/lit/passes')
-rw-r--r-- | test/lit/passes/optimize-instructions-call_ref-roundtrip.wast | 6 | ||||
-rw-r--r-- | test/lit/passes/optimize-instructions-call_ref.wast | 2 | ||||
-rw-r--r-- | test/lit/passes/table64-lowering.wast | 4 | ||||
-rw-r--r-- | test/lit/passes/unsubtyping.wast | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/test/lit/passes/optimize-instructions-call_ref-roundtrip.wast b/test/lit/passes/optimize-instructions-call_ref-roundtrip.wast index 6fdcae0b2..05f03110c 100644 --- a/test/lit/passes/optimize-instructions-call_ref-roundtrip.wast +++ b/test/lit/passes/optimize-instructions-call_ref-roundtrip.wast @@ -33,15 +33,15 @@ ;; CHECK: (table $table-3 10 (ref null $v3)) (table $table-3 10 (ref null $v3)) - ;; CHECK: (elem $elem-1 (table $table-1) (i32.const 0) (ref null $v1) (ref.func $helper-1)) + ;; CHECK: (elem $elem-1 (table $table-1) (i32.const 0) (ref null $v1) (item (ref.func $helper-1))) (elem $elem-1 (table $table-1) (i32.const 0) (ref null $v1) (ref.func $helper-1)) - ;; CHECK: (elem $elem-2 (table $table-2) (i32.const 0) (ref null $v2) (ref.func $helper-2)) + ;; CHECK: (elem $elem-2 (table $table-2) (i32.const 0) (ref null $v2) (item (ref.func $helper-2))) (elem $elem-2 (table $table-2) (i32.const 0) (ref null $v2) (ref.func $helper-2)) - ;; CHECK: (elem $elem-3 (table $table-3) (i32.const 0) (ref null $v3) (ref.func $helper-3)) + ;; CHECK: (elem $elem-3 (table $table-3) (i32.const 0) (ref null $v3) (item (ref.func $helper-3))) (elem $elem-3 (table $table-3) (i32.const 0) (ref null $v3) (ref.func $helper-3)) diff --git a/test/lit/passes/optimize-instructions-call_ref.wast b/test/lit/passes/optimize-instructions-call_ref.wast index 91aba5fed..937fbe6a7 100644 --- a/test/lit/passes/optimize-instructions-call_ref.wast +++ b/test/lit/passes/optimize-instructions-call_ref.wast @@ -23,7 +23,7 @@ ;; CHECK: (table $table-1 10 (ref null $i32_i32_=>_none)) (table $table-1 10 (ref null $i32_i32_=>_none)) - ;; CHECK: (elem $elem-1 (table $table-1) (i32.const 0) (ref null $i32_i32_=>_none) (ref.func $foo)) + ;; CHECK: (elem $elem-1 (table $table-1) (i32.const 0) (ref null $i32_i32_=>_none) (item (ref.func $foo))) (elem $elem-1 (table $table-1) (i32.const 0) (ref null $i32_i32_=>_none) (ref.func $foo)) diff --git a/test/lit/passes/table64-lowering.wast b/test/lit/passes/table64-lowering.wast index 19d51eec5..7e49d3e73 100644 --- a/test/lit/passes/table64-lowering.wast +++ b/test/lit/passes/table64-lowering.wast @@ -12,11 +12,11 @@ ;; CHECK: (table $t32 10 100 funcref) - ;; CHECK: (elem $elem64 (table $t64) (i32.const 0) funcref (ref.null nofunc)) + ;; CHECK: (elem $elem64 (table $t64) (i32.const 0) funcref (item (ref.null nofunc))) (elem $elem64 (table $t64) (i64.const 0) funcref (ref.null func)) (table $t32 10 100 funcref) - ;; CHECK: (elem $elem32 (table $t32) (i32.const 0) funcref (ref.null nofunc)) + ;; CHECK: (elem $elem32 (table $t32) (i32.const 0) funcref (item (ref.null nofunc))) (elem $elem32 (table $t32) (i32.const 0) funcref (ref.null func)) ;; CHECK: (func $test_call_indirect diff --git a/test/lit/passes/unsubtyping.wast b/test/lit/passes/unsubtyping.wast index 368f935b9..65d4d6a48 100644 --- a/test/lit/passes/unsubtyping.wast +++ b/test/lit/passes/unsubtyping.wast @@ -103,7 +103,7 @@ ;; An active element segment requires subtyping. So does an element segment ;; element. - ;; CHECK: (elem $e (table $t) (i32.const 0) (ref null $sub) (struct.new_default $subsub)) + ;; CHECK: (elem $e (table $t) (i32.const 0) (ref null $sub) (item (struct.new_default $subsub))) (elem $e (table $t) (offset (i32.const 0)) (ref null $sub) (struct.new $subsub)) ) |