diff options
author | YAMAMOTO Takashi <yamamoto@midokura.com> | 2024-05-31 13:04:11 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-31 04:04:11 +0000 |
commit | 0c23394e9d73252000c3161fb33344ca7bbf247c (patch) | |
tree | 3f3817ac255550bc40f33a3c24f828a76b929911 /test | |
parent | 18bb1f5af22b4d6bc309b96d844f856077eb6b60 (diff) | |
download | binaryen-0c23394e9d73252000c3161fb33344ca7bbf247c.tar.gz binaryen-0c23394e9d73252000c3161fb33344ca7bbf247c.tar.bz2 binaryen-0c23394e9d73252000c3161fb33344ca7bbf247c.zip |
LogExecution: Optionally take a module name for the logger function (#6629)
--log-execution=NAME will use NAME as the module for the logger
function import, rather than infer it.
If the name is not provided (--log-execution as before this PR) then we
will try to automatically decide which to use ("env", unless we see
another module name is used, which can be the case in optimized
modules).
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/passes/log-execution_arg.wast | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/lit/passes/log-execution_arg.wast b/test/lit/passes/log-execution_arg.wast new file mode 100644 index 000000000..e987655d6 --- /dev/null +++ b/test/lit/passes/log-execution_arg.wast @@ -0,0 +1,24 @@ +;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. +;; Test the option to provide the module name as an argument. +;; RUN: foreach %s %t wasm-opt --log-execution=foo -S -o - | filecheck %s + +(module + ;; CHECK: (type $0 (func)) + + ;; CHECK: (type $1 (func (param i32))) + + ;; CHECK: (import "env" "func" (func $import)) + (import "env" "func" (func $import)) + ;; CHECK: (import "foo" "log_execution" (func $log_execution (param i32))) + + ;; CHECK: (func $nopp + ;; CHECK-NEXT: (call $log_execution + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + (func $nopp + (nop) + ) +) + |