mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-15 07:51:32 +00:00
Skip inlining and emit a warning when trying to inline a function into itself
This commit is contained in:
9
tests/compiler/inlining-recursive.optimized.wat
Normal file
9
tests/compiler/inlining-recursive.optimized.wat
Normal file
@ -0,0 +1,9 @@
|
||||
(module
|
||||
(type $v (func))
|
||||
(memory $0 0)
|
||||
(export "foo" (func $inlining-recursive/foo))
|
||||
(export "memory" (memory $0))
|
||||
(func $inlining-recursive/foo (; 0 ;) (type $v)
|
||||
(call $inlining-recursive/foo)
|
||||
)
|
||||
)
|
4
tests/compiler/inlining-recursive.ts
Normal file
4
tests/compiler/inlining-recursive.ts
Normal file
@ -0,0 +1,4 @@
|
||||
@inline
|
||||
export function foo(): void {
|
||||
foo();
|
||||
}
|
12
tests/compiler/inlining-recursive.untouched.wat
Normal file
12
tests/compiler/inlining-recursive.untouched.wat
Normal file
@ -0,0 +1,12 @@
|
||||
(module
|
||||
(type $v (func))
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(memory $0 0)
|
||||
(export "foo" (func $inlining-recursive/foo))
|
||||
(export "memory" (memory $0))
|
||||
(func $inlining-recursive/foo (; 0 ;) (type $v)
|
||||
(block $inlining-recursive/foo|inlined.0
|
||||
(call $inlining-recursive/foo)
|
||||
)
|
||||
)
|
||||
)
|
Reference in New Issue
Block a user