1RUN: dsymutil -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 | FileCheck %s 2RUN: dsymutil -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic-lto.macho.x86_64 | FileCheck %s --check-prefix=CHECK-LTO 3RUN: dsymutil -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic-archive.macho.x86_64 | FileCheck %s --check-prefix=CHECK-ARCHIVE 4RUN: dsymutil -no-output -verbose -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 %p/Inputs/basic-lto.macho.x86_64 %p/Inputs/basic-archive.macho.x86_64 | FileCheck %s --check-prefixes=CHECK,CHECK-LTO,CHECK-ARCHIVE 5 6This test check the basic Dwarf linking process through the debug dumps. 7 8================================= Simple link ================================ 9CHECK: DEBUG MAP OBJECT: {{.*}}basic1.macho.x86_64.o 10CHECK: Input compilation unit: 11CHECK-NEXT: TAG_compile_unit 12CHECK-NOT: TAG 13CHECK: AT_name {{.*}}basic1.c 14 15CHECK: DEBUG MAP OBJECT: {{.*}}basic2.macho.x86_64.o 16CHECK: Input compilation unit: 17CHECK-NEXT: TAG_compile_unit 18CHECK-NOT: TAG 19CHECK: AT_name {{.*}}basic2.c 20 21CHECK: DEBUG MAP OBJECT: {{.*}}basic3.macho.x86_64.o 22CHECK: Input compilation unit: 23CHECK-NEXT: TAG_compile_unit 24CHECK-NOT: TAG 25CHECK: AT_name {{.*}}basic3.c 26 27CHECK-NOT: Found valid debug map entry 28CHECK: Found valid debug map entry: _main 0x0000000000000000 => 0x0000000100000ea0 29CHECK-NEXT: Keeping subprogram DIE: 30CHECK-NEXT: DW_TAG_subprogram 31CHECK-NEXT: DW_AT_name{{.*}}"main" 32 33CHECK: Found valid debug map entry: _private_int 0x0000000000000560 => 0x0000000100001008 34CHECK-NEXT: Keeping variable DIE: 35CHECK-NEXT: DW_TAG_variable 36CHECK-NEXT: DW_AT_name {{.*}}"private_int" 37CHECK-NOT: Found valid debug map entry 38CHECK: Found valid debug map entry: _baz 0x0000000000000310 => 0x0000000100001000 39CHECK-NEXT: Keeping variable DIE: 40CHECK-NEXT: DW_TAG_variable 41CHECK-NEXT: DW_AT_name {{.*}}"baz" 42CHECK-NOT: Found valid debug map entry 43CHECK: Found valid debug map entry: _foo 0x0000000000000020 => 0x0000000100000ed0 44CHECK-NEXT: Keeping subprogram DIE: 45CHECK-NEXT: DW_TAG_subprogram 46CHECK-NEXT: DW_AT_name {{.*}}"foo" 47CHECK-NOT: Found valid debug map entry 48CHECK: Found valid debug map entry: _inc 0x0000000000000070 => 0x0000000100000f20 49CHECK-NEXT: Keeping subprogram DIE: 50CHECK-NEXT: DW_TAG_subprogram 51CHECK-NEXT: DW_AT_name {{.*}}"inc" 52 53CHECK-NOT: Found valid debug map entry 54CHECK: Found valid debug map entry: _val 0xffffffffffffffff => 0x0000000100001004 55CHECK-NEXT: Keeping variable DIE: 56CHECK-NEXT: DW_TAG_variable 57CHECK-NEXT: DW_AT_name {{.*}}"val" 58CHECK-NOT: Found valid debug map entry 59CHECK: Found valid debug map entry: _bar 0x0000000000000020 => 0x0000000100000f40 60CHECK-NEXT: Keeping subprogram DIE: 61CHECK-NEXT: DW_TAG_subprogram 62CHECK-NEXT: DW_AT_name {{.*}}"bar" 63CHECK-NOT: Found valid debug map entry 64CHECK: Found valid debug map entry: _inc 0x0000000000000070 => 0x0000000100000f90 65CHECK-NEXT: Keeping subprogram DIE: 66CHECK-NEXT: DW_TAG_subprogram 67CHECK-NEXT: DW_AT_name {{.*}}"inc") 68 69 70================================= LTO link ================================ 71CHECK-LTO: DEBUG MAP OBJECT: {{.*}}basic-lto.macho.x86_64.o 72CHECK-LTO: Input compilation unit: 73CHECK-LTO-NEXT: TAG_compile_unit 74CHECK-LTO-NOT: TAG 75CHECK-LTO: AT_name {{.*}}basic1.c 76CHECK-LTO: Input compilation unit: 77CHECK-LTO-NEXT: TAG_compile_unit 78CHECK-LTO-NOT: TAG 79CHECK-LTO: AT_name {{.*}}basic2.c 80CHECK-LTO: Input compilation unit: 81CHECK-LTO-NEXT: TAG_compile_unit 82CHECK-LTO-NOT: TAG 83CHECK-LTO: AT_name {{.*}}basic3.c 84 85CHECK-LTO-NOT: Found valid debug map entry 86CHECK-LTO: Found valid debug map entry: _main 0x0000000000000000 => 0x0000000100000f40 87CHECK-LTO-NEXT: Keeping subprogram DIE: 88CHECK-LTO-NEXT: DW_TAG_subprogram 89CHECK-LTO-NEXT: DW_AT_name {{.*}}"main" 90CHECK-LTO-NOT: Found valid debug map entry 91CHECK-LTO: Found valid debug map entry: _private_int 0x00000000000008e8 => 0x0000000100001008 92CHECK-LTO-NEXT: Keeping variable DIE: 93CHECK-LTO-NEXT: DW_TAG_variable 94CHECK-LTO-NEXT: DW_AT_name {{.*}}"private_int" 95CHECK-LTO-NOT: Found valid debug map entry 96CHECK-LTO: Found valid debug map entry: _baz 0x0000000000000658 => 0x0000000100001000 97CHECK-LTO-NEXT: Keeping variable DIE: 98CHECK-LTO-NEXT: DW_TAG_variable 99CHECK-LTO-NEXT: DW_AT_name {{.*}} "baz" 100CHECK-LTO-NOT: Found valid debug map entry 101CHECK-LTO: Found valid debug map entry: _foo 0x0000000000000010 => 0x0000000100000f50 102CHECK-LTO-NEXT: Keeping subprogram DIE: 103CHECK-LTO-NEXT: DW_TAG_subprogram 104CHECK-LTO-NEXT: DW_AT_name {{.*}}"foo" 105CHECK-LTO-NOT: Found valid debug map entry 106CHECK-LTO: Found valid debug map entry: _val 0x00000000000008ec => 0x0000000100001004 107CHECK-LTO-NEXT: Keeping variable DIE: 108CHECK-LTO-NEXT: DW_TAG_variable 109CHECK-LTO-NEXT: DW_AT_name {{.*}}"val" 110CHECK-LTO-NOT: Found valid debug map entry 111CHECK-LTO: Found valid debug map entry: _bar 0x0000000000000050 => 0x0000000100000f90 112CHECK-LTO-NEXT: Keeping subprogram DIE: 113CHECK-LTO-NEXT: DW_TAG_subprogram 114CHECK-LTO-NEXT: DW_AT_name {{.*}}"bar" 115 116 117================================= Archive link ================================ 118CHECK-ARCHIVE: DEBUG MAP OBJECT: {{.*}}basic1.macho.x86_64.o 119CHECK-ARCHIVE: Input compilation unit: 120CHECK-ARCHIVE-NEXT: TAG_compile_unit 121CHECK-ARCHIVE-NOT: TAG 122CHECK-ARCHIVE: AT_name {{.*}}basic1.c 123 124CHECK-ARCHIVE: DEBUG MAP OBJECT: {{.*}}libbasic.a(basic2.macho.x86_64.o) 125CHECK-ARCHIVE: Input compilation unit: 126CHECK-ARCHIVE-NEXT: TAG_compile_unit 127CHECK-ARCHIVE-NOT: TAG 128CHECK-ARCHIVE: AT_name {{.*}}basic2.c 129 130CHECK-ARCHIVE: DEBUG MAP OBJECT: {{.*}}libbasic.a(basic3.macho.x86_64.o) 131CHECK-ARCHIVE: Input compilation unit: 132CHECK-ARCHIVE-NEXT: TAG_compile_unit 133CHECK-ARCHIVE-NOT: TAG 134CHECK-ARCHIVE: AT_name {{.*}}basic3.c 135 136CHECK-ARCHIVE-NOT: Found valid debug map entry 137CHECK-ARCHIVE: Found valid debug map entry: _main 0x0000000000000000 => 0x0000000100000ea0 138CHECK-ARCHIVE-NEXT: Keeping subprogram DIE: 139CHECK-ARCHIVE-NEXT: DW_TAG_subprogram 140CHECK-ARCHIVE-NEXT: DW_AT_name{{.*}}"main" 141 142CHECK-ARCHIVE-NOT: Found valid debug map entry 143CHECK-ARCHIVE: Found valid debug map entry: _private_int 0x0000000000000560 => 0x0000000100001004 144CHECK-ARCHIVE-NEXT: Keeping variable DIE: 145CHECK-ARCHIVE-NEXT: DW_TAG_variable 146CHECK-ARCHIVE-NEXT: DW_AT_name {{.*}}"private_int" 147CHECK-ARCHIVE-NOT: Found valid debug map entry 148CHECK-ARCHIVE: Found valid debug map entry: _baz 0x0000000000000310 => 0x0000000100001000 149CHECK-ARCHIVE-NEXT: Keeping variable DIE: 150CHECK-ARCHIVE-NEXT: DW_TAG_variable 151CHECK-ARCHIVE-NEXT: DW_AT_name {{.*}}"baz" 152CHECK-ARCHIVE-NOT: Found valid debug map entry 153CHECK-ARCHIVE: Found valid debug map entry: _foo 0x0000000000000020 => 0x0000000100000ed0 154CHECK-ARCHIVE-NEXT: Keeping subprogram DIE: 155CHECK-ARCHIVE-NEXT: DW_TAG_subprogram 156CHECK-ARCHIVE-NEXT: DW_AT_name {{.*}}"foo" 157CHECK-ARCHIVE-NOT: Found valid debug map entry 158CHECK-ARCHIVE: Found valid debug map entry: _inc 0x0000000000000070 => 0x0000000100000f20 159CHECK-ARCHIVE-NEXT: Keeping subprogram DIE: 160CHECK-ARCHIVE-NEXT: DW_TAG_subprogram 161CHECK-ARCHIVE-NEXT: DW_AT_name {{.*}}"inc" 162 163CHECK-ARCHIVE-NOT: Found valid debug map entry 164CHECK-ARCHIVE: Found valid debug map entry: _val 0xffffffffffffffff => 0x0000000100001008 165CHECK-ARCHIVE-NEXT: Keeping variable DIE: 166CHECK-ARCHIVE-NEXT: DW_TAG_variable 167CHECK-ARCHIVE-NEXT: DW_AT_name {{.*}}"val" 168CHECK-ARCHIVE-NOT: Found valid debug map entry 169CHECK-ARCHIVE: Found valid debug map entry: _bar 0x0000000000000020 => 0x0000000100000f40 170CHECK-ARCHIVE-NEXT: Keeping subprogram DIE: 171CHECK-ARCHIVE-NEXT: DW_TAG_subprogram 172CHECK-ARCHIVE-NEXT: DW_AT_name {{.*}}"bar" 173CHECK-ARCHIVE-NOT: Found valid debug map entry 174CHECK-ARCHIVE: Found valid debug map entry: _inc 0x0000000000000070 => 0x0000000100000f90 175CHECK-ARCHIVE-NEXT: Keeping subprogram DIE: 176CHECK-ARCHIVE-NEXT: DW_TAG_subprogram 177CHECK-ARCHIVE-NEXT: DW_AT_name {{.*}}"inc") 178