16de5fcc7SAlexander Yermolovich; RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-debug-names-main.s -o %tmain.o 26de5fcc7SAlexander Yermolovich; RUN: %clang %cflags -gdwarf-5 %tmain.o -o %tmain.exe 36de5fcc7SAlexander Yermolovich; RUN: llvm-bolt %tmain.exe -o %tmain.exe.bolt --update-debug-sections 46de5fcc7SAlexander Yermolovich; RUN: llvm-dwarfdump --debug-info -r 0 --debug-names %tmain.exe.bolt > %tlog.txt 56de5fcc7SAlexander Yermolovich; RUN: cat %tlog.txt | FileCheck -check-prefix=BOLT %s 66de5fcc7SAlexander Yermolovich 76de5fcc7SAlexander Yermolovich;; Tests that BOLT correctly generates .debug_names section with one CUs 86de5fcc7SAlexander Yermolovich 96de5fcc7SAlexander Yermolovich; BOLT: [[OFFSET1:0x[0-9a-f]*]]: Compile Unit 106de5fcc7SAlexander Yermolovich; BOLT: Name Index @ 0x0 { 116de5fcc7SAlexander Yermolovich; BOLT-NEXT: Header { 12*48418588SAlexander Yermolovich; BOLT-NEXT: Length: 0x14F 136de5fcc7SAlexander Yermolovich; BOLT-NEXT: Format: DWARF32 146de5fcc7SAlexander Yermolovich; BOLT-NEXT: Version: 5 156de5fcc7SAlexander Yermolovich; BOLT-NEXT: CU count: 1 166de5fcc7SAlexander Yermolovich; BOLT-NEXT: Local TU count: 0 176de5fcc7SAlexander Yermolovich; BOLT-NEXT: Foreign TU count: 0 186de5fcc7SAlexander Yermolovich; BOLT-NEXT: Bucket count: 11 196de5fcc7SAlexander Yermolovich; BOLT-NEXT: Name count: 11 20a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbreviations table size: 0x31 216de5fcc7SAlexander Yermolovich; BOLT-NEXT: Augmentation: 'BOLT' 226de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 236de5fcc7SAlexander Yermolovich; BOLT-NEXT: Compilation Unit offsets [ 246de5fcc7SAlexander Yermolovich; BOLT-NEXT: CU[0]: [[OFFSET1]] 256de5fcc7SAlexander Yermolovich; BOLT-NEXT: ] 266de5fcc7SAlexander Yermolovich; BOLT-NEXT: Abbreviations [ 276de5fcc7SAlexander Yermolovich; BOLT-NEXT: Abbreviation [[ABBREV1:0x[0-9a-f]*]] { 286de5fcc7SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_structure_type 296de5fcc7SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: DW_FORM_ref4 30a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: DW_FORM_flag_present 316de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 326de5fcc7SAlexander Yermolovich; BOLT-NEXT: Abbreviation [[ABBREV2:0x[0-9a-f]*]] { 336de5fcc7SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_base_type 346de5fcc7SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: DW_FORM_ref4 35a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: DW_FORM_flag_present 366de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 376de5fcc7SAlexander Yermolovich; BOLT-NEXT: Abbreviation [[ABBREV3:0x[0-9a-f]*]] { 38a4610c71SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_structure_type 396de5fcc7SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: DW_FORM_ref4 40a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: DW_FORM_ref4 416de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 426de5fcc7SAlexander Yermolovich; BOLT-NEXT: Abbreviation [[ABBREV4:0x[0-9a-f]*]] { 43a4610c71SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_variable 446de5fcc7SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: DW_FORM_ref4 45a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: DW_FORM_flag_present 466de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 476de5fcc7SAlexander Yermolovich; BOLT-NEXT: Abbreviation [[ABBREV5:0x[0-9a-f]*]] { 48a4610c71SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_subprogram 49a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: DW_FORM_ref4 50a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: DW_FORM_flag_present 51a4610c71SAlexander Yermolovich; BOLT-NEXT: } 52a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbreviation [[ABBREV6:0x[0-9a-f]*]] { 536de5fcc7SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_namespace 546de5fcc7SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: DW_FORM_ref4 55a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: DW_FORM_flag_present 566de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 576de5fcc7SAlexander Yermolovich; BOLT-NEXT: ] 586de5fcc7SAlexander Yermolovich; BOLT-NEXT: Bucket 0 [ 596de5fcc7SAlexander Yermolovich; BOLT-NEXT: Name 1 { 606de5fcc7SAlexander Yermolovich; BOLT-NEXT: Hash: 0xF73809C 616de5fcc7SAlexander Yermolovich; BOLT-NEXT: String: {{.+}} "Foo2a" 626de5fcc7SAlexander Yermolovich; BOLT-NEXT: Entry @ {{.+}} { 636de5fcc7SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV1]] 646de5fcc7SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_structure_type 656de5fcc7SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x00000104 66a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: <parent not indexed> 676de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 686de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 696de5fcc7SAlexander Yermolovich; BOLT-NEXT: Name 2 { 706de5fcc7SAlexander Yermolovich; BOLT-NEXT: Hash: 0x7C952063 716de5fcc7SAlexander Yermolovich; BOLT-NEXT: String: {{.+}} "char" 726de5fcc7SAlexander Yermolovich; BOLT-NEXT: Entry @ {{.+}} { 736de5fcc7SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV2]] 746de5fcc7SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_base_type 756de5fcc7SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x000000c5 76a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: <parent not indexed> 776de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 786de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 796de5fcc7SAlexander Yermolovich; BOLT-NEXT: ] 806de5fcc7SAlexander Yermolovich; BOLT-NEXT: Bucket 1 [ 816de5fcc7SAlexander Yermolovich; BOLT-NEXT: Name 3 { 826de5fcc7SAlexander Yermolovich; BOLT-NEXT: Hash: 0xB887389 836de5fcc7SAlexander Yermolovich; BOLT-NEXT: String: {{.+}} "Foo" 846de5fcc7SAlexander Yermolovich; BOLT-NEXT: Entry @ {{.+}} { 856de5fcc7SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV1]] 866de5fcc7SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_structure_type 876de5fcc7SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x000000c9 88a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: <parent not indexed> 896de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 906de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 916de5fcc7SAlexander Yermolovich; BOLT-NEXT: Name 4 { 926de5fcc7SAlexander Yermolovich; BOLT-NEXT: Hash: 0x392140FA 936de5fcc7SAlexander Yermolovich; BOLT-NEXT: String: {{.+}} "t2<&fooint>" 946de5fcc7SAlexander Yermolovich; BOLT-NEXT: Entry @ {{.+}} { 956de5fcc7SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV1]] 966de5fcc7SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_structure_type 976de5fcc7SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x0000003f 98a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: <parent not indexed> 996de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 1006de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 1016de5fcc7SAlexander Yermolovich; BOLT-NEXT: ] 1026de5fcc7SAlexander Yermolovich; BOLT-NEXT: Bucket 2 [ 1036de5fcc7SAlexander Yermolovich; BOLT-NEXT: Name 5 { 1046de5fcc7SAlexander Yermolovich; BOLT-NEXT: Hash: 0x7C96E4DB 1056de5fcc7SAlexander Yermolovich; BOLT-NEXT: String: {{.+}} "Foo2" 1066de5fcc7SAlexander Yermolovich; BOLT-NEXT: Entry @ {{.+}} { 1076de5fcc7SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV1]] 1086de5fcc7SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_structure_type 1096de5fcc7SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x000000eb 110a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: <parent not indexed> 1116de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 1126de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 1136de5fcc7SAlexander Yermolovich; BOLT-NEXT: ] 1146de5fcc7SAlexander Yermolovich; BOLT-NEXT: Bucket 3 [ 1156de5fcc7SAlexander Yermolovich; BOLT-NEXT: EMPTY 1166de5fcc7SAlexander Yermolovich; BOLT-NEXT: ] 1176de5fcc7SAlexander Yermolovich; BOLT-NEXT: Bucket 4 [ 1186de5fcc7SAlexander Yermolovich; BOLT-NEXT: EMPTY 1196de5fcc7SAlexander Yermolovich; BOLT-NEXT: ] 1206de5fcc7SAlexander Yermolovich; BOLT-NEXT: Bucket 5 [ 1216de5fcc7SAlexander Yermolovich; BOLT-NEXT: Name 6 { 1226de5fcc7SAlexander Yermolovich; BOLT-NEXT: Hash: 0x59796A 1236de5fcc7SAlexander Yermolovich; BOLT-NEXT: String: {{.+}} "t1" 1246de5fcc7SAlexander Yermolovich; BOLT-NEXT: Entry @ {{.+}} { 125a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV3]] 1266de5fcc7SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_structure_type 1276de5fcc7SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x00000062 128a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: Entry @ 0x14d 1296de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 1306de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 1316de5fcc7SAlexander Yermolovich; BOLT-NEXT: Name 7 { 1326de5fcc7SAlexander Yermolovich; BOLT-NEXT: Hash: 0x5979AC 1336de5fcc7SAlexander Yermolovich; BOLT-NEXT: String: {{.+}} "v1" 1346de5fcc7SAlexander Yermolovich; BOLT-NEXT: Entry @ {{.+}} { 135a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV4]] 1366de5fcc7SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_variable 1376de5fcc7SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x00000024 138a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: <parent not indexed> 1396de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 1406de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 1416de5fcc7SAlexander Yermolovich; BOLT-NEXT: ] 1426de5fcc7SAlexander Yermolovich; BOLT-NEXT: Bucket 6 [ 1436de5fcc7SAlexander Yermolovich; BOLT-NEXT: Name 8 { 1446de5fcc7SAlexander Yermolovich; BOLT-NEXT: Hash: 0xB888030 1456de5fcc7SAlexander Yermolovich; BOLT-NEXT: String: {{.+}} "int" 1466de5fcc7SAlexander Yermolovich; BOLT-NEXT: Entry @ {{.+}} { 1476de5fcc7SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV2]] 1486de5fcc7SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_base_type 1496de5fcc7SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x0000005d 150a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: <parent not indexed> 1516de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 1526de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 1536de5fcc7SAlexander Yermolovich; BOLT-NEXT: ] 1546de5fcc7SAlexander Yermolovich; BOLT-NEXT: Bucket 7 [ 1556de5fcc7SAlexander Yermolovich; BOLT-NEXT: Name 9 { 1566de5fcc7SAlexander Yermolovich; BOLT-NEXT: Hash: 0x59796C 1576de5fcc7SAlexander Yermolovich; BOLT-NEXT: String: {{.+}} "t3" 1586de5fcc7SAlexander Yermolovich; BOLT-NEXT: Entry @ {{.+}} { 1596de5fcc7SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV1]] 1606de5fcc7SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_structure_type 1616de5fcc7SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x0000002f 162a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: <parent not indexed> 1636de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 1646de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 1656de5fcc7SAlexander Yermolovich; BOLT-NEXT: Name 10 { 1666de5fcc7SAlexander Yermolovich; BOLT-NEXT: Hash: 0x7C9A7F6A 1676de5fcc7SAlexander Yermolovich; BOLT-NEXT: String: {{.+}} "main" 1686de5fcc7SAlexander Yermolovich; BOLT-NEXT: Entry @ {{.+}} { 169a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV5]] 1706de5fcc7SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_subprogram 1716de5fcc7SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x00000073 172a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: <parent not indexed> 1736de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 1746de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 1756de5fcc7SAlexander Yermolovich; BOLT-NEXT: ] 1766de5fcc7SAlexander Yermolovich; BOLT-NEXT: Bucket 8 [ 1776de5fcc7SAlexander Yermolovich; BOLT-NEXT: Name 11 { 1786de5fcc7SAlexander Yermolovich; BOLT-NEXT: Hash: 0x8CFC710C 1796de5fcc7SAlexander Yermolovich; BOLT-NEXT: String: {{.+}} "(anonymous namespace)" 180a4610c71SAlexander Yermolovich; BOLT-NEXT: Entry @ 0x14d { 181a4610c71SAlexander Yermolovich; BOLT-NEXT: Abbrev: [[ABBREV6]] 1826de5fcc7SAlexander Yermolovich; BOLT-NEXT: Tag: DW_TAG_namespace 1836de5fcc7SAlexander Yermolovich; BOLT-NEXT: DW_IDX_die_offset: 0x00000061 184a4610c71SAlexander Yermolovich; BOLT-NEXT: DW_IDX_parent: <parent not indexed> 1856de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 1866de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 1876de5fcc7SAlexander Yermolovich; BOLT-NEXT: ] 1886de5fcc7SAlexander Yermolovich; BOLT-NEXT: Bucket 9 [ 1896de5fcc7SAlexander Yermolovich; BOLT-NEXT: EMPTY 1906de5fcc7SAlexander Yermolovich; BOLT-NEXT: ] 1916de5fcc7SAlexander Yermolovich; BOLT-NEXT: Bucket 10 [ 1926de5fcc7SAlexander Yermolovich; BOLT-NEXT: EMPTY 1936de5fcc7SAlexander Yermolovich; BOLT-NEXT: ] 1946de5fcc7SAlexander Yermolovich; BOLT-NEXT: } 195