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