diff options
author | Alon Zakai <azakai@google.com> | 2020-10-29 19:06:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-29 19:06:28 -0700 |
commit | 25e47f2c3e7ca8151377075432b34c95073acaca (patch) | |
tree | b806914422484795822dd9235dc22de89bb52796 /test | |
parent | eb81ca4f81a27eb2fa775b8246f24f3bc3ea4f4b (diff) | |
download | binaryen-25e47f2c3e7ca8151377075432b34c95073acaca.tar.gz binaryen-25e47f2c3e7ca8151377075432b34c95073acaca.tar.bz2 binaryen-25e47f2c3e7ca8151377075432b34c95073acaca.zip |
Inlining fix: Note the start function (#3301)
Without this, we might think a function has no global uses if the only
global use of it is the start.
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/inlining_all-features.txt | 12 | ||||
-rw-r--r-- | test/passes/inlining_all-features.wast | 11 |
2 files changed, 23 insertions, 0 deletions
diff --git a/test/passes/inlining_all-features.txt b/test/passes/inlining_all-features.txt index 2141d3d34..e909239d2 100644 --- a/test/passes/inlining_all-features.txt +++ b/test/passes/inlining_all-features.txt @@ -59,3 +59,15 @@ ) ) ) +(module + (type $none_=>_none (func)) + (start $0) + (func $0 + (nop) + ) + (func $1 + (block $__inlined_func$0 + (nop) + ) + ) +) diff --git a/test/passes/inlining_all-features.wast b/test/passes/inlining_all-features.wast index f86ad8926..60093cb63 100644 --- a/test/passes/inlining_all-features.wast +++ b/test/passes/inlining_all-features.wast @@ -47,3 +47,14 @@ (call $0) ) ) +(module + ;; a function reference in the start should be noticed, and prevent us + ;; from removing an inlined function + (start $0) + (func $0 + (nop) + ) + (func $1 + (call $0) + ) +) |