llvm-capstone/bolt/test/X86/dwarf5-cu-no-debug-addr.test
Alexander Yermolovich 1ee74064e0 [BOLT][DWARF] Fix updating CU that has no entry in .debug_addr
We were trying to process .debug_addr for CU that doesn't have it. This resulted
in assert. Example came from GCC that also doesn't use DW_OP_addrx in
DW_FORM_exprloc.

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D132422
2022-08-25 17:03:11 -07:00

21 lines
985 B
Plaintext

# REQUIRES: system-linux
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-cu-no-debug-addr-main.s -o %t1main.o
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-cu-no-debug-addr-helper.s -o %t1helper.o
# RUN: %clang %cflags -dwarf-5 %t1main.o %t1helper.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s
# This tests checks that we handle correctly, don't crash, DWARF5 CUs that does not access .debug_addr.
# PRECHECK: DW_TAG_compile_unit
# PRECHECK: DW_AT_addr_base
# PRECHECK: DW_TAG_compile_unit
# PRECHECK-NOT: DW_AT_addr_base
# POSTCHECK: DW_TAG_compile_unit
# POSTCHECK: DW_AT_addr_base
# POSTCHECK: DW_TAG_compile_unit
# POSTCHECK-NOT: DW_AT_addr_base