diff options
author | Alon Zakai <azakai@google.com> | 2022-08-23 13:02:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-23 13:02:52 -0700 |
commit | 594ff7b9609656edb83187cb4600b23b3f2fde37 (patch) | |
tree | c035a76773822331241df3c991d2accc5006f756 /test/lit/passes/dae_tnh.wast | |
parent | 0ee15961e43e0282b014e4328458e065b6976ba7 (diff) | |
download | binaryen-594ff7b9609656edb83187cb4600b23b3f2fde37.tar.gz binaryen-594ff7b9609656edb83187cb4600b23b3f2fde37.tar.bz2 binaryen-594ff7b9609656edb83187cb4600b23b3f2fde37.zip |
Only look at the relevant parameter in param-utils:removeParameter (#4937)
Followup to #4910.
Diffstat (limited to 'test/lit/passes/dae_tnh.wast')
-rw-r--r-- | test/lit/passes/dae_tnh.wast | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/lit/passes/dae_tnh.wast b/test/lit/passes/dae_tnh.wast index 2a9fb912d..e8163150d 100644 --- a/test/lit/passes/dae_tnh.wast +++ b/test/lit/passes/dae_tnh.wast @@ -80,3 +80,41 @@ (func $target (param i32) ) ) + +(module + ;; CHECK: (type $i32_=>_none (func (param i32))) + + ;; CHECK: (type $none_=>_none (func)) + + ;; CHECK: (func $target (param $0 i32) + ;; CHECK-NEXT: (local $1 f64) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (f64.const 4.2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $target (param $used i32) (param $unused f64) + ;; One parameter is used, and one is not. + (drop + (local.get $used) + ) + ) + + ;; CHECK: (func $caller + ;; CHECK-NEXT: (call $target + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $caller + ;; There is an unreachable parameter, and as in the cases above, we can't + ;; remove it as it would change the type. But it isn't the param we want to + ;; remove here, so we can optimize: we'll remove the other param, and leave + ;; the unreachable, and the type does not change. + (call $target + (unreachable) + (f64.const 4.2) + ) + ) +) |