diff options
author | Alon Zakai <azakai@google.com> | 2023-07-26 10:10:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-26 10:10:27 -0700 |
commit | 08df4eedd91a1792c4e0281e8957b231946321ef (patch) | |
tree | 6da33094b20a131375956fac7155d565d34ae90c /test/lit/merge/start3.wat.second | |
parent | e2f5d79fd0f9bd12d69733e98b534ce63592bd57 (diff) | |
download | binaryen-08df4eedd91a1792c4e0281e8957b231946321ef.tar.gz binaryen-08df4eedd91a1792c4e0281e8957b231946321ef.tar.bz2 binaryen-08df4eedd91a1792c4e0281e8957b231946321ef.zip |
wasm-merge: Fix locals in merged start (#5837)
Start functions can have locals, which we previously ignored as we just
concatenated the bodies together. This makes us copy the second start
and call that, keeping them separate (the optimizer can then inline, if that
makes sense).
Fixes #5835
Diffstat (limited to 'test/lit/merge/start3.wat.second')
-rw-r--r-- | test/lit/merge/start3.wat.second | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/lit/merge/start3.wat.second b/test/lit/merge/start3.wat.second index ec66c2f5b..39090b56d 100644 --- a/test/lit/merge/start3.wat.second +++ b/test/lit/merge/start3.wat.second @@ -2,6 +2,12 @@ (start $start) (func $start (export "start") + ;; Test that locals are handled properly. This function has an i32 local, + ;; and the other start has an f64 with the same name. + (local $x i32) + (drop + (local.get $x) + ) (drop (i32.const 1) ) |