| ;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. |
| ;; RUN: wasm-split -all -g --multi-split %s --no-placeholders --manifest %S/multi-split.wast.manifest --out-prefix=%t -o %t.wasm |
| ;; RUN: wasm-dis %t.wasm | filecheck %s --check-prefix=PRIMARY |
| ;; RUN: wasm-dis %t1.wasm | filecheck %s --check-prefix=MOD1 |
| ;; RUN: wasm-dis %t2.wasm | filecheck %s --check-prefix=MOD2 |
| ;; RUN: wasm-dis %t3.wasm | filecheck %s --check-prefix=MOD3 |
| |
| ;; When placeholders are NOT used and all functions in an element segment belong |
| ;; to a single secondary module, we can move the segment to that secondary |
| ;; module. |
| |
| (module |
| ;; PRIMARY: (table $table 3 3 funcref) |
| (table $table 3 3 funcref) |
| ;; PRIMARY: (elem $primary-elem1 (table $table) (i32.const 0) func $trampoline_A $trampoline_B $trampoline_C) |
| |
| ;; PRIMARY: (elem $primary-elem2 (table $table) (i32.const 0) func $trampoline_A $trampoline_B $trampoline_A) |
| |
| ;; PRIMARY: (export "table" (table $table)) |
| (export "table" (table $table)) |
| (elem $primary-elem1 (table $table) (i32.const 0) func $A $B $C) |
| (elem $primary-elem2 (table $table) (i32.const 0) func $A $B $A) |
| ;; MOD1: (elem $A-elem (table $table) (i32.const 0) func $A $A $A) |
| (elem $A-elem (table $table) (i32.const 0) func $A $A $A) |
| ;; MOD2: (elem $B-elem (table $table) (i32.const 0) func $B $B $B) |
| (elem $B-elem (table $table) (i32.const 0) func $B $B $B) |
| ;; MOD3: (elem $C-elem (table $table) (i32.const 0) func $C $C $C) |
| (elem $C-elem (table $table) (i32.const 0) func $C $C $C) |
| |
| ;; MOD1: (func $A |
| ;; MOD1-NEXT: (call_indirect (type $0) |
| ;; MOD1-NEXT: (i32.const 0) |
| ;; MOD1-NEXT: ) |
| ;; MOD1-NEXT: ) |
| (func $A |
| (call_indirect $table |
| (i32.const 0) |
| ) |
| ) |
| |
| ;; MOD2: (func $B |
| ;; MOD2-NEXT: ) |
| (func $B |
| ) |
| |
| ;; MOD3: (func $C |
| ;; MOD3-NEXT: ) |
| (func $C |
| ) |
| ) |