patch 8.2.2409: Vim9: profiling only works for one function
Problem: Vim9: profiling only works for one function.
Solution: Select the right instructions when calling and returning.
(closes #7743)
diff --git a/src/testdir/test_profile.vim b/src/testdir/test_profile.vim
index 8aaac90..3abe898 100644
--- a/src/testdir/test_profile.vim
+++ b/src/testdir/test_profile.vim
@@ -5,6 +5,7 @@
source shared.vim
source screendump.vim
+source vim9.vim
func Test_profile_func()
call RunProfileFunc('func', 'let', 'let')
@@ -583,4 +584,21 @@
call delete('XtestProfile')
endfunc
+func Test_vim9_profiling()
+ " only tests that compiling and calling functions doesn't crash
+ let lines =<< trim END
+ vim9script
+ def Func()
+ Crash()
+ enddef
+ def Crash()
+ enddef
+ prof start /tmp/profile.log
+ prof func Func
+ Func()
+ END
+ call CheckScriptSuccess(lines)
+endfunc
+
+
" vim: shiftwidth=2 sts=2 expandtab