diff options
Diffstat (limited to 'test/lit/wasm-split/ref.func.wast')
-rw-r--r-- | test/lit/wasm-split/ref.func.wast | 56 |
1 files changed, 37 insertions, 19 deletions
diff --git a/test/lit/wasm-split/ref.func.wast b/test/lit/wasm-split/ref.func.wast index f7832dcf4..39cce5dea 100644 --- a/test/lit/wasm-split/ref.func.wast +++ b/test/lit/wasm-split/ref.func.wast @@ -1,8 +1,8 @@ ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. -;; RUN: wasm-split %s --split-funcs=second,second-in-table -g -o1 %t.1.wasm -o2 %t.2.wasm -all -;; RUN: wasm-dis %t.1.wasm | filecheck %s --check-prefix PRIMARY -;; RUN: wasm-dis %t.2.wasm | filecheck %s --check-prefix SECONDARY +;; RUN: wasm-split %s -all --split-funcs=second,second-in-table -g -o1 %t.1.wasm -o2 %t.2.wasm +;; RUN: wasm-dis -all %t.1.wasm | filecheck %s --check-prefix PRIMARY +;; RUN: wasm-dis -all %t.2.wasm | filecheck %s --check-prefix SECONDARY ;; Test that we handle ref.func operations properly as we split out $second. ;; ref.funcs that refer to the other module must be fixed up to refer to @@ -10,33 +10,41 @@ (module ;; PRIMARY: (type $0 (func)) - ;; PRIMARY: (import "placeholder" "1" (func $placeholder_1)) + ;; PRIMARY: (import "placeholder" "0" (func $placeholder_0 (type $0))) - ;; PRIMARY: (import "placeholder" "2" (func $placeholder_2)) + ;; PRIMARY: (import "placeholder" "1" (func $placeholder_1 (type $0))) ;; PRIMARY: (global $glob1 (ref func) (ref.func $prime)) ;; PRIMARY: (global $glob2 (ref func) (ref.func $2)) - ;; PRIMARY: (table $table 3 3 funcref) + ;; PRIMARY: (table $table 1 1 funcref) (table $table 1 1 funcref) (global $glob1 (ref func) (ref.func $prime)) (global $glob2 (ref func) (ref.func $second)) - ;; PRIMARY: (elem $elem (i32.const 0) $in-table $placeholder_1 $placeholder_2) + ;; PRIMARY: (table $1 2 funcref) + + ;; PRIMARY: (elem $elem (table $table) (i32.const 0) func $in-table $3) (elem $elem (i32.const 0) $in-table $second-in-table) + ;; PRIMARY: (elem $1 (table $1) (i32.const 0) func $placeholder_0 $placeholder_1) + + ;; PRIMARY: (elem declare func $2 $prime) + ;; PRIMARY: (export "prime" (func $prime)) ;; PRIMARY: (export "table" (table $table)) + ;; PRIMARY: (export "table_2" (table $1)) + ;; PRIMARY: (export "global" (global $glob1)) - ;; PRIMARY: (export "global_3" (global $glob2)) + ;; PRIMARY: (export "global_4" (global $glob2)) - ;; PRIMARY: (func $prime + ;; PRIMARY: (func $prime (type $0) ;; PRIMARY-NEXT: (drop ;; PRIMARY-NEXT: (ref.func $prime) ;; PRIMARY-NEXT: ) @@ -55,17 +63,21 @@ ;; SECONDARY: (type $0 (func)) - ;; SECONDARY: (import "primary" "table" (table $table 3 3 funcref)) + ;; SECONDARY: (import "primary" "table_2" (table $timport$0 2 funcref)) + + ;; SECONDARY: (import "primary" "table" (table $table 1 1 funcref)) ;; SECONDARY: (import "primary" "global" (global $glob1 (ref func))) - ;; SECONDARY: (import "primary" "global_3" (global $glob2 (ref func))) + ;; SECONDARY: (import "primary" "global_4" (global $glob2 (ref func))) - ;; SECONDARY: (import "primary" "prime" (func $prime)) + ;; SECONDARY: (import "primary" "prime" (func $prime (type $0))) - ;; SECONDARY: (elem $0 (i32.const 1) $second-in-table $second) + ;; SECONDARY: (elem $0 (table $timport$0) (i32.const 0) func $second $second-in-table) - ;; SECONDARY: (func $second + ;; SECONDARY: (elem declare func $prime) + + ;; SECONDARY: (func $second (type $0) ;; SECONDARY-NEXT: (drop ;; SECONDARY-NEXT: (ref.func $prime) ;; SECONDARY-NEXT: ) @@ -82,7 +94,7 @@ ) ) - ;; PRIMARY: (func $in-table + ;; PRIMARY: (func $in-table (type $0) ;; PRIMARY-NEXT: (nop) ;; PRIMARY-NEXT: ) (func $in-table @@ -91,7 +103,7 @@ ;; table is a list of ref.funcs. ) - ;; SECONDARY: (func $second-in-table + ;; SECONDARY: (func $second-in-table (type $0) ;; SECONDARY-NEXT: (nop) ;; SECONDARY-NEXT: ) (func $second-in-table @@ -99,8 +111,14 @@ ;; (but we will get a placeholder, as all split-out functions do). ) ) -;; PRIMARY: (func $2 -;; PRIMARY-NEXT: (call_indirect (type $0) -;; PRIMARY-NEXT: (i32.const 2) +;; PRIMARY: (func $2 (type $0) +;; PRIMARY-NEXT: (call_indirect $1 (type $0) +;; PRIMARY-NEXT: (i32.const 0) +;; PRIMARY-NEXT: ) +;; PRIMARY-NEXT: ) + +;; PRIMARY: (func $3 (type $0) +;; PRIMARY-NEXT: (call_indirect $1 (type $0) +;; PRIMARY-NEXT: (i32.const 1) ;; PRIMARY-NEXT: ) ;; PRIMARY-NEXT: ) |