Skip to content

Commit

Permalink
yay
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleynh committed Nov 16, 2023
1 parent 3abce53 commit 932048f
Showing 1 changed file with 37 additions and 31 deletions.
68 changes: 37 additions & 31 deletions test/lit/passes/outlining.wast
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )

;; CHECK: (func $outline$ (param $0 i32)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.const 2)
;; CHECK-NEXT: )
;; CHECK-NEXT: )

;; CHECK: (func $c
;; CHECK: (func $a
;; CHECK-NEXT: (call $outline$)
;; CHECK-NEXT: )
(func $a
Expand All @@ -106,7 +94,7 @@
(i32.const 2)
)
)
;; CHECK: (func $d
;; CHECK: (func $b
;; CHECK-NEXT: (call $outline$)
;; CHECK-NEXT: )
(func $b
Expand Down Expand Up @@ -139,7 +127,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )

;; CHECK: (func $e
;; CHECK: (func $a
;; CHECK-NEXT: (call $outline$)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.const 6)
Expand All @@ -162,7 +150,7 @@
(i32.const 6)
)
)
;; CHECK: (func $f
;; CHECK: (func $b
;; CHECK-NEXT: (call $outline$)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.const 7)
Expand Down Expand Up @@ -190,6 +178,18 @@
;; Tests multiple sequences being outlined from the same source function into different
;; outlined functions.
(module
;; CHECK: (type $0 (func))

;; CHECK: (func $outline$
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.add
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )

;; CHECK: (func $outline$_4
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.sub
;; CHECK-NEXT: (i32.const 3)
Expand All @@ -198,7 +198,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )

;; CHECK: (func $g
;; CHECK: (func $a
;; CHECK-NEXT: (call $outline$)
;; CHECK-NEXT: (call $outline$_4)
;; CHECK-NEXT: )
Expand All @@ -216,6 +216,9 @@
)
)
)
;; CHECK: (func $b
;; CHECK-NEXT: (call $outline$_4)
;; CHECK-NEXT: )
(func $b
(drop
(i32.sub
Expand All @@ -224,6 +227,9 @@
)
)
)
;; CHECK: (func $c
;; CHECK-NEXT: (call $outline$)
;; CHECK-NEXT: )
(func $c
(drop
(i32.add
Expand Down Expand Up @@ -288,28 +294,28 @@
(module
;; CHECK: (type $0 (func (param i32)))

;; CHECK: (func $j (param $0 i32)
;; CHECK: (func $a (param $0 i32)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.add
;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $j (param i32)
(func $a (param i32)
(drop (i32.add
(local.get 0)
(i32.const 1)))
)
;; CHECK: (func $k (param $0 i32)
;; CHECK: (func $b (param $0 i32)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.add
;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $k (param i32)
(func $b (param i32)
(drop (i32.add
(local.get 0)
(i32.const 1)))
Expand All @@ -320,24 +326,24 @@
(module
;; CHECK: (type $0 (func))

;; CHECK: (func $l
;; CHECK: (func $a
;; CHECK-NEXT: (local $i i32)
;; CHECK-NEXT: (local.set $i
;; CHECK-NEXT: (i32.const 7)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $l
(func $a
(local $i i32)
(local.set $i
(i32.const 7))
)
;; CHECK: (func $m
;; CHECK: (func $b
;; CHECK-NEXT: (local $i i32)
;; CHECK-NEXT: (local.set $i
;; CHECK-NEXT: (i32.const 7)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $m
(func $b
(local $i i32)
(local.set $i
(i32.const 7))
Expand All @@ -348,7 +354,7 @@
(module
;; CHECK: (type $0 (func))

;; CHECK: (func $n
;; CHECK: (func $a
;; CHECK-NEXT: (block $label1
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.const 4)
Expand All @@ -360,7 +366,7 @@
;; CHECK-NEXT: (br $label1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $n
(func $a
(block $label1
(drop (i32.const 4))
(br $label1)
Expand All @@ -374,20 +380,20 @@
(module
;; CHECK: (type $0 (func (result i32)))

;; CHECK: (func $o (result i32)
;; CHECK: (func $a (result i32)
;; CHECK-NEXT: (return
;; CHECK-NEXT: (i32.const 2)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $o (result i32)
(func $a (result i32)
(return (i32.const 2))
)
;; CHECK: (func $p (result i32)
;; CHECK: (func $b (result i32)
;; CHECK-NEXT: (return
;; CHECK-NEXT: (i32.const 2)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $p (result i32)
(func $b (result i32)
(return (i32.const 2))
)
)

0 comments on commit 932048f

Please sign in to comment.