diff options
author | Alon Zakai <azakai@google.com> | 2023-09-18 15:51:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-18 15:51:14 -0700 |
commit | 6d2364b55e4c81b0b2f7d15778619c40d1ded4d3 (patch) | |
tree | 9dbb7c84337e5e9ded5076b80bd90871e03660cc /test | |
parent | 08528e7947c141d09a69c30cb558c9ec3698e771 (diff) | |
download | binaryen-6d2364b55e4c81b0b2f7d15778619c40d1ded4d3.tar.gz binaryen-6d2364b55e4c81b0b2f7d15778619c40d1ded4d3.tar.bz2 binaryen-6d2364b55e4c81b0b2f7d15778619c40d1ded4d3.zip |
TupleOptimization: Handle copies of different types in unreachable code (#5956)
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/passes/tuple-optimization.wast | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/lit/passes/tuple-optimization.wast b/test/lit/passes/tuple-optimization.wast index 1788b91e9..766f51e81 100644 --- a/test/lit/passes/tuple-optimization.wast +++ b/test/lit/passes/tuple-optimization.wast @@ -569,6 +569,7 @@ ;; CHECK: (func $unreachability (type $0) ;; CHECK-NEXT: (local $tuple (i32 i32)) + ;; CHECK-NEXT: (local $nontuple f64) ;; CHECK-NEXT: (local.set $tuple ;; CHECK-NEXT: (tuple.make ;; CHECK-NEXT: (i32.const 1) @@ -590,9 +591,17 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.tee $tuple + ;; CHECK-NEXT: (local.tee $nontuple + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $unreachability (local $tuple (i32 i32)) + (local $nontuple f64) (local.set $tuple (tuple.make (i32.const 1) @@ -615,6 +624,17 @@ ) ) ) + ;; Teeing a nontuple into a tuple is allowed in unreachable code (the input + ;; to the outer tee is simply unreachable, so there is no checking that we + ;; are copying a local into another local of a compatible type). We should + ;; not error here. + (drop + (local.tee $tuple + (local.tee $nontuple + (unreachable) + ) + ) + ) ) ;; CHECK: (func $tee-chain (type $0) |