diff options
author | Jérôme Vouillon <jerome.vouillon@gmail.com> | 2023-08-23 22:47:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-23 13:47:33 -0700 |
commit | 6dad9fb15130515bc7eed60270263f3d8269b60f (patch) | |
tree | 3c5f9982b014d870a3a87d19fa63cf015c7197d6 /test/lit/passes/optimize-instructions-gc-iit.wast | |
parent | f6867f9a485c125dcd2914f58e2636f01879db7b (diff) | |
download | binaryen-6dad9fb15130515bc7eed60270263f3d8269b60f.tar.gz binaryen-6dad9fb15130515bc7eed60270263f3d8269b60f.tar.bz2 binaryen-6dad9fb15130515bc7eed60270263f3d8269b60f.zip |
Use the standard syntax for ref.cast, ref.test and array.new_fixed (#5894)
* Update text output for `ref.cast` and `ref.test`
* Update text output for `array.new_fixed`
* Update tests with new syntax for `ref.cast` and `ref.test`
* Update tests with new `array.new_fixed` syntax
Diffstat (limited to 'test/lit/passes/optimize-instructions-gc-iit.wast')
-rw-r--r-- | test/lit/passes/optimize-instructions-gc-iit.wast | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/test/lit/passes/optimize-instructions-gc-iit.wast b/test/lit/passes/optimize-instructions-gc-iit.wast index e4694f4c7..6a1d7d2a3 100644 --- a/test/lit/passes/optimize-instructions-gc-iit.wast +++ b/test/lit/passes/optimize-instructions-gc-iit.wast @@ -34,7 +34,7 @@ ;; CHECK-NEXT: (local.get $child) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (ref.cast $child + ;; CHECK-NEXT: (ref.cast (ref $child) ;; CHECK-NEXT: (local.get $parent) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -55,7 +55,7 @@ ;; TNH-NEXT: (local.get $child) ;; TNH-NEXT: ) ;; TNH-NEXT: (drop - ;; TNH-NEXT: (ref.cast $child + ;; TNH-NEXT: (ref.cast (ref $child) ;; TNH-NEXT: (local.get $parent) ;; TNH-NEXT: ) ;; TNH-NEXT: ) @@ -76,13 +76,13 @@ ;; a cast of parent to parent. We can optimize this as the new type will be ;; valid. (drop - (ref.cast $parent + (ref.cast (ref $parent) (local.get $parent) ) ) ;; a cast of child to a supertype: again, we replace with a valid type. (drop - (ref.cast $parent + (ref.cast (ref $parent) (local.get $child) ) ) @@ -90,13 +90,13 @@ ;; $child with one that is not equal or more specific, like $parent, so we ;; cannot optimize here. (drop - (ref.cast $child + (ref.cast (ref $child) (local.get $parent) ) ) ;; a cast of child to an unrelated type: it will trap anyhow (drop - (ref.cast $other + (ref.cast (ref $other) (local.get $child) ) ) @@ -139,7 +139,7 @@ ;; optimizing this cast away requires reordering. (drop - (ref.cast $parent + (ref.cast (ref $parent) (block (result (ref $parent)) (call $foo) (local.get $parent) @@ -149,7 +149,7 @@ ;; ignore unreachability (drop - (ref.cast null $parent + (ref.cast (ref null $parent) (unreachable) ) ) @@ -170,7 +170,7 @@ (drop (ref.eq (local.get $x) - (ref.cast null $parent + (ref.cast (ref null $parent) (local.get $x) ) ) @@ -227,14 +227,14 @@ ;; TNH-NEXT: ) (func $test (param $C (ref $C)) (result anyref) (struct.get $B 0 - (ref.cast $B ;; Try to cast a $C to its parent, $B. That always - ;; works, so the cast can be removed. - ;; Then once the cast is removed, the outer struct.get - ;; will have a reference with a different type, - ;; making it a (struct.get $C ..) instead of $B. - ;; But $B and $C have different types on field 0, and - ;; so the struct.get must be refinalized so the node - ;; has the expected type. + (ref.cast (ref $B) ;; Try to cast a $C to its parent, $B. That always + ;; works, so the cast can be removed. + ;; Then once the cast is removed, the outer struct.get + ;; will have a reference with a different type, + ;; making it a (struct.get $C ..) instead of $B. + ;; But $B and $C have different types on field 0, and + ;; so the struct.get must be refinalized so the node + ;; has the expected type. (local.get $C) ) ) |