diff options
author | Thomas Lively <tlively@google.com> | 2024-01-08 11:46:30 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-08 11:46:30 -0800 |
commit | cc0fab918aed3643abdc3566ade3f70f06d1d954 (patch) | |
tree | 923fe1e125e7b4f95c2dfa20e4525f1c10a190f2 /test/lit/passes/remove-unused-module-elements_all-features.wast | |
parent | 82057de7666b84424f8d2bd90e941762e4e14f0e (diff) | |
download | binaryen-cc0fab918aed3643abdc3566ade3f70f06d1d954.tar.gz binaryen-cc0fab918aed3643abdc3566ade3f70f06d1d954.tar.bz2 binaryen-cc0fab918aed3643abdc3566ade3f70f06d1d954.zip |
Fix incorrect wat in tests (#6207)
The new wat parser is much more strict than the legacy wat parser; the latter
accepts all sorts of things that the spec does not allow. To ease an eventual
transition to using the new wat parser by default, update the tests to use the
standard text format in many places where they previously did not. We do not yet
have a way to prevent new errors from being introduced into the test suite, but
at least there will now be many fewer errors when it comes time to make the
switch.
Diffstat (limited to 'test/lit/passes/remove-unused-module-elements_all-features.wast')
-rw-r--r-- | test/lit/passes/remove-unused-module-elements_all-features.wast | 47 |
1 files changed, 18 insertions, 29 deletions
diff --git a/test/lit/passes/remove-unused-module-elements_all-features.wast b/test/lit/passes/remove-unused-module-elements_all-features.wast index c964d8c28..23f018787 100644 --- a/test/lit/passes/remove-unused-module-elements_all-features.wast +++ b/test/lit/passes/remove-unused-module-elements_all-features.wast @@ -35,9 +35,9 @@ (type $2-dupe (func (param i32) (result i32))) (type $2-thrupe (func (param i32) (result i32))) (export "memory" (memory $0)) - (export "exported" $exported) - (export "other1" $other1) - (export "other2" $other2) + (export "exported" (func $exported)) + (export "other1" (func $other1)) + (export "other2" (func $other2)) (table 1 1 funcref) (elem (i32.const 0) $called_indirect) ;; CHECK: (func $start (type $0) @@ -237,11 +237,10 @@ ;; CHECK: (import "env" "memory" (memory $0 256)) (import "env" "memory" (memory $0 256)) (import "env" "table" (table 0 funcref)) - (export "user" $user) ;; CHECK: (import "env" "table" (table $timport$0 0 funcref)) ;; CHECK: (export "user" (func $user)) - + (export "user" (func $user)) ;; CHECK: (func $user (type $0) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.load @@ -262,9 +261,8 @@ ;; CHECK: (memory $0 23 256 shared) (memory $0 23 256 shared) - (export "user" $user) ;; CHECK: (export "user" (func $user)) - + (export "user" (func $user)) ;; CHECK: (func $user (type $0) ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 0) @@ -280,9 +278,8 @@ ;; CHECK: (memory $0 23 256 shared) (memory $0 23 256 shared) - (export "user" $user) ;; CHECK: (export "user" (func $user)) - + (export "user" (func $user)) ;; CHECK: (func $user (type $0) (result i32) ;; CHECK-NEXT: (i32.atomic.rmw.add ;; CHECK-NEXT: (i32.const 0) @@ -298,9 +295,8 @@ ;; CHECK: (memory $0 23 256 shared) (memory $0 23 256 shared) - (export "user" $user) ;; CHECK: (export "user" (func $user)) - + (export "user" (func $user)) ;; CHECK: (func $user (type $0) (result i32) ;; CHECK-NEXT: (i32.atomic.rmw8.cmpxchg_u ;; CHECK-NEXT: (i32.const 0) @@ -317,9 +313,8 @@ ;; CHECK: (memory $0 23 256 shared) (memory $0 23 256 shared) - (export "user" $user) ;; CHECK: (export "user" (func $user)) - + (export "user" (func $user)) ;; CHECK: (func $user (type $0) ;; CHECK-NEXT: (local $0 i32) ;; CHECK-NEXT: (local $1 i64) @@ -348,9 +343,8 @@ ;; CHECK: (memory $0 23 256 shared) (memory $0 23 256 shared) - (export "user" $user) ;; CHECK: (export "user" (func $user)) - + (export "user" (func $user)) ;; CHECK: (func $user (type $0) (result i32) ;; CHECK-NEXT: (memory.atomic.notify ;; CHECK-NEXT: (i32.const 0) @@ -364,13 +358,12 @@ (module ;; atomic.fence and data.drop do not use a memory, so should not keep the memory alive. (memory $0 1 1 shared) (data "") - (export "fake-user" $user) ;; CHECK: (type $0 (func)) ;; CHECK: (data $0 "") ;; CHECK: (export "fake-user" (func $user)) - + (export "fake-user" (func $user)) ;; CHECK: (func $user (type $0) ;; CHECK-NEXT: (atomic.fence) ;; CHECK-NEXT: (data.drop $0) @@ -389,9 +382,8 @@ (memory $1 23 256) (memory $unused 1 1) - (export "user" $user) ;; CHECK: (export "user" (func $user)) - + (export "user" (func $user)) ;; CHECK: (func $user (type $0) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (memory.grow $0 @@ -414,9 +406,8 @@ ;; CHECK: (memory $0 23 256) (memory $0 23 256) - (export "user" $user) ;; CHECK: (export "user" (func $user)) - + (export "user" (func $user)) ;; CHECK: (func $user (type $0) (result i32) ;; CHECK-NEXT: (memory.size) ;; CHECK-NEXT: ) @@ -432,9 +423,8 @@ ;; CHECK: (memory $1 1 1) (memory $1 1 1) (memory $unused 1 1) - (export "user" $user) ;; CHECK: (export "user" (func $user)) - + (export "user" (func $user)) ;; CHECK: (func $user (type $0) ;; CHECK-NEXT: (memory.copy $0 $1 ;; CHECK-NEXT: (i32.const 0) @@ -620,17 +610,17 @@ (table $defined-used 6 6 funcref) ;; CHECK: (elem $active1 (table $written) (i32.const 0) func $0) - (elem $active1 (table $written) (i32.const 0) $0) + (elem $active1 (table $written) (i32.const 0) func $0) ;; This empty active segment doesn't keep the unwritten table alive. - (elem $active2 (table $unwritten) (i32.const 0)) + (elem $active2 (table $unwritten) (i32.const 0) func) - (elem $active3 (table $defined-unused) (i32.const 0) $0) + (elem $active3 (table $defined-unused) (i32.const 0) func $0) ;; CHECK: (elem $active4 (table $defined-used) (i32.const 0) func $0) - (elem $active4 (table $defined-used) (i32.const 0) $0) + (elem $active4 (table $defined-used) (i32.const 0) func $0) - (elem $active5 (table $defined-used) (i32.const 0)) + (elem $active5 (table $defined-used) (i32.const 0) func) ;; CHECK: (func $0 (type $0) (param $var$0 f64) (result f64) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (table.get $defined-used @@ -748,7 +738,6 @@ (array.new_elem $array 1 (i32.const 0) (i32.const 0) - (i32.const 0) ) ) ) |