xref: /llvm-project/bolt/test/X86/dwarf5-cu-no-debug-addr.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-cu-no-debug-addr-main.s -o %t1main.o
4# 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
5# RUN: %clang %cflags -dwarf-5 %t1main.o %t1helper.o -o %t.exe -Wl,-q
6# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections --debug-thread-count=4 --cu-processing-batch-size=4
7# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe  | FileCheck --check-prefix=PRECHECK %s
8# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s
9
10## This tests checks that we handle correctly, don't crash, DWARF5 CUs that does not access .debug_addr.
11
12# PRECHECK: DW_TAG_compile_unit
13# PRECHECK: DW_AT_addr_base
14# PRECHECK: DW_TAG_compile_unit
15# PRECHECK-NOT: DW_AT_addr_base
16
17# POSTCHECK: DW_TAG_compile_unit
18# POSTCHECK: DW_AT_addr_base
19# POSTCHECK: DW_TAG_compile_unit
20# POSTCHECK-NOT: DW_AT_addr_base
21