58 lines · plain
1# REQUIRES: system-linux2 3# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5_main.s -o %tmain.o4# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-loc-base-no-loc-accesshelper.s -o %thelper.o5# RUN: %clang %cflags -dwarf-5 %tmain.o %thelper.o -o %t.exe -Wl,-q6# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections --debug-thread-count=4 --cu-processing-batch-size=47# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s8# RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt > %t.txt9# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t.txt10# RUN: cat %t.txt | FileCheck --check-prefix=POSTCHECK %s11 12## This tests checks that re-writing of .debug_loclists is handled correctly when one of the CUs13## doesn't have any DW_AT_location accesses.14 15# PRECHECK: version = 0x000516# PRECHECK: DW_AT_loclists_base [DW_FORM_sec_offset] (0x0000000c)17# PRECHECK-EMPTY:18# PRECHECK: DW_TAG_variable19# PRECHECK: DW_AT_location [DW_FORM_loclistx]20# PRECHECK-SAME: indexed (0x0)21# PRECHECK-SAME: loclist = 0x0000001422# PRECHECK: DW_AT_location [DW_FORM_loclistx]23# PRECHECK-SAME: indexed (0x1)24# PRECHECK-SAME: loclist = 0x0000002825# PRECHECK: DW_AT_loclists_base [DW_FORM_sec_offset] (0x00000043)26# PRECHECK-NOT: DW_AT_location27 28# POSTCHECK: Addrs: [29# POSTCHECK-NEXT: 0x30# POSTCHECK-NEXT: 0x31# POSTCHECK-NEXT: 0x[[#%.16x,ADDR:]]32# POSTCHECK-NEXT: 0x[[#%.16x,ADDR2:]]33 34# POSTCHECK: version = 0x000535# POSTCHECK: DW_AT_loclists_base [DW_FORM_sec_offset] (0x0000000c)36# POSTCHECK: DW_AT_rnglists_base [DW_FORM_sec_offset] (0x0000000c)37# POSTCHECK-EMPTY:38# POSTCHECK: DW_TAG_variable39# POSTCHECK: DW_AT_location [DW_FORM_loclistx]40# POSTCHECK-SAME: indexed (0x0)41# POSTCHECK-SAME: loclist = 0x0000001442# POSTCHECK-NEXT: [0x[[#ADDR]]43# POSTCHECK-SAME: 0x[[#ADDR + 0x6]]44# POSTCHECK-NEXT: [0x[[#ADDR + 0x6]]45# POSTCHECK-SAME: 0x[[#ADDR + 0xc]]46# POSTCHECK: DW_TAG_variable47# POSTCHECK: DW_AT_location [DW_FORM_loclistx]48# POSTCHECK-SAME: indexed (0x1)49# POSTCHECK-SAME: loclist = 0x0000002a50# POSTCHECK-NEXT: [0x[[#ADDR2]]51# POSTCHECK-SAME: 0x[[#ADDR2 + 0x2]]52 53# Checking second CU54# POSTCHECK: version = 0x000555# POSTCHECK: DW_AT_loclists_base [DW_FORM_sec_offset] (0x0000000c)56# POSTCHECK: DW_AT_rnglists_base [DW_FORM_sec_offset] (0x00000025)57# POSTCHECK-NOT: DW_AT_location58