summaryrefslogtreecommitdiff
path: root/test/passes/extract-function_pass-arg=extract@foo.wast
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-05-13 13:57:19 -0700
committerGitHub <noreply@github.com>2021-05-13 13:57:19 -0700
commitf59174c1cf526d7e9fe5d4ba74ab0370f40a1856 (patch)
tree3c8823cd321118f1550cab27eb5ad5c0fb4f5d8a /test/passes/extract-function_pass-arg=extract@foo.wast
parent284a47cbe888a3421d6f20f2bda716ae1ece097b (diff)
downloadbinaryen-f59174c1cf526d7e9fe5d4ba74ab0370f40a1856.tar.gz
binaryen-f59174c1cf526d7e9fe5d4ba74ab0370f40a1856.tar.bz2
binaryen-f59174c1cf526d7e9fe5d4ba74ab0370f40a1856.zip
Add pass argument sugar to commandline (#3882)
We have --pass-arg that allows sending an argument to a pass, like this: wasm-opt --do-stuff --pass-arg=do-stuff@FUNCTION_NAME With this PR that is equivalent to this: wasm-opt --do-stuff=FUNCTION_NAME That is,one can just give an argument to a pass on the commandline. This fixes the Optional mode in command-line.h/cpp. That was not actually used anywhere before this PR. Also rename --extract-function's pass argument to match it. That is, the usage used to be wasm-opt --extract-function --pass-arg=extract@FUNCTION_NAME Note how the pass name differed from the pass-arg name. This changes it to match. This is a breaking change, but I doubt this is used enough to justify any deprecation / backwards compatibility effort, and any usage is almost certainly manual, and with PR writing it manually becomes easier as one can do wasm-opt --extract-function=FUNCTION_NAME The existing test for that is kept (&renamed), and a new test added to test the new notation. This is a step towards unifying the symbol map functionality between wasm-as and wasm-opt (later PRs will turn the symbol mapping pass into a pass that receives an argument).
Diffstat (limited to 'test/passes/extract-function_pass-arg=extract@foo.wast')
-rw-r--r--test/passes/extract-function_pass-arg=extract@foo.wast36
1 files changed, 0 insertions, 36 deletions
diff --git a/test/passes/extract-function_pass-arg=extract@foo.wast b/test/passes/extract-function_pass-arg=extract@foo.wast
deleted file mode 100644
index ab1d8b269..000000000
--- a/test/passes/extract-function_pass-arg=extract@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))
- )
-)