16de5fcc7SAlexander Yermolovich; RUN: rm -rf %t 26de5fcc7SAlexander Yermolovich; RUN: mkdir %t 36de5fcc7SAlexander Yermolovich; RUN: cd %t 46de5fcc7SAlexander Yermolovich; RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-df-debug-names-main.s \ 56de5fcc7SAlexander Yermolovich; RUN: -split-dwarf-file=main.dwo -o main.o 66de5fcc7SAlexander Yermolovich; RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-df-debug-names-helper.s \ 76de5fcc7SAlexander Yermolovich; RUN: -split-dwarf-file=helper.dwo -o helper.o 86de5fcc7SAlexander Yermolovich; RUN: %clang %cflags -gdwarf-5 -gsplit-dwarf=split main.o helper.o -o main.exe 96de5fcc7SAlexander Yermolovich; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections 106de5fcc7SAlexander Yermolovich; RUN: llvm-dwarfdump --debug-info --debug-names main.exe.bolt > log.txt 116de5fcc7SAlexander Yermolovich; RUN: cat log.txt | FileCheck -check-prefix=BOLT %s 126de5fcc7SAlexander Yermolovich 136de5fcc7SAlexander Yermolovich;; Tests that BOLT correctly generates .debug_names section with two CUs for split dwarf. 146de5fcc7SAlexander Yermolovich 156de5fcc7SAlexander Yermolovich; BOLT: [[OFFSET:0x[0-9a-f]*]]: Compile Unit 166de5fcc7SAlexander Yermolovich; BOLT: [[OFFSET1:0x[0-9a-f]*]]: Compile Unit 17*a4610c71SAlexander Yermolovich; BOLT: Name Index @ 0x0 { 18*a4610c71SAlexander Yermolovich; BOLT-NEXT: Header { 19*a4610c71SAlexander Yermolovich; BOLT-NEXT: Length: 0xFC 20*a4610c71SAlexander Yermolovich; BOLT-NEXT: Format: DWARF32 21*a4610c71SAlexander Yermolovich; BOLT-NEXT: Version: 5 22*a4610c71SAlexander Yermolovich; BOLT-NEXT: CU count: 2 23*a4610c71SAlexander Yermolovich; BOLT-NEXT: Local TU count: 0 24*a4610c71SAlexander Yermolovich; BOLT-NEXT: Foreign TU count: 0 25*a4610c71SAlexander Yermolovich; BOLT-NEXT: Bucket count: 7 26*a4610c71SAlexander Yermolovich; BOLT-NEXT: Name count: 7 27*a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbreviations table size: 0x29 28*a4610c71SAlexander Yermolovich; BOLT-NEXT: Augmentation: 'BOLT' 29*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 30*a4610c71SAlexander Yermolovich; BOLT-NEXT: Compilation Unit offsets [ 31*a4610c71SAlexander Yermolovich; BOLT-NEXT: CU[0]: [[OFFSET]] 32*a4610c71SAlexander Yermolovich; BOLT-NEXT: CU[1]: [[OFFSET1]] 33*a4610c71SAlexander Yermolovich; BOLT-NEXT: ] 34*a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbreviations [ 35*a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbreviation [[ABBREV1:0x[0-9a-f]*]] { 36*a4610c71SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_structure_type 37*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_compile_unit: DW_FORM_data1 38*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: DW_FORM_ref4 39*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: DW_FORM_flag_present 40*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 41*a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbreviation [[ABBREV2:0x[0-9a-f]*]] { 42*a4610c71SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_base_type 43*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_compile_unit: DW_FORM_data1 44*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: DW_FORM_ref4 45*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: DW_FORM_flag_present 46*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 47*a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbreviation [[ABBREV3:0x[0-9a-f]*]] { 48*a4610c71SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_variable 49*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_compile_unit: DW_FORM_data1 50*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: DW_FORM_ref4 51*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: DW_FORM_flag_present 52*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 53*a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbreviation [[ABBREV4:0x[0-9a-f]*]] { 54*a4610c71SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_subprogram 55*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_compile_unit: DW_FORM_data1 56*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: DW_FORM_ref4 57*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: DW_FORM_flag_present 58*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 59*a4610c71SAlexander Yermolovich; BOLT-NEXT: ] 60*a4610c71SAlexander Yermolovich; BOLT-NEXT: Bucket 0 [ 61*a4610c71SAlexander Yermolovich; BOLT-NEXT: EMPTY 62*a4610c71SAlexander Yermolovich; BOLT-NEXT: ] 63*a4610c71SAlexander Yermolovich; BOLT-NEXT: Bucket 1 [ 64*a4610c71SAlexander Yermolovich; BOLT-NEXT: Name 1 { 65*a4610c71SAlexander Yermolovich; BOLT-NEXT: Hash: 0x7C96E4DB 66*a4610c71SAlexander Yermolovich; BOLT-NEXT: String: {{.+}} "Foo2" 67*a4610c71SAlexander Yermolovich; BOLT-NEXT: Entry @ {{.+}} { 68*a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV1]] 69*a4610c71SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_structure_type 70*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_compile_unit: 0x00 71*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x00000068 72*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: <parent not indexed> 73*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 74*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 75*a4610c71SAlexander Yermolovich; BOLT-NEXT: ] 76*a4610c71SAlexander Yermolovich; BOLT-NEXT: Bucket 2 [ 77*a4610c71SAlexander Yermolovich; BOLT-NEXT: Name 2 { 78*a4610c71SAlexander Yermolovich; BOLT-NEXT: Hash: 0xBA564846 79*a4610c71SAlexander Yermolovich; BOLT-NEXT: String: {{.+}} "Foo2Int" 80*a4610c71SAlexander Yermolovich; BOLT-NEXT: Entry @ {{.+}} { 81*a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV1]] 82*a4610c71SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_structure_type 83*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_compile_unit: 0x01 84*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x00000025 85*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: <parent not indexed> 86*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 87*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 88*a4610c71SAlexander Yermolovich; BOLT-NEXT: ] 89*a4610c71SAlexander Yermolovich; BOLT-NEXT: Bucket 3 [ 90*a4610c71SAlexander Yermolovich; BOLT-NEXT: Name 3 { 91*a4610c71SAlexander Yermolovich; BOLT-NEXT: Hash: 0xB888030 92*a4610c71SAlexander Yermolovich; BOLT-NEXT: String: {{.+}} "int" 93*a4610c71SAlexander Yermolovich; BOLT-NEXT: Entry @ {{.+}} { 94*a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV2]] 95*a4610c71SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_base_type 96*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_compile_unit: 0x01 97*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x00000043 98*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: <parent not indexed> 99*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 100*a4610c71SAlexander Yermolovich; BOLT-NEXT: Entry @ {{.+}} { 101*a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV2]] 102*a4610c71SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_base_type 103*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_compile_unit: 0x00 104*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x00000056 105*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: <parent not indexed> 106*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 107*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 108*a4610c71SAlexander Yermolovich; BOLT-NEXT: Name 4 { 109*a4610c71SAlexander Yermolovich; BOLT-NEXT: Hash: 0xF73809C 110*a4610c71SAlexander Yermolovich; BOLT-NEXT: String: {{.+}} "Foo2a" 111*a4610c71SAlexander Yermolovich; BOLT-NEXT: Entry @ {{.+}} { 112*a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV1]] 113*a4610c71SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_structure_type 114*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_compile_unit: 0x00 115*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x00000078 116*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: <parent not indexed> 117*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 118*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 119*a4610c71SAlexander Yermolovich; BOLT-NEXT: Name 5 { 120*a4610c71SAlexander Yermolovich; BOLT-NEXT: Hash: 0x7C96CB76 121*a4610c71SAlexander Yermolovich; BOLT-NEXT: String: {{.+}} "fint" 122*a4610c71SAlexander Yermolovich; BOLT-NEXT: Entry @ {{.+}} { 123*a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV3]] 124*a4610c71SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_variable 125*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_compile_unit: 0x01 126*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x0000001a 127*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: <parent not indexed> 128*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 129*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 130*a4610c71SAlexander Yermolovich; BOLT-NEXT: Name 6 { 131*a4610c71SAlexander Yermolovich; BOLT-NEXT: Hash: 0x7C9A7F6A 132*a4610c71SAlexander Yermolovich; BOLT-NEXT: String: {{.+}} "main" 133*a4610c71SAlexander Yermolovich; BOLT-NEXT: Entry @ {{.+}} { 134*a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV4]] 135*a4610c71SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_subprogram 136*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_compile_unit: 0x00 137*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x0000001a 138*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: <parent not indexed> 139*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 140*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 141*a4610c71SAlexander Yermolovich; BOLT-NEXT: ] 142*a4610c71SAlexander Yermolovich; BOLT-NEXT: Bucket 4 [ 143*a4610c71SAlexander Yermolovich; BOLT-NEXT: EMPTY 144*a4610c71SAlexander Yermolovich; BOLT-NEXT: ] 145*a4610c71SAlexander Yermolovich; BOLT-NEXT: Bucket 5 [ 146*a4610c71SAlexander Yermolovich; BOLT-NEXT: Name 7 { 147*a4610c71SAlexander Yermolovich; BOLT-NEXT: Hash: 0x7C952063 148*a4610c71SAlexander Yermolovich; BOLT-NEXT: String: {{.+}} "char" 149*a4610c71SAlexander Yermolovich; BOLT-NEXT: Entry @ {{.+}} { 150*a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV2]] 151*a4610c71SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_base_type 152*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_compile_unit: 0x00 153*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x00000064 154*a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: <parent not indexed> 155*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 156*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 157*a4610c71SAlexander Yermolovich; BOLT-NEXT: ] 158*a4610c71SAlexander Yermolovich; BOLT-NEXT: Bucket 6 [ 159*a4610c71SAlexander Yermolovich; BOLT-NEXT: EMPTY 160*a4610c71SAlexander Yermolovich; BOLT-NEXT: ] 161*a4610c71SAlexander Yermolovich; BOLT-NEXT: } 162