diff options
author | Vedant Kumar <vsk@apple.com> | 2019-09-14 19:43:16 -0700 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2019-11-22 11:50:22 -0800 |
commit | 4fdbc0728d4b8acb1921fc48301622e971fc3961 (patch) | |
tree | 74a32d9948b5c41de1b711455b2dc54f7b6e5570 /lldb/packages/Python/lldbsuite/test | |
parent | 3f8a2af8f43faf6da15070108ceeacb9a5d2c42b (diff) | |
download | bcm5719-llvm-4fdbc0728d4b8acb1921fc48301622e971fc3961.tar.gz bcm5719-llvm-4fdbc0728d4b8acb1921fc48301622e971fc3961.zip |
[DWARF] Handle call sites with indirect call targets
Split CallEdge into DirectCallEdge and IndirectCallEdge. Teach
DWARFExpression how to evaluate entry values in cases where the current
activation was created by an indirect call.
rdar://57094085
Differential Revision: https://reviews.llvm.org/D70100
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/main.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/main.cpp index 5a38376b680..ff72a81c6b2 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/main.cpp @@ -140,6 +140,34 @@ void func12(int &sink, int x) { func11_tailcalled(sink, x); } +__attribute__((noinline)) +void func13(int &sink, int x) { + //% self.filecheck("bt", "main.cpp", "-check-prefix=FUNC13-BT") + // FUNC13-BT: func13{{.*}} + // FUNC13-BT-NEXT: func14{{.*}} + use(x); + + // Destroy 'x' in the current frame. + DESTROY_RSI; + + //% self.filecheck("expr x", "main.cpp", "-check-prefix=FUNC13-EXPR") + // FUNC13-EXPR: (int) ${{.*}} = 123 + + ++sink; +} + +__attribute__((noinline, disable_tail_calls)) +void func14(int &sink, void (*target_no_tailcall)(int &, int)) { + // Move the call target into a register that won't get clobbered. Do this + // by calling the same indirect target twice, and hoping that regalloc is + // 'smart' enough to stash the call target in a non-clobbered register. + // + // llvm.org/PR43926 tracks work in the compiler to emit call targets which + // describe non-clobbered values. + target_no_tailcall(sink, 123); + target_no_tailcall(sink, 123); +} + __attribute__((disable_tail_calls)) int main() { int sink = 0; @@ -168,5 +196,8 @@ int main() { // Test that evaluation can "see through" tail calls. func12(sink, 123); + // Test that evaluation can "see through" an indirect tail call. + func14(sink, func13); + return 0; } |