Files
clang-p2996/bolt/test/X86/dwarf5-return-pc.test
Alexander Yermolovich 11a8dd65ec [BOLT][DWARF] Add support for DW_AT_call_pc/DW_AT_call_return_pc
DWARF 5 added two new attributes DW_AT_call_pc and DW_AT_call_return_pc.
Adding support for them.

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D128526
2022-06-24 12:37:58 -07:00

30 lines
1.4 KiB
Plaintext

# REQUIRES: system-linux
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-return-pc-main.s -o %tmain.o
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-return-pc-helper.s -o %thelper.o
# RUN: %clang %cflags -dwarf-5 %tmain.o %thelper.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -o %t.exe.bolt --update-debug-sections -reorder-blocks=reverse
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe > %tmain.txt
# RUN: llvm-objdump %t.exe --disassemble >> %tmain.txt
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe.bolt > %tmainbolt.txt
# RUN: llvm-objdump %t.exe.bolt --disassemble >> %tmainbolt.txt
# RUN: cat %tmain.txt | FileCheck --check-prefix=PRECHECK %s
# RUN: cat %tmainbolt.txt | FileCheck --check-prefix=POSTCHECK %s
# Test checks that DW_AT_call_return_pc points to an address after the callq instruction.
# PRECHECK: DW_TAG_call_site [11]
# PRECHECK-NEXT: DW_AT_call_origin [DW_FORM_ref4]
# PRECHECK-NEXT: DW_AT_call_return_pc [DW_FORM_addrx]
# PRECHECK-SAME: address = 0x[[#%x,ADDR:]])
# PRECHECK: callq
# PRECHECK-NEXT: [[#ADDR]]:
# POSTCHECK: DW_TAG_call_site [11]
# POSTCHECK-NEXT: DW_AT_call_origin [DW_FORM_ref4]
# POSTCHECK-NEXT: DW_AT_call_return_pc [DW_FORM_addrx]
# POSTCHECK-SAME: address = 0x[[#%x,ADDR:]])
# POSTCHECK: <main>:
# POSTCHECK: callq
# POSTCHECK-NEXT: [[#ADDR]]: