xref: /llvm-project/bolt/test/X86/dwarf5-addr-section-reuse.s (revision 6aad62cf5b7f91f4b02266cf72469e2c8e28dbef)
1f230099cSAlexander Yermolovich# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-main-addr-section-reuse.s    -o %tmain.o
2f230099cSAlexander Yermolovich# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-helper1-addr-section-reuse.s -o %thelper1.o
3f230099cSAlexander Yermolovich# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-helper2-addr-section-reuse.s -o %thelper2.o
4e140a8a3SSayhaan Siddiqui# RUN: %clang %cflags -dwarf-5 %thelper1.o %tmain.o %thelper2.o -o %t.exe -Wl,-q
5f230099cSAlexander Yermolovich# RUN: llvm-dwarfdump --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
6*6aad62cfSSayhaan Siddiqui# RUN: llvm-bolt %t.exe -o %t.exe.bolt --update-debug-sections --debug-thread-count=4 --cu-processing-batch-size=4
7f230099cSAlexander Yermolovich# RUN: llvm-dwarfdump --debug-info %t.exe.bolt | FileCheck --check-prefix=POSTCHECK %s
8f230099cSAlexander Yermolovich
911791ae7SSayhaan Siddiqui## This test checks that when a binary is bolted if CU is not modified and has DW_AT_addr_base that is shared
1011791ae7SSayhaan Siddiqui## after being bolted CUs still share same entry in .debug_addr.
11f230099cSAlexander Yermolovich
12f230099cSAlexander Yermolovich# PRECHECK: DW_AT_addr_base (0x00000008)
13f230099cSAlexander Yermolovich# PRECHECK: DW_AT_addr_base (0x00000008)
14f230099cSAlexander Yermolovich# PRECHECK: DW_AT_addr_base (0x00000008)
15f230099cSAlexander Yermolovich
16f230099cSAlexander Yermolovich# POSTCHECK: DW_AT_addr_base (0x00000008)
17e140a8a3SSayhaan Siddiqui# POSTCHECK: DW_AT_addr_base (0x00000018)
18e140a8a3SSayhaan Siddiqui# POSTCHECK: DW_AT_addr_base (0x00000008)
19