From ea0b9ee1e1083962da9bfa52fa09870fcc4f72bb Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Thu, 17 Jun 2021 07:28:44 -0700 Subject: Add a extract-function-index pass This is a useful alternative to extract-function when you don't know the function's name. Also moves the extract-function tests to be lit tests and re-uses them as extract-function-index tests. --- ...act-function_pass-arg=extract-function@foo.wast | 36 ---------------------- 1 file changed, 36 deletions(-) delete mode 100644 test/passes/extract-function_pass-arg=extract-function@foo.wast (limited to 'test/passes/extract-function_pass-arg=extract-function@foo.wast') diff --git a/test/passes/extract-function_pass-arg=extract-function@foo.wast b/test/passes/extract-function_pass-arg=extract-function@foo.wast deleted file mode 100644 index ab1d8b269..000000000 --- a/test/passes/extract-function_pass-arg=extract-function@foo.wast +++ /dev/null @@ -1,36 +0,0 @@ -(module - (func $foo - (call $bar) - ) - (func $bar - (call $foo) - ) - (func $other - (drop (i32.const 1)) - ) -) -(module - ;; Use another function in the table, but the table is not used in the - ;; extracted function - (table $t 10 funcref) - (elem $0 (table $t) (i32.const 0) func $other) - (func $foo - ) - (func $other - (drop (i32.const 1)) - ) -) -(module - ;; Use another function in the table, and the table *is* used. As a result, - ;; the table and its elements will remain. The called function, $other, will - ;; remain as an import that is placed in the table. - (type $none (func)) - (table $t 10 funcref) - (elem $0 (table $t) (i32.const 0) func $other) - (func $foo - (call_indirect (type $none) (i32.const 10)) - ) - (func $other - (drop (i32.const 1)) - ) -) -- cgit v1.2.3