diff options
Diffstat (limited to 'test/lit/passes')
-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) + ) + ) +) |