diff options
author | Thomas Lively <tlively@google.com> | 2023-04-04 11:33:15 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-04 11:33:15 -0700 |
commit | a802fbe07c270f510c87dfa93577bd4731c075f3 (patch) | |
tree | 4c67b39ced46258593f6904bba4a5ac20292886c /test/lit/ctor-eval | |
parent | 05e1183954e49f8b3a1669cc7973af590afe9fc3 (diff) | |
download | binaryen-a802fbe07c270f510c87dfa93577bd4731c075f3.tar.gz binaryen-a802fbe07c270f510c87dfa93577bd4731c075f3.tar.bz2 binaryen-a802fbe07c270f510c87dfa93577bd4731c075f3.zip |
Use Names instead of indices to identify segments (#5618)
All top-level Module elements are identified and referred to by Name, but for
historical reasons element and data segments were referred to by index instead.
Fix this inconsistency by using Names to refer to segments from expressions that
use them. Also parse and print segment names like we do for other elements.
The C API is partially converted to use names instead of indices, but there are
still many functions that refer to data segments by index. Finishing the
conversion can be done in the future once it becomes necessary.
Diffstat (limited to 'test/lit/ctor-eval')
-rw-r--r-- | test/lit/ctor-eval/data_drop.wast | 6 | ||||
-rw-r--r-- | test/lit/ctor-eval/table.wat | 2 | ||||
-rw-r--r-- | test/lit/ctor-eval/v128.wast | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/test/lit/ctor-eval/data_drop.wast b/test/lit/ctor-eval/data_drop.wast index eeec5f165..4a1fcae1a 100644 --- a/test/lit/ctor-eval/data_drop.wast +++ b/test/lit/ctor-eval/data_drop.wast @@ -23,9 +23,9 @@ (data.drop 1) ) ) -;; CHECK: (data (i32.const 0) "__________") +;; CHECK: (data $0 (i32.const 0) "__________") -;; CHECK: (data (i32.const 20) "__________") +;; CHECK: (data $1 (i32.const 20) "__________") ;; CHECK: (export "test" (func $0)) @@ -34,5 +34,5 @@ ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: (i32.const 100) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (data.drop 1) +;; CHECK-NEXT: (data.drop $1) ;; CHECK-NEXT: ) diff --git a/test/lit/ctor-eval/table.wat b/test/lit/ctor-eval/table.wat index 055de67b0..76e9a44af 100644 --- a/test/lit/ctor-eval/table.wat +++ b/test/lit/ctor-eval/table.wat @@ -10,7 +10,7 @@ (elem (i32.const 0) $nop) - ;; CHECK: (elem (i32.const 0) $nop) + ;; CHECK: (elem $0 (i32.const 0) $nop) ;; CHECK: (elem declare func $trap) diff --git a/test/lit/ctor-eval/v128.wast b/test/lit/ctor-eval/v128.wast index 1d6cf6947..b3b8c98b3 100644 --- a/test/lit/ctor-eval/v128.wast +++ b/test/lit/ctor-eval/v128.wast @@ -9,7 +9,7 @@ ;; CHECK: (memory $0 (shared 16 17)) (memory $0 (shared 16 17)) - ;; CHECK: (data (i32.const 23) "\e0\ff\c0N\8e\00\00\fe\01\00\12\81\85\fd\ff\90") + ;; CHECK: (data $0 (i32.const 23) "\e0\ff\c0N\8e\00\00\fe\01\00\12\81\85\fd\ff\90") ;; CHECK: (export "v128" (func $v128_0)) (export "v128" (func $v128)) |