1# REQUIRES: system-linux 2 3# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-return-pc-main.s -o %tmain.o 4# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-return-pc-helper.s -o %thelper.o 5# RUN: %clang %cflags -dwarf-5 %tmain.o %thelper.o -o %t.exe -Wl,-q 6# RUN: llvm-bolt %t.exe -o %t.exe.bolt --update-debug-sections -reorder-blocks=reverse --debug-thread-count=4 --cu-processing-batch-size=4 7# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe > %tmain.txt 8# RUN: llvm-objdump %t.exe --disassemble >> %tmain.txt 9# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe.bolt > %tmainbolt.txt 10# RUN: llvm-objdump %t.exe.bolt --disassemble >> %tmainbolt.txt 11# RUN: cat %tmain.txt | FileCheck --check-prefix=PRECHECK %s 12# RUN: cat %tmainbolt.txt | FileCheck --check-prefix=POSTCHECK %s 13 14## Test checks that DW_AT_call_return_pc points to an address after the callq instruction. 15 16# PRECHECK: DW_TAG_call_site [11] 17# PRECHECK-NEXT: DW_AT_call_origin [DW_FORM_ref4] 18# PRECHECK-NEXT: DW_AT_call_return_pc [DW_FORM_addrx] 19# PRECHECK-SAME: address = 0x[[#%x,ADDR:]]) 20# PRECHECK: callq 21# PRECHECK-NEXT: [[#ADDR]]: 22 23# POSTCHECK: DW_TAG_call_site [11] 24# POSTCHECK-NEXT: DW_AT_call_origin [DW_FORM_ref4] 25# POSTCHECK-NEXT: DW_AT_call_return_pc [DW_FORM_addrx] 26# POSTCHECK-SAME: address = 0x[[#%x,ADDR:]]) 27# POSTCHECK: <main>: 28# POSTCHECK: callq 29# POSTCHECK-NEXT: [[#ADDR]]: 30