diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/extract-function=foo.txt (renamed from test/passes/extract-function_pass-arg=extract@foo.txt) | 0 | ||||
-rw-r--r-- | test/passes/extract-function=foo.wast (renamed from test/passes/extract-function_pass-arg=extract@foo.wast) | 0 | ||||
-rw-r--r-- | test/passes/extract-function_pass-arg=extract-function@foo.txt | 28 | ||||
-rw-r--r-- | test/passes/extract-function_pass-arg=extract-function@foo.wast | 36 |
4 files changed, 64 insertions, 0 deletions
diff --git a/test/passes/extract-function_pass-arg=extract@foo.txt b/test/passes/extract-function=foo.txt index 3caf274c3..3caf274c3 100644 --- a/test/passes/extract-function_pass-arg=extract@foo.txt +++ b/test/passes/extract-function=foo.txt diff --git a/test/passes/extract-function_pass-arg=extract@foo.wast b/test/passes/extract-function=foo.wast index ab1d8b269..ab1d8b269 100644 --- a/test/passes/extract-function_pass-arg=extract@foo.wast +++ b/test/passes/extract-function=foo.wast diff --git a/test/passes/extract-function_pass-arg=extract-function@foo.txt b/test/passes/extract-function_pass-arg=extract-function@foo.txt new file mode 100644 index 000000000..3caf274c3 --- /dev/null +++ b/test/passes/extract-function_pass-arg=extract-function@foo.txt @@ -0,0 +1,28 @@ +(module + (type $none_=>_none (func)) + (import "env" "bar" (func $bar)) + (export "foo" (func $foo)) + (func $foo + (call $bar) + ) +) +(module + (type $none_=>_none (func)) + (import "env" "other" (func $other)) + (export "foo" (func $foo)) + (func $foo + (nop) + ) +) +(module + (type $none (func)) + (import "env" "other" (func $other)) + (table $t 10 funcref) + (elem $0 (i32.const 0) $other) + (export "foo" (func $foo)) + (func $foo + (call_indirect (type $none) + (i32.const 10) + ) + ) +) diff --git a/test/passes/extract-function_pass-arg=extract-function@foo.wast b/test/passes/extract-function_pass-arg=extract-function@foo.wast new file mode 100644 index 000000000..ab1d8b269 --- /dev/null +++ b/test/passes/extract-function_pass-arg=extract-function@foo.wast @@ -0,0 +1,36 @@ +(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)) + ) +) |