Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test.undo
  • Loading branch information
kripken committed May 30, 2024
commit 5832079f3c8c3989ab484b02da2f9ce5d5af482f
42 changes: 20 additions & 22 deletions test/lit/passes/type-ssa_and_merging.wast
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,24 @@
;; can.

(module
(type $A (sub (struct (field (mut i32)))))

;; NOP: (rec
;; NOP-NEXT: (type $0 (func (param (ref $A_1)) (result i32)))

;; NOP: (type $A_1 (sub (struct (field i32))))

;; NOP: (type $2 (func (result i32)))
;; NOP-NEXT: (type $0 (func (param (ref $A)) (result i32)))

;; NOP: (import "a" "b" (func $import (type $2) (result i32)))
;; NOP: (type $A (sub (struct (field i32))))
;; YES: (type $0 (func (result i32)))

;; YES: (rec
;; YES-NEXT: (type $1 (func (param (ref $A_3))))
;; YES-NEXT: (type $1 (func (param (ref $A))))

;; YES: (type $A_3 (sub (struct )))
;; YES: (type $A (sub (struct )))
(type $A (sub (struct (field (mut i32)))))

;; YES: (type $A_2_1 (sub $A_3 (struct )))
;; NOP: (type $2 (func (result i32)))

;; NOP: (import "a" "b" (func $import (type $2) (result i32)))
;; YES: (type $A_2 (sub $A (struct )))

;; YES: (type $A_1_1 (sub $A_3 (struct )))
;; YES: (type $A_1 (sub $A (struct )))

;; YES: (import "a" "b" (func $import (type $0) (result i32)))
(import "a" "b" (func $import (result i32)))
Expand All @@ -37,7 +35,7 @@

;; NOP: (func $main1 (type $2) (result i32)
;; NOP-NEXT: (call $get-a-1
;; NOP-NEXT: (struct.new $A_1
;; NOP-NEXT: (struct.new $A
;; NOP-NEXT: (i32.const 42)
;; NOP-NEXT: )
;; NOP-NEXT: )
Expand All @@ -48,7 +46,7 @@

;; YES: (func $main1 (type $0) (result i32)
;; YES-NEXT: (call $get-a-1
;; YES-NEXT: (struct.new_default $A_3)
;; YES-NEXT: (struct.new_default $A)
;; YES-NEXT: )
;; YES-NEXT: (i32.const 42)
;; YES-NEXT: )
Expand All @@ -61,14 +59,14 @@

;; NOP: (func $main2 (type $2) (result i32)
;; NOP-NEXT: (call $get-a-2
;; NOP-NEXT: (struct.new $A_1
;; NOP-NEXT: (struct.new $A
;; NOP-NEXT: (i32.const 1337)
;; NOP-NEXT: )
;; NOP-NEXT: )
;; NOP-NEXT: )
;; YES: (func $main2 (type $0) (result i32)
;; YES-NEXT: (call $get-a-2
;; YES-NEXT: (struct.new_default $A_3)
;; YES-NEXT: (struct.new_default $A)
;; YES-NEXT: )
;; YES-NEXT: (i32.const 1337)
;; YES-NEXT: )
Expand All @@ -79,7 +77,7 @@
)
)

;; NOP: (func $get-a-1 (type $0) (param $0 (ref $A_1)) (result i32)
;; NOP: (func $get-a-1 (type $0) (param $0 (ref $A)) (result i32)
;; NOP-NEXT: (if
;; NOP-NEXT: (call $import)
;; NOP-NEXT: (then
Expand All @@ -90,11 +88,11 @@
;; NOP-NEXT: )
;; NOP-NEXT: )
;; NOP-NEXT: )
;; NOP-NEXT: (struct.get $A_1 0
;; NOP-NEXT: (struct.get $A 0
;; NOP-NEXT: (local.get $0)
;; NOP-NEXT: )
;; NOP-NEXT: )
;; YES: (func $get-a-1 (type $1) (param $0 (ref $A_3))
;; YES: (func $get-a-1 (type $1) (param $0 (ref $A))
;; YES-NEXT: (if
;; YES-NEXT: (call $import)
;; YES-NEXT: (then
Expand All @@ -121,7 +119,7 @@
(struct.get $A 0 (local.get 0))
)

;; NOP: (func $get-a-2 (type $0) (param $0 (ref $A_1)) (result i32)
;; NOP: (func $get-a-2 (type $0) (param $0 (ref $A)) (result i32)
;; NOP-NEXT: (if
;; NOP-NEXT: (call $import)
;; NOP-NEXT: (then
Expand All @@ -132,11 +130,11 @@
;; NOP-NEXT: )
;; NOP-NEXT: )
;; NOP-NEXT: )
;; NOP-NEXT: (struct.get $A_1 0
;; NOP-NEXT: (struct.get $A 0
;; NOP-NEXT: (local.get $0)
;; NOP-NEXT: )
;; NOP-NEXT: )
;; YES: (func $get-a-2 (type $1) (param $0 (ref $A_3))
;; YES: (func $get-a-2 (type $1) (param $0 (ref $A))
;; YES-NEXT: (if
;; YES-NEXT: (call $import)
;; YES-NEXT: (then
Expand Down
Loading