1 RUN: llvm-dsymutil -v -parse-only -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 | FileCheck %s
2 RUN: llvm-dsymutil -v -parse-only -oso-prepend-path=%p %p/Inputs/basic-lto.macho.x86_64 | FileCheck %s --check-prefix=CHECK-LTO
3 RUN: llvm-dsymutil -v -parse-only -oso-prepend-path=%p %p/Inputs/basic-archive.macho.x86_64 | FileCheck %s --check-prefix=CHECK-ARCHIVE
4 RUN: llvm-dsymutil -v -parse-only %p/Inputs/basic.macho.x86_64 2>&1 | FileCheck %s --check-prefix=NOT-FOUND
5 RUN: not llvm-dsymutil -v -parse-only %p/Inputs/inexistant 2>&1 | FileCheck %s --check-prefix=NO-EXECUTABLE
8 Check that We can parse the debug map of the basic executable.
11 CHECK: DEBUG MAP: x86_64-unknown-unknown-macho
12 CHECK: /Inputs/basic1.macho.x86_64.o:
13 CHECK: 0000000000000000 => 0000000100000ea0+0x24 _main
14 CHECK: /Inputs/basic2.macho.x86_64.o:
15 CHECK: 0000000000000310 => 0000000100001000+0x0 _baz
16 CHECK: 0000000000000020 => 0000000100000ed0+0x50 _foo
17 CHECK: 0000000000000070 => 0000000100000f20+0x17 _inc
18 CHECK: 0000000000000560 => 0000000100001008+0x0 _private_int
19 CHECK: /Inputs/basic3.macho.x86_64.o:
20 CHECK: 0000000000000020 => 0000000100000f40+0x50 _bar
21 CHECK: 0000000000000070 => 0000000100000f90+0x19 _inc
22 CHECK: 0000000000000004 => 0000000100001004+0x0 _val
26 Check that we can parse the debug-map of the basic-lto executable
29 CHECK-LTO: DEBUG MAP: x86_64-unknown-unknown-macho
30 CHECK-LTO: /Inputs/basic-lto.macho.x86_64.o:
31 CHECK-LTO: 0000000000000050 => 0000000100000f90+0x24 _bar
32 CHECK-LTO: 0000000000000658 => 0000000100001000+0x0 _baz
33 CHECK-LTO: 0000000000000010 => 0000000100000f50+0x40 _foo
34 CHECK-LTO: 0000000000000000 => 0000000100000f40+0x10 _main
35 CHECK-LTO: 00000000000008e8 => 0000000100001008+0x0 _private_int
36 CHECK-LTO: 00000000000008ec => 0000000100001004+0x0 _val
37 CHECK-LTO: END DEBUG MAP
39 Check thet we correctly handle debug maps with archive members (including only
40 opening the archive once if mulitple of its members are used).
42 CHECK-ARCHIVE: trying to open {{.*}}basic-archive.macho.x86_64'
43 CHECK-ARCHIVE-NEXT: loaded file.
44 CHECK-ARCHIVE-NEXT: trying to open {{.*}}/Inputs/basic1.macho.x86_64.o'
45 CHECK-ARCHIVE-NEXT: loaded file.
46 CHECK-ARCHIVE-NEXT: trying to open {{.*}}/libbasic.a(basic2.macho.x86_64.o)'
47 CHECK-ARCHIVE-NEXT: opened new archive {{.*}}/libbasic.a'
48 CHECK-ARCHIVE-NEXT: found member in current archive.
49 CHECK-ARCHIVE-NEXT: trying to open {{.*}}/libbasic.a(basic3.macho.x86_64.o)'
50 CHECK-ARCHIVE-NEXT: found member in current archive.
51 CHECK-ARCHIVE: DEBUG MAP: x86_64-unknown-unknown-macho
52 CHECK-ARCHIVE: object addr => executable addr symbol name
53 CHECK-ARCHIVE: /Inputs/basic1.macho.x86_64.o:
54 CHECK-ARCHIVE: 0000000000000000 => 0000000100000ea0+0x24 _main
55 CHECK-ARCHIVE: /Inputs/./libbasic.a(basic2.macho.x86_64.o):
56 CHECK-ARCHIVE: 0000000000000310 => 0000000100001000+0x0 _baz
57 CHECK-ARCHIVE: 0000000000000020 => 0000000100000ed0+0x50 _foo
58 CHECK-ARCHIVE: 0000000000000070 => 0000000100000f20+0x17 _inc
59 CHECK-ARCHIVE: 0000000000000560 => 0000000100001004+0x0 _private_int
60 CHECK-ARCHIVE: /Inputs/./libbasic.a(basic3.macho.x86_64.o):
61 CHECK-ARCHIVE: 0000000000000020 => 0000000100000f40+0x50 _bar
62 CHECK-ARCHIVE: 0000000000000070 => 0000000100000f90+0x19 _inc
63 CHECK-ARCHIVE: 0000000000000004 => 0000000100001008+0x0 _val
64 CHECK-ARCHIVE: END DEBUG MAP
66 Check that we warn about missing object files (this presumes that the files aren't
67 present in the machine's /Inputs/ folder, which should be a pretty safe bet).
69 NOT-FOUND: cannot open{{.*}}"/Inputs/basic1.macho.x86_64.o": {{[Nn]o}} such file
70 NOT-FOUND: cannot open{{.*}}"/Inputs/basic2.macho.x86_64.o": {{[Nn]o}} such file
71 NOT-FOUND: cannot open{{.*}}"/Inputs/basic3.macho.x86_64.o": {{[Nn]o}} such file
73 NOT-FOUND-NEXT: object addr => executable addr symbol name
74 NOT-FOUND-NEXT: END DEBUG MAP
76 Check that we correctly error out on invalid executatble.
78 NO-EXECUTABLE: cannot parse{{.*}}/inexistant": {{[Nn]o}} such file
79 NO-EXECUTABLE-NOT: DEBUG MAP