Repository navigation
Migrate three legacy pass tests to lit #9367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tlively
merged 2 commits into
WebAssembly:main
from
Eduardo-Gv17:test/migrate-three-passes-to-lit
Nov 9, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,40 @@ | ||
| ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. | ||
| ;; RUN: foreach %s %t wasm-opt --duplicate-import-elimination -S -o - | filecheck %s | ||
|
|
||
| ;; Merge imports with matching signatures and update calls, elements, and start. | ||
| ;; The import with a different signature must remain distinct. | ||
|
|
||
| (module | ||
| ;; CHECK: (type $0 (func)) | ||
|
|
||
| ;; CHECK: (type $1 (func (param i32))) | ||
|
|
||
| ;; CHECK: (import "env" "waka" (func $foo)) | ||
| (import "env" "waka" (func $foo)) | ||
| (import "env" "waka" (func $bar)) | ||
| ;; CHECK: (import "env" "waka" (func $wrong (param i32))) | ||
| (import "env" "waka" (func $wrong (param i32))) | ||
| (table 2 2 funcref) | ||
| (elem (i32.const 0) $foo $bar) | ||
| (start $bar) | ||
| ;; CHECK: (table $0 2 2 funcref) | ||
|
|
||
| ;; CHECK: (elem $0 (i32.const 0) $foo $foo) | ||
|
|
||
| ;; CHECK: (export "baz" (func $baz)) | ||
|
|
||
| ;; CHECK: (start $foo) | ||
|
|
||
| ;; CHECK: (func $baz | ||
| ;; CHECK-NEXT: (call $foo) | ||
| ;; CHECK-NEXT: (call $foo) | ||
| ;; CHECK-NEXT: (call $wrong | ||
| ;; CHECK-NEXT: (i32.const 1) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| (func $baz (export "baz") | ||
| (call $foo) | ||
| (call $bar) | ||
| (call $wrong (i32.const 1)) | ||
| ) | ||
| ) | ||
This file contains hidden or 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,57 @@ | ||
| ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. | ||
| ;; RUN: foreach %s %t wasm-opt --remove-unused-names --precompute -S -o - | filecheck %s | ||
|
|
||
| ;; Preserve the interaction between name removal and a constant br_table target. | ||
|
|
||
| (module | ||
| ;; CHECK: (type $0 (func (param i32))) | ||
|
|
||
| ;; CHECK: (memory $0 256 256) | ||
| (memory $0 256 256) | ||
| ;; CHECK: (func $__ZN10WasmAssertC2Ev__async_cb (param $$0 i32) | ||
| ;; CHECK-NEXT: (block $switch-default | ||
| ;; CHECK-NEXT: (nop) | ||
| ;; CHECK-NEXT: (block | ||
| ;; CHECK-NEXT: (i32.store | ||
| ;; CHECK-NEXT: (i32.const 12) | ||
| ;; CHECK-NEXT: (i32.const 26) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (return) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (block | ||
| ;; CHECK-NEXT: (local.set $$0 | ||
| ;; CHECK-NEXT: (i32.const 4) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: (i32.store | ||
| ;; CHECK-NEXT: (local.get $$0) | ||
| ;; CHECK-NEXT: (i32.const 1) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| ;; CHECK-NEXT: ) | ||
| (func $__ZN10WasmAssertC2Ev__async_cb (param $$0 i32) | ||
| (block $switch-default | ||
| (block $switch-case | ||
| (br_table $switch-case $switch-default | ||
| (i32.const 0) | ||
| ) | ||
| ) | ||
| (block | ||
| (i32.store | ||
| (i32.const 12) | ||
| (i32.const 26) | ||
| ) | ||
| (return) | ||
| ) | ||
| ) | ||
| (block | ||
| (local.set $$0 | ||
| (i32.const 4) | ||
| ) | ||
| (i32.store | ||
| (local.get $$0) | ||
| (i32.const 1) | ||
| ) | ||
| ) | ||
| ) | ||
| ) |
This file contains hidden or 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,15 @@ | ||
| ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. | ||
| ;; RUN: foreach %s %t wasm-opt --set-globals --pass-arg=set-globals@foo=1337,bar=42 -S -o - | filecheck %s | ||
|
|
||
| ;; Set both an imported i32 global and a defined i64 global using pass arguments. | ||
|
|
||
| (module | ||
| ;; an imported i32 | ||
| (import "env" "in" (global $foo i32)) | ||
|
|
||
| ;; a defined i64 | ||
| ;; CHECK: (global $foo i32 (i32.const 1337)) | ||
|
|
||
| ;; CHECK: (global $bar i64 (i64.const 42)) | ||
| (global $bar i64 (i64.const 1234)) | ||
| ) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use
scripts/update_lit_checks.py --all-itemsto generate the test output for this file as well..There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! I regenerated the checks with "--all-items" and reran the three migrated tests. All three passed. Thanks for the review :))