-
Notifications
You must be signed in to change notification settings - Fork 747
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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).
- Loading branch information
Showing
2 changed files
with
54 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
) | ||
) | ||
|