xref: /llvm-project/bolt/test/X86/dwarf5-call-pc-function-null-check.test (revision 6aad62cf5b7f91f4b02266cf72469e2c8e28dbef)
1# REQUIRES: system-linux
2
3# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-call-pc-function-null-check-main.s -o %tmain.o
4# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-call-pc-function-null-check-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 --debug-thread-count=4 --cu-processing-batch-size=4
7# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe > %t.txt
8# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe.bolt >> %t.txt
9# RUN: cat %t.txt | FileCheck --check-prefix=CHECK %s
10
11## Test checks we correctly handle nullptr returned by getBinaryFunctionContainingAddress for DW_AT_call_pc.
12## This happens when address is not contained in any function.
13
14# CHECK: DW_AT_call_pc [DW_FORM_addrx]
15# CHECK-SAME: address = 0x[[#%.16x,ADDR:]]
16
17# CHECK: DW_AT_call_pc [DW_FORM_addrx]
18# CHECK-SAME: address = 0x[[#ADDR]]
19