83 lines · plain
1; RUN: rm -rf %t2; RUN: mkdir %t3; RUN: cd %t4; RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-locaddrx.s \5; RUN: -split-dwarf-file=mainlocadddrx.dwo -o mainlocadddrx.o6; RUN: %clang %cflags -gdwarf-5 -gsplit-dwarf=split mainlocadddrx.o -o mainlocadddrx.exe -fno-pic -no-pie7; RUN: llvm-bolt mainlocadddrx.exe -o mainlocadddrx.exe.bolt --update-debug-sections --always-convert-to-ranges8; RUN: llvm-dwarfdump --show-form --verbose --debug-info mainlocadddrx.exe | FileCheck -check-prefix=PRE-BOLT %s9; RUN: llvm-dwarfdump --show-form --verbose --debug-addr mainlocadddrx.exe.bolt &> %t/foo.txt10; RUN: llvm-dwarfdump --show-form --verbose --debug-info mainlocadddrx.exe.bolt >> %t/foo.txt11; RUN: cat %t/foo.txt | FileCheck -check-prefix=BOLT %s12; RUN: llvm-dwarfdump --show-form --verbose --debug-info mainlocadddrx.dwo | FileCheck -check-prefix=PRE-BOLT-DWO %s13; RUN: llvm-dwarfdump --show-form --verbose --debug-info mainlocadddrx.dwo.dwo | FileCheck -check-prefix=BOLT-DWO %s14 15;; Testing dwarf5 split dwarf. Making sure DW_AT_low_pc/DW_AT_high_pc are converted correctly in the binary and in dwo.16;; Checking that DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x0) is updated correctly.17 18; PRE-BOLT: version = 0x000519; PRE-BOLT: DW_TAG_skeleton_unit20; PRE-BOLT: DW_AT_low_pc [DW_FORM_addrx]21; PRE-BOLT-NEXT: DW_AT_high_pc [DW_FORM_data4]22; PRE-BOLT: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000008)23 24; BOLT: Addrs: [25; BOLT-NEXT: 0x26; BOLT-NEXT: 0x27; BOLT-NEXT: 0x[[#%.16x,ADDR:]]28; BOLT-NEXT: 0x[[#%.16x,ADDR2:]]29; BOLT: DW_TAG_skeleton_unit30; BOLT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000004) address = 0x0000000000000000)31; BOLT-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x0000001032; BOLT-NEXT: [0x[[#ADDR]]33; BOLT-SAME: 0x[[#ADDR + 0x24]]34; BOLT-NEXT: [0x[[#ADDR2]]35; BOLT-SAME: 0x[[#ADDR2 + 0x54]]36; BOLT-NEXT: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000008)37; BOLT-NEXT: DW_AT_rnglists_base [DW_FORM_sec_offset] (0x0000000c)38 39; PRE-BOLT-DWO: version = 0x000540; PRE-BOLT-DWO: DW_TAG_compile_unit41; PRE-BOLT-DWO: DW_TAG_variable [2]42; PRE-BOLT-DWO-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000000) string = "x")43; PRE-BOLT-DWO-NEXT: DW_AT_type44; PRE-BOLT-DWO-NEXT: DW_AT_external45; PRE-BOLT-DWO-NEXT: DW_AT_decl_file46; PRE-BOLT-DWO-NEXT: DW_AT_decl_line47; PRE-BOLT-DWO-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x0)48; PRE-BOLT-DWO: DW_TAG_variable [2]49; PRE-BOLT-DWO-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000002) string = "y")50; PRE-BOLT-DWO-NEXT: DW_AT_type51; PRE-BOLT-DWO-NEXT: DW_AT_external52; PRE-BOLT-DWO-NEXT: DW_AT_decl_file53; PRE-BOLT-DWO-NEXT: DW_AT_decl_line54; PRE-BOLT-DWO-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x1)55; PRE-BOLT-DWO: DW_TAG_subprogram56; PRE-BOLT-DWO-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000002)57; PRE-BOLT-DWO-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000024)58; PRE-BOLT-DWO: DW_TAG_subprogram59; PRE-BOLT-DWO-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000003)60; PRE-BOLT-DWO-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x0000005a)61 62; BOLT-DWO: DW_TAG_compile_unit63; BOLT-DWO: DW_TAG_variable [2]64; BOLT-DWO-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000000) string = "x")65; BOLT-DWO-NEXT: DW_AT_type66; BOLT-DWO-NEXT: DW_AT_external67; BOLT-DWO-NEXT: DW_AT_decl_file68; BOLT-DWO-NEXT: DW_AT_decl_line69; BOLT-DWO-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x0)70; BOLT-DWO: DW_TAG_variable [2]71; BOLT-DWO-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000002) string = "y")72; BOLT-DWO-NEXT: DW_AT_type73; BOLT-DWO-NEXT: DW_AT_external74; BOLT-DWO-NEXT: DW_AT_decl_file75; BOLT-DWO-NEXT: DW_AT_decl_line76; BOLT-DWO-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x1)77; BOLT-DWO: DW_TAG_subprogram [4]78; BOLT-DWO-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x0000001479; BOLT-DWO-NEXT: [0x0000000000000000, 0x0000000000000024))80; BOLT-DWO: DW_TAG_subprogram [6]81; BOLT-DWO-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x1) rangelist = 0x0000001882; BOLT-DWO-NEXT: [0x0000000000000000, 0x0000000000000054))83