summaryrefslogtreecommitdiff
path: root/test/lit/passes/local-cse.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/passes/local-cse.wast')
-rw-r--r--test/lit/passes/local-cse.wast36
1 files changed, 35 insertions, 1 deletions
diff --git a/test/lit/passes/local-cse.wast b/test/lit/passes/local-cse.wast
index 8b0f51a7c..4f6156dba 100644
--- a/test/lit/passes/local-cse.wast
+++ b/test/lit/passes/local-cse.wast
@@ -11,7 +11,9 @@
;; CHECK: (type $2 (func (param i32)))
- ;; CHECK: (type $3 (func (result i64)))
+ ;; CHECK: (type $3 (func (result i32)))
+
+ ;; CHECK: (type $4 (func (result i64)))
;; CHECK: (memory $0 100 100)
@@ -356,6 +358,38 @@
)
)
+ ;; CHECK: (func $nested-calls (result i32)
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (i32.add
+ ;; CHECK-NEXT: (call $nested-calls)
+ ;; CHECK-NEXT: (call $nested-calls)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (drop
+ ;; CHECK-NEXT: (i32.add
+ ;; CHECK-NEXT: (call $nested-calls)
+ ;; CHECK-NEXT: (call $nested-calls)
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: )
+ ;; CHECK-NEXT: (unreachable)
+ ;; CHECK-NEXT: )
+ (func $nested-calls (result i32)
+ ;; Operations that include nested effects are ignored.
+ (drop
+ (i32.add
+ (call $nested-calls)
+ (call $nested-calls)
+ )
+ )
+ (drop
+ (i32.add
+ (call $nested-calls)
+ (call $nested-calls)
+ )
+ )
+ (unreachable)
+ )
+
;; CHECK: (func $many-sets (result i64)
;; CHECK-NEXT: (local $temp i64)
;; CHECK-NEXT: (local $1 i64)