1*97b8cd54SFangrui Song# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t 2*97b8cd54SFangrui Song# RUN: llvm-dwarfdump -debug-names %t | FileCheck %s 3*97b8cd54SFangrui Song 4*97b8cd54SFangrui Song# CHECK: LocalTU[0]: 0x0000000d 5*97b8cd54SFangrui Song# CHECK-NEXT: LocalTU[1]: 0x00000028 6*97b8cd54SFangrui Song# CHECK: ForeignTU[0]: 0x0011223344556677 7*97b8cd54SFangrui Song# CHECK-NEXT: ForeignTU[1]: 0x1122334455667788 8*97b8cd54SFangrui Song 9*97b8cd54SFangrui Song .section .debug_abbrev,"",@progbits 10*97b8cd54SFangrui Song .byte 1 # Abbreviation Code 11*97b8cd54SFangrui Song .byte 17 # DW_TAG_compile_unit 12*97b8cd54SFangrui Song .byte 0 # DW_CHILDREN_no 13*97b8cd54SFangrui Song .byte 0 # EOM(1) 14*97b8cd54SFangrui Song .byte 0 # EOM(2) 15*97b8cd54SFangrui Song .byte 2 # Abbreviation Code 16*97b8cd54SFangrui Song .byte 19 # DW_TAG_structure_type 17*97b8cd54SFangrui Song .byte 0 # DW_CHILDREN_no 18*97b8cd54SFangrui Song .byte 3 # DW_AT_name 19*97b8cd54SFangrui Song .byte 8 # DW_FORM_string 20*97b8cd54SFangrui Song .byte 0 # EOM(1) 21*97b8cd54SFangrui Song .byte 0 # EOM(2) 22*97b8cd54SFangrui Song .byte 0 23*97b8cd54SFangrui Song 24*97b8cd54SFangrui Song .section .debug_names,"",@progbits 25*97b8cd54SFangrui Song .long .Lnames_end0-.Lnames_start0 # Header: unit length 26*97b8cd54SFangrui Song.Lnames_start0: 27*97b8cd54SFangrui Song .short 5 # Header: version 28*97b8cd54SFangrui Song .short 0 # Header: padding 29*97b8cd54SFangrui Song .long 1 # Header: compilation unit count 30*97b8cd54SFangrui Song .long 2 # Header: local type unit count 31*97b8cd54SFangrui Song .long 2 # Header: foreign type unit count 32*97b8cd54SFangrui Song .long 0 # Header: bucket count 33*97b8cd54SFangrui Song .long 2 # Header: name count 34*97b8cd54SFangrui Song .long .Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size 35*97b8cd54SFangrui Song .long 0 # Header: augmentation string size 36*97b8cd54SFangrui Song .long .Lcu_begin0 # Compilation unit 0 37*97b8cd54SFangrui Song .long .Ltu_begin0 # Local TU 0 38*97b8cd54SFangrui Song .long .Ltu_begin1 # Local TU 1 39*97b8cd54SFangrui Song .quad 0x0011223344556677 # Foreign TU 0 40*97b8cd54SFangrui Song .quad 0x1122334455667788 # Foreign TU 1 41*97b8cd54SFangrui Song .long .Lstring0 # String in Bucket 0: A 42*97b8cd54SFangrui Song .long .Lstring1 # String in Bucket 1: B 43*97b8cd54SFangrui Song .long .Lnames0-.Lnames_entries0 # Offset in Bucket 0 44*97b8cd54SFangrui Song .long .Lnames1-.Lnames_entries0 # Offset in Bucket 1 45*97b8cd54SFangrui Song 46*97b8cd54SFangrui Song.Lnames_abbrev_start0: 47*97b8cd54SFangrui Song .byte 1 # Abbrev code 48*97b8cd54SFangrui Song .byte 19 # DW_TAG_structure_type 49*97b8cd54SFangrui Song .byte 3 # DW_IDX_die_offset 50*97b8cd54SFangrui Song .byte 19 # DW_FORM_ref4 51*97b8cd54SFangrui Song .byte 0 # End of abbrev 52*97b8cd54SFangrui Song .byte 0 # End of abbrev 53*97b8cd54SFangrui Song .byte 0 # End of abbrev list 54*97b8cd54SFangrui Song.Lnames_abbrev_end0: 55*97b8cd54SFangrui Song.Lnames_entries0: 56*97b8cd54SFangrui Song.Lnames0: 57*97b8cd54SFangrui Song .byte 1 # Abbreviation code 58*97b8cd54SFangrui Song .long .Ltu_die0-.Lcu_begin0 # DW_IDX_die_offset 59*97b8cd54SFangrui Song .long 0 # End of list: A 60*97b8cd54SFangrui Song.Lnames1: 61*97b8cd54SFangrui Song .byte 1 # Abbreviation code 62*97b8cd54SFangrui Song .long .Ltu_die1-.Lcu_begin0 # DW_IDX_die_offset 63*97b8cd54SFangrui Song .long 0 # End of list: B 64*97b8cd54SFangrui Song .p2align 2 65*97b8cd54SFangrui Song.Lnames_end0: 66*97b8cd54SFangrui Song 67*97b8cd54SFangrui Song .section .debug_info,"",@progbits 68*97b8cd54SFangrui Song.Lcu_begin0: 69*97b8cd54SFangrui Song .long .Lcu_end0-.Lcu_begin0-4 # Length of Unit 70*97b8cd54SFangrui Song .short 5 # DWARF version number 71*97b8cd54SFangrui Song .byte 1 # DW_UT_compile 72*97b8cd54SFangrui Song .byte 8 # Address Size (in bytes) 73*97b8cd54SFangrui Song .long .debug_abbrev # Offset Into Abbrev. Section 74*97b8cd54SFangrui Song .byte 1 # Abbrev [1] DW_TAG_compile_unit 75*97b8cd54SFangrui Song.Lcu_end0: 76*97b8cd54SFangrui Song 77*97b8cd54SFangrui Song.Ltu_begin0: 78*97b8cd54SFangrui Song .long .Ltu_end0-.Ltu_begin0-4 # Length of Unit 79*97b8cd54SFangrui Song .short 5 # DWARF version number 80*97b8cd54SFangrui Song .byte 2 # DW_UT_type 81*97b8cd54SFangrui Song .byte 8 # Address Size (in bytes) 82*97b8cd54SFangrui Song .long .debug_abbrev # Offset Into Abbrev. Section 83*97b8cd54SFangrui Song .quad 0x0011223344556677 # Type Signature 84*97b8cd54SFangrui Song .long .Ltu_die0-.Ltu_begin0 # Type Offset 85*97b8cd54SFangrui Song.Ltu_die0: 86*97b8cd54SFangrui Song .byte 2 # Abbrev [2] DW_TAG_structure_type 87*97b8cd54SFangrui Song .asciz "A" 88*97b8cd54SFangrui Song.Ltu_end0: 89*97b8cd54SFangrui Song 90*97b8cd54SFangrui Song.Ltu_begin1: 91*97b8cd54SFangrui Song .long .Ltu_end1-.Ltu_begin1-4 # Length of Unit 92*97b8cd54SFangrui Song .short 5 # DWARF version number 93*97b8cd54SFangrui Song .byte 2 # DW_UT_type 94*97b8cd54SFangrui Song .byte 8 # Address Size (in bytes) 95*97b8cd54SFangrui Song .long .debug_abbrev # Offset Into Abbrev. Section 96*97b8cd54SFangrui Song .quad 0x1122334455667788 # Type Signature 97*97b8cd54SFangrui Song .long .Ltu_die1-.Ltu_begin1 # Type Offset 98*97b8cd54SFangrui Song.Ltu_die1: 99*97b8cd54SFangrui Song .byte 2 # Abbrev [1] 0xc:0x48 DW_TAG_structure_type 100*97b8cd54SFangrui Song .asciz "B" 101*97b8cd54SFangrui Song.Ltu_end1: 102*97b8cd54SFangrui Song 103*97b8cd54SFangrui Song .section .debug_str,"MS",@progbits,1 104*97b8cd54SFangrui Song.Lstring0: 105*97b8cd54SFangrui Song .asciz "A" 106*97b8cd54SFangrui Song.Lstring1: 107*97b8cd54SFangrui Song .asciz "B" 108