diff options
author | Alon Zakai <azakai@google.com> | 2021-10-04 12:43:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-04 12:43:00 -0700 |
commit | 1183a7ddef3f0597b4547da0af6b6d1a8393f290 (patch) | |
tree | 5222afdf3ef4e52732be2e09a7fca8f38dd4a50a /test | |
parent | 9d6067dfc0adfb45c0e0b650cd74c64d3748d92b (diff) | |
download | binaryen-1183a7ddef3f0597b4547da0af6b6d1a8393f290.tar.gz binaryen-1183a7ddef3f0597b4547da0af6b6d1a8393f290.tar.bz2 binaryen-1183a7ddef3f0597b4547da0af6b6d1a8393f290.zip |
Fix inlining name collision (#4206)
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/passes/inlining_optimize-level=3.wast | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/test/lit/passes/inlining_optimize-level=3.wast b/test/lit/passes/inlining_optimize-level=3.wast index c9e60fc47..ec39b9030 100644 --- a/test/lit/passes/inlining_optimize-level=3.wast +++ b/test/lit/passes/inlining_optimize-level=3.wast @@ -423,4 +423,31 @@ (drop (i32.const 1)) ) ) -. + +(module + (func $bar + (drop + (block $__inlined_func$bar (result i32) + (return) ;; After inlining, this return will be replaced with a br to a + ;; new block. That block's name must not collide with the name + ;; of the outer block here, which has been chosen so as to + ;; potentially collide. If it collides, we will fail to validate + ;; as the new outer block will have type none. + ) + ) + ) + ;; CHECK: (type $none_=>_none (func)) + + ;; CHECK: (func $foo + ;; CHECK-NEXT: (block $__inlined_func$bar_0 + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (block $__inlined_func$bar (result i32) + ;; CHECK-NEXT: (br $__inlined_func$bar_0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $foo + (call $bar) + ) +) |