1ba1ac98cSAlexander Yermolovich; RUN: rm -rf %t 2ba1ac98cSAlexander Yermolovich; RUN: mkdir %t 3ba1ac98cSAlexander Yermolovich; RUN: cd %t 4e51a6b73Szr33; RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-locaddrx.s \ 5e51a6b73Szr33; RUN: -split-dwarf-file=mainlocadddrx.dwo -o mainlocadddrx.o 6a26aa79aSRafael Auler; RUN: %clang %cflags -gdwarf-5 -gsplit-dwarf=split mainlocadddrx.o -o mainlocadddrx.exe -fno-pic -no-pie 775f770a6SAlexander Yermolovich; RUN: llvm-bolt mainlocadddrx.exe -o mainlocadddrx.exe.bolt --update-debug-sections --always-convert-to-ranges 8ba1ac98cSAlexander Yermolovich; RUN: llvm-dwarfdump --show-form --verbose --debug-info mainlocadddrx.exe | FileCheck -check-prefix=PRE-BOLT %s 9ba1ac98cSAlexander Yermolovich; RUN: llvm-dwarfdump --show-form --verbose --debug-addr mainlocadddrx.exe.bolt &> %t/foo.txt 10ba1ac98cSAlexander Yermolovich; RUN: llvm-dwarfdump --show-form --verbose --debug-info mainlocadddrx.exe.bolt >> %t/foo.txt 11ba1ac98cSAlexander Yermolovich; RUN: cat %t/foo.txt | FileCheck -check-prefix=BOLT %s 12ba1ac98cSAlexander Yermolovich; RUN: llvm-dwarfdump --show-form --verbose --debug-info mainlocadddrx.dwo | FileCheck -check-prefix=PRE-BOLT-DWO %s 13ba1ac98cSAlexander Yermolovich; RUN: llvm-dwarfdump --show-form --verbose --debug-info mainlocadddrx.dwo.dwo | FileCheck -check-prefix=BOLT-DWO %s 14ba1ac98cSAlexander Yermolovich 15*11791ae7SSayhaan Siddiqui;; Testing dwarf5 split dwarf. Making sure DW_AT_low_pc/DW_AT_high_pc are converted correctly in the binary and in dwo. 16*11791ae7SSayhaan Siddiqui;; Checking that DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x0) is updated correctly. 17ba1ac98cSAlexander Yermolovich 18ba1ac98cSAlexander Yermolovich; PRE-BOLT: version = 0x0005 19ba1ac98cSAlexander Yermolovich; PRE-BOLT: DW_TAG_skeleton_unit 20ba1ac98cSAlexander Yermolovich; PRE-BOLT: DW_AT_low_pc [DW_FORM_addrx] 21ba1ac98cSAlexander Yermolovich; PRE-BOLT-NEXT: DW_AT_high_pc [DW_FORM_data4] 22ba1ac98cSAlexander Yermolovich; PRE-BOLT: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000008) 23ba1ac98cSAlexander Yermolovich 24ba1ac98cSAlexander Yermolovich; BOLT: Addrs: [ 25ba1ac98cSAlexander Yermolovich; BOLT-NEXT: 0x 26ba1ac98cSAlexander Yermolovich; BOLT-NEXT: 0x 27ba1ac98cSAlexander Yermolovich; BOLT-NEXT: 0x[[#%.16x,ADDR:]] 28ba1ac98cSAlexander Yermolovich; BOLT-NEXT: 0x[[#%.16x,ADDR2:]] 29ba1ac98cSAlexander Yermolovich; BOLT: DW_TAG_skeleton_unit 30efb8a1c9SAlexander Yermolovich; BOLT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000004) address = 0x0000000000000000) 31ba1ac98cSAlexander Yermolovich; BOLT-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000010 32ba1ac98cSAlexander Yermolovich; BOLT-NEXT: [0x[[#ADDR]] 33ba1ac98cSAlexander Yermolovich; BOLT-SAME: 0x[[#ADDR + 0x24]] 34ba1ac98cSAlexander Yermolovich; BOLT-NEXT: [0x[[#ADDR2]] 35ba1ac98cSAlexander Yermolovich; BOLT-SAME: 0x[[#ADDR2 + 0x54]] 36ba1ac98cSAlexander Yermolovich; BOLT-NEXT: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000008) 37ba1ac98cSAlexander Yermolovich; BOLT-NEXT: DW_AT_rnglists_base [DW_FORM_sec_offset] (0x0000000c) 38ba1ac98cSAlexander Yermolovich 39ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO: version = 0x0005 40ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO: DW_TAG_compile_unit 41ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO: DW_TAG_variable [2] 42ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000000) string = "x") 43ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO-NEXT: DW_AT_type 44ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO-NEXT: DW_AT_external 45ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO-NEXT: DW_AT_decl_file 46ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO-NEXT: DW_AT_decl_line 47ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x0) 48ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO: DW_TAG_variable [2] 49ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000002) string = "y") 50ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO-NEXT: DW_AT_type 51ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO-NEXT: DW_AT_external 52ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO-NEXT: DW_AT_decl_file 53ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO-NEXT: DW_AT_decl_line 54ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x1) 55ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO: DW_TAG_subprogram 56ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000002) 57ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000024) 58ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO: DW_TAG_subprogram 59ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000003) 60ba1ac98cSAlexander Yermolovich; PRE-BOLT-DWO-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x0000005a) 61ba1ac98cSAlexander Yermolovich 62ba1ac98cSAlexander Yermolovich; BOLT-DWO: DW_TAG_compile_unit 63ba1ac98cSAlexander Yermolovich; BOLT-DWO: DW_TAG_variable [2] 64ba1ac98cSAlexander Yermolovich; BOLT-DWO-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000000) string = "x") 65ba1ac98cSAlexander Yermolovich; BOLT-DWO-NEXT: DW_AT_type 66ba1ac98cSAlexander Yermolovich; BOLT-DWO-NEXT: DW_AT_external 67ba1ac98cSAlexander Yermolovich; BOLT-DWO-NEXT: DW_AT_decl_file 68ba1ac98cSAlexander Yermolovich; BOLT-DWO-NEXT: DW_AT_decl_line 69ba1ac98cSAlexander Yermolovich; BOLT-DWO-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x0) 70ba1ac98cSAlexander Yermolovich; BOLT-DWO: DW_TAG_variable [2] 71ba1ac98cSAlexander Yermolovich; BOLT-DWO-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000002) string = "y") 72ba1ac98cSAlexander Yermolovich; BOLT-DWO-NEXT: DW_AT_type 73ba1ac98cSAlexander Yermolovich; BOLT-DWO-NEXT: DW_AT_external 74ba1ac98cSAlexander Yermolovich; BOLT-DWO-NEXT: DW_AT_decl_file 75ba1ac98cSAlexander Yermolovich; BOLT-DWO-NEXT: DW_AT_decl_line 76ba1ac98cSAlexander Yermolovich; BOLT-DWO-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x1) 77ba1ac98cSAlexander Yermolovich; BOLT-DWO: DW_TAG_subprogram [4] 78ba1ac98cSAlexander Yermolovich; BOLT-DWO-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000014 79ba1ac98cSAlexander Yermolovich; BOLT-DWO-NEXT: [0x0000000000000000, 0x0000000000000024)) 80ba1ac98cSAlexander Yermolovich; BOLT-DWO: DW_TAG_subprogram [6] 81ba1ac98cSAlexander Yermolovich; BOLT-DWO-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x1) rangelist = 0x00000018 82ba1ac98cSAlexander Yermolovich; BOLT-DWO-NEXT: [0x0000000000000000, 0x0000000000000054)) 83