blob: 7bd40a65a1b19c4b77c0c15dcd8164f78c667cf9 [file] [edit]
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
;; RUN: wasm-split %s -all -g -o1 %t.1.wasm -o2 %t.2.wasm --keep-funcs=keep
;; RUN: wasm-dis %t.1.wasm | filecheck %s --check-prefix PRIMARY
;; RUN: wasm-dis %t.2.wasm | filecheck %s --check-prefix SECONDARY
(module
;; PRIMARY: (type $0 (func))
;; PRIMARY: (import "env" "g" (global $g funcref))
(import "env" "g" (global $g funcref))
;; A table used by both $keep and $split.
;; The table stays in PRIMARY. $g should stay in PRIMARY and NOT be
;; exported/imported.
;; PRIMARY: (table $t 1 1 funcref (global.get $g))
(table $t 1 1 funcref (global.get $g))
;; PRIMARY: (export "table" (table $t))
;; PRIMARY: (func $keep
;; PRIMARY-NEXT: (drop
;; PRIMARY-NEXT: (table.get $t
;; PRIMARY-NEXT: (i32.const 0)
;; PRIMARY-NEXT: )
;; PRIMARY-NEXT: )
;; PRIMARY-NEXT: )
(func $keep
(drop
(table.get $t
(i32.const 0)
)
)
)
;; SECONDARY: (type $0 (func))
;; SECONDARY: (import "primary" "table" (table $t 1 1 funcref))
;; SECONDARY: (func $split
;; SECONDARY-NEXT: (drop
;; SECONDARY-NEXT: (table.get $t
;; SECONDARY-NEXT: (i32.const 0)
;; SECONDARY-NEXT: )
;; SECONDARY-NEXT: )
;; SECONDARY-NEXT: )
(func $split
(drop
(table.get $t
(i32.const 0)
)
)
)
)