Skip to content

Commit

Permalink
reorder test
Browse files Browse the repository at this point in the history
  • Loading branch information
tlively committed Jan 21, 2025
1 parent ec23099 commit 8566db9
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions test/lit/passes/remove-unused-types-public-tags.wast
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,34 @@

;; RUN: foreach %s %t wasm-opt --remove-unused-types --closed-world -all -S -o - | filecheck %s

;; Imported tag.
;; Neither imported nor exported tag. The tag type is private.
(module
;; CHECK: (type $tag-type (func))
(type $tag-type (func))
;; CHECK: (rec
;; CHECK-NEXT: (type $other-2 (struct (field i8)))

;; CHECK: (type $other-1 (struct))

;; CHECK: (type $tag-type (func))
(type $tag-type (func))
(type $other-1 (struct))
(type $other-2 (struct (field i8)))

(tag $imported (import "" "") (type $tag-type))
;; CHECK: (global $tag-type (ref null $tag-type) (ref.null nofunc))

;; Use all the types.
;; CHECK: (import "" "" (tag $imported (type $tag-type)))
;; CHECK: (global $other-1 (ref null $other-1) (ref.null none))

;; CHECK: (global $tag-type (ref null $tag-type) (ref.null nofunc))
;; CHECK: (global $other-2 (ref null $other-2) (ref.null none))

;; CHECK: (tag $exported (type $tag-type))
(tag $exported (type $tag-type))

;; Use all the types.
(global $tag-type (ref null $tag-type) (ref.null nofunc))
;; CHECK: (global $other-1 (ref null $other-1) (ref.null none))
(global $other-1 (ref null $other-1) (ref.null none))
;; CHECK: (global $other-2 (ref null $other-2) (ref.null none))
(global $other-2 (ref null $other-2) (ref.null none))
)

;; Exported tag.
;; Imported tag.
(module
;; CHECK: (type $tag-type (func))
(type $tag-type (func))
Expand All @@ -40,31 +43,27 @@
(type $other-1 (struct))
(type $other-2 (struct (field i8)))

;; CHECK: (global $tag-type (ref null $tag-type) (ref.null nofunc))

;; CHECK: (global $other-1 (ref null $other-1) (ref.null none))

;; CHECK: (global $other-2 (ref null $other-2) (ref.null none))

;; CHECK: (tag $exported (type $tag-type))
(tag $exported (export "") (type $tag-type))
(tag $imported (import "" "") (type $tag-type))

;; Use all the types.
;; CHECK: (import "" "" (tag $imported (type $tag-type)))

;; CHECK: (global $tag-type (ref null $tag-type) (ref.null nofunc))
(global $tag-type (ref null $tag-type) (ref.null nofunc))
;; CHECK: (global $other-1 (ref null $other-1) (ref.null none))
(global $other-1 (ref null $other-1) (ref.null none))
;; CHECK: (global $other-2 (ref null $other-2) (ref.null none))
(global $other-2 (ref null $other-2) (ref.null none))
)

;; Neither imported nor exported tag. Now the tag type is private.
;; CHECK: (export "" (tag $exported))
;; Exported tag.
(module
;; CHECK: (type $tag-type (func))
(type $tag-type (func))
;; CHECK: (rec
;; CHECK-NEXT: (type $other-2 (struct (field i8)))

;; CHECK: (type $other-1 (struct))

;; CHECK: (type $tag-type (func))
(type $tag-type (func))
(type $other-1 (struct))
(type $other-2 (struct (field i8)))

Expand All @@ -75,10 +74,11 @@
;; CHECK: (global $other-2 (ref null $other-2) (ref.null none))

;; CHECK: (tag $exported (type $tag-type))
(tag $exported (type $tag-type))
(tag $exported (export "") (type $tag-type))

;; Use all the types.
(global $tag-type (ref null $tag-type) (ref.null nofunc))
(global $other-1 (ref null $other-1) (ref.null none))
(global $other-2 (ref null $other-2) (ref.null none))
)
;; CHECK: (export "" (tag $exported))

0 comments on commit 8566db9

Please sign in to comment.