11713f849SAlexander Yermolovich; REQUIRES: x86_64-linux 29eb0df3aSAlexander Yermolovich; RUN: rm -rf %t 39eb0df3aSAlexander Yermolovich; RUN: mkdir %t 49eb0df3aSAlexander Yermolovich; RUN: cd %t 59eb0df3aSAlexander Yermolovich; RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-df-inlined-subroutine-gc-sections-range-main.s \ 69eb0df3aSAlexander Yermolovich; RUN: -split-dwarf-file=main.dwo -o main.o 79eb0df3aSAlexander Yermolovich; RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-df-inlined-subroutine-gc-sections-range-helper.s \ 89eb0df3aSAlexander Yermolovich; RUN: -split-dwarf-file=helper.dwo -o helper.o 9*003b48e0SRaul Tambre; RUN: %clang -fuse-ld=lld -Wl,-gc-sections -Wl,-q -gdwarf-5 -gsplit-dwarf=split main.o helper.o -o main.exe 109eb0df3aSAlexander Yermolovich; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections 119eb0df3aSAlexander Yermolovich; RUN: llvm-dwarfdump --debug-addr main.exe > log.txt 129eb0df3aSAlexander Yermolovich; RUN: llvm-dwarfdump --debug-rnglists --verbose --show-form main.dwo >> log.txt 139eb0df3aSAlexander Yermolovich; RUN: llvm-dwarfdump --debug-info --verbose --show-form main.dwo >> log.txt 149eb0df3aSAlexander Yermolovich; RUN: llvm-dwarfdump --debug-rnglists --verbose --show-form helper.dwo >> log.txt 159eb0df3aSAlexander Yermolovich; RUN: llvm-dwarfdump --debug-info --verbose --show-form helper.dwo >> log.txt 169eb0df3aSAlexander Yermolovich; RUN: llvm-dwarfdump --debug-addr main.exe.bolt > logBolt.txt 179eb0df3aSAlexander Yermolovich; RUN: llvm-dwarfdump --debug-info --verbose --show-form main.dwo.dwo >> logBolt.txt 189eb0df3aSAlexander Yermolovich; RUN: llvm-dwarfdump --debug-info --verbose --show-form helper.dwo.dwo >> logBolt.txt 199eb0df3aSAlexander Yermolovich; RUN: cat log.txt | FileCheck -check-prefix=BOLT-PRE %s 209eb0df3aSAlexander Yermolovich; RUN: cat logBolt.txt | FileCheck -check-prefix=BOLT-MAIN %s 219eb0df3aSAlexander Yermolovich 2211791ae7SSayhaan Siddiqui;; Tests whether BOLT handles correctly DW_TAG_inlined_subroutine when DW_AT_ranges is 0, 2311791ae7SSayhaan Siddiqui;; and split dwarf is enabled. 249eb0df3aSAlexander Yermolovich 259eb0df3aSAlexander Yermolovich; BOLT-PRE: Addrs: 269eb0df3aSAlexander Yermolovich; BOLT-PRE: 0x0000000000000000 279eb0df3aSAlexander Yermolovich; BOLT-PRE: 0x0000000000000000 289eb0df3aSAlexander Yermolovich; BOLT-PRE-NOT: 0x0000000000000000 299eb0df3aSAlexander Yermolovich; BOLT-PRE: Addrs: 309eb0df3aSAlexander Yermolovich; BOLT-PRE: 0x0000000000000000 319eb0df3aSAlexander Yermolovich; BOLT-PRE: 0x0000000000000000 329eb0df3aSAlexander Yermolovich; BOLT-PRE: 0x0000000000000000 339eb0df3aSAlexander Yermolovich 349eb0df3aSAlexander Yermolovich; main.dwo 359eb0df3aSAlexander Yermolovich; BOLT-PRE: [DW_RLE_base_addressx]: 0x0000000000000002 369eb0df3aSAlexander Yermolovich; BOLT-PRE: [DW_RLE_offset_pair ]: 0x0000000000000018, 0x000000000000002d => [0x000000000000001a, 0x000000000000002f) 379eb0df3aSAlexander Yermolovich; BOLT-PRE: [DW_RLE_end_of_list ] 389eb0df3aSAlexander Yermolovich; BOLT-PRE: [DW_RLE_base_addressx]: 0x0000000000000002 399eb0df3aSAlexander Yermolovich; BOLT-PRE: [DW_RLE_offset_pair ]: 0x0000000000000033, 0x0000000000000042 => [0x0000000000000035, 0x0000000000000044) 409eb0df3aSAlexander Yermolovich; BOLT-PRE: [DW_RLE_end_of_list ] 419eb0df3aSAlexander Yermolovich; BOLT-PRE: DW_TAG_inlined_subroutine [9] * (0x0000006c) 429eb0df3aSAlexander Yermolovich; BOLT-PRE: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x0044 => {0x00000044} "_Z7doStuffi") 439eb0df3aSAlexander Yermolovich; BOLT-PRE: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000014 449eb0df3aSAlexander Yermolovich; BOLT-PRE: [0x000000000000001a, 0x000000000000002f)) 459eb0df3aSAlexander Yermolovich; BOLT-PRE: DW_TAG_inlined_subroutine [9] * (0x0000006c) 469eb0df3aSAlexander Yermolovich; BOLT-PRE: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x005a => {0x0000005a} "_Z11doStuffSamei") 479eb0df3aSAlexander Yermolovich; BOLT-PRE: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x1) rangelist = 0x0000001a 489eb0df3aSAlexander Yermolovich; BOLT-PRE: [0x0000000000000035, 0x0000000000000044)) 499eb0df3aSAlexander Yermolovich 509eb0df3aSAlexander Yermolovich; helper.dwo 519eb0df3aSAlexander Yermolovich; BOLT-PRE: [DW_RLE_base_addressx]: 0x0000000000000002 529eb0df3aSAlexander Yermolovich; BOLT-PRE: [DW_RLE_offset_pair ]: 0x000000000000000d, 0x000000000000001a => [0x000000000000000f, 0x000000000000001c) 539eb0df3aSAlexander Yermolovich; BOLT-PRE: [DW_RLE_end_of_list ] 549eb0df3aSAlexander Yermolovich; BOLT-PRE: [DW_RLE_base_addressx]: 0x0000000000000002 559eb0df3aSAlexander Yermolovich; BOLT-PRE: [DW_RLE_offset_pair ]: 0x0000000000000020, 0x000000000000002d => [0x0000000000000022, 0x000000000000002f) 569eb0df3aSAlexander Yermolovich; BOLT-PRE: [DW_RLE_end_of_list ] 579eb0df3aSAlexander Yermolovich; BOLT-PRE: DW_TAG_inlined_subroutine [11] * (0x0000008c) 589eb0df3aSAlexander Yermolovich; BOLT-PRE: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x0054 => {0x00000054} "_Z12doStuff2Samei") 599eb0df3aSAlexander Yermolovich; BOLT-PRE: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000014 609eb0df3aSAlexander Yermolovich; BOLT-PRE: [0x000000000000000f, 0x000000000000001c)) 619eb0df3aSAlexander Yermolovich; BOLT-PRE: DW_TAG_inlined_subroutine [11] * (0x0000008c) 629eb0df3aSAlexander Yermolovich; BOLT-PRE: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x0072 => {0x00000072} "_Z8doStuff2i") 639eb0df3aSAlexander Yermolovich; BOLT-PRE: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x1) rangelist = 0x0000001a 649eb0df3aSAlexander Yermolovich; BOLT-PRE: [0x0000000000000022, 0x000000000000002f)) 659eb0df3aSAlexander Yermolovich 669eb0df3aSAlexander Yermolovich; BOLT-MAIN: Addrs: 679eb0df3aSAlexander Yermolovich; BOLT-MAIN: 0x0000000000000000 689eb0df3aSAlexander Yermolovich; BOLT-MAIN-NOT: 0x0000000000000000 699eb0df3aSAlexander Yermolovich; BOLT-MAIN-NOT: 0x0000000000000000 709eb0df3aSAlexander Yermolovich; BOLT-MAIN-NOT: 0x0000000000000000 719eb0df3aSAlexander Yermolovich; BOLT-MAIN: Addrs: 729eb0df3aSAlexander Yermolovich; BOLT-MAIN: 0x0000000000000000 739eb0df3aSAlexander Yermolovich 749eb0df3aSAlexander Yermolovich; main.dwo.dwo 759eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_TAG_inlined_subroutine 769eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x0044 => {0x00000044} "_Z7doStuffi") 779eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_call_file 789eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_call_line 799eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_call_column 809eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000002) address = <unresolved>) 819eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_high_pc [DW_FORM_data4] (0x00000015) 829eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_TAG_inlined_subroutine 839eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x005a => {0x0000005a} "_Z11doStuffSamei") 849eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_call_file 859eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_call_line 869eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_call_column 879eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000003) address = <unresolved>) 889eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_high_pc [DW_FORM_data4] (0x0000000f) 899eb0df3aSAlexander Yermolovich 909eb0df3aSAlexander Yermolovich; helper.dwo.dwo 919eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_TAG_inlined_subroutine 929eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x0054 => {0x00000054} "_Z12doStuff2Samei") 939eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_call_file 949eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_call_line 959eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_call_column 969eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000000) address = <unresolved>) 979eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_high_pc [DW_FORM_data4] (0x0000001a) 989eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_TAG_inlined_subroutine 999eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x0072 => {0x00000072} "_Z8doStuff2i") 1009eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_call_file 1019eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_call_line 1029eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_call_column 1039eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000000) address = <unresolved>) 1049eb0df3aSAlexander Yermolovich; BOLT-MAIN: DW_AT_high_pc [DW_FORM_data4] (0x0000002d) 105