xref: /aosp_15_r20/external/llvm/test/tools/dsymutil/debug-map-parsing.test (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard WorkerRUN: llvm-dsymutil -dump-debug-map -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 | FileCheck %s
2*9880d681SAndroid Build Coastguard WorkerRUN: llvm-dsymutil -dump-debug-map -oso-prepend-path=%p %p/Inputs/basic-lto.macho.x86_64 | FileCheck %s --check-prefix=CHECK-LTO
3*9880d681SAndroid Build Coastguard WorkerRUN: llvm-dsymutil -verbose -dump-debug-map -oso-prepend-path=%p %p/Inputs/basic-archive.macho.x86_64 | FileCheck %s --check-prefix=CHECK-ARCHIVE
4*9880d681SAndroid Build Coastguard WorkerRUN: llvm-dsymutil -dump-debug-map %p/Inputs/basic.macho.x86_64 2>&1 | FileCheck %s --check-prefix=NOT-FOUND
5*9880d681SAndroid Build Coastguard WorkerRUN: not llvm-dsymutil -dump-debug-map %p/Inputs/inexistant 2>&1 | FileCheck %s --check-prefix=NO-EXECUTABLE
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard WorkerCheck that We can parse the debug map of the basic executable.
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard WorkerCHECK-NOT: error
11*9880d681SAndroid Build Coastguard WorkerCHECK: ---
12*9880d681SAndroid Build Coastguard WorkerCHECK: triple: 'x86_64-apple-darwin'
13*9880d681SAndroid Build Coastguard WorkerCHECK: binary-path:{{.*}}/Inputs/basic.macho.x86_64
14*9880d681SAndroid Build Coastguard WorkerCHECK: filename:{{.*}}/Inputs/basic1.macho.x86_64.o
15*9880d681SAndroid Build Coastguard WorkerCHECK-DAG: sym: _main, objAddr: 0x0000000000000000, binAddr: 0x0000000100000EA0, size: 0x00000024
16*9880d681SAndroid Build Coastguard WorkerCHECK: filename{{.*}}/Inputs/basic2.macho.x86_64.o
17*9880d681SAndroid Build Coastguard WorkerCHECK-DAG: 	sym: _baz, objAddr: 0x0000000000000310, binAddr: 0x0000000100001000, size: 0x00000000
18*9880d681SAndroid Build Coastguard WorkerCHECK-DAG: 	sym: _foo, objAddr: 0x0000000000000020, binAddr: 0x0000000100000ED0, size: 0x00000050
19*9880d681SAndroid Build Coastguard WorkerCHECK-DAG: 	sym: _inc, objAddr: 0x0000000000000070, binAddr: 0x0000000100000F20, size: 0x00000017
20*9880d681SAndroid Build Coastguard WorkerCHECK-DAG: 	sym: _private_int, objAddr: 0x0000000000000560, binAddr: 0x0000000100001008, size: 0x00000000
21*9880d681SAndroid Build Coastguard WorkerCHECK: filename{{.*}}/Inputs/basic3.macho.x86_64.o
22*9880d681SAndroid Build Coastguard WorkerCHECK-DAG: 	sym: _bar, objAddr: 0x0000000000000020, binAddr: 0x0000000100000F40, size: 0x00000050
23*9880d681SAndroid Build Coastguard WorkerCHECK-DAG: 	sym: _inc, objAddr: 0x0000000000000070, binAddr: 0x0000000100000F90, size: 0x00000019
24*9880d681SAndroid Build Coastguard WorkerCHECK-DAG: 	sym: _val, binAddr: 0x0000000100001004, size: 0x00000000
25*9880d681SAndroid Build Coastguard WorkerCHECK: ...
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard WorkerCheck that we can parse the debug-map of the basic-lto executable
29*9880d681SAndroid Build Coastguard Worker
30*9880d681SAndroid Build Coastguard WorkerCHECK-LTO-NOT: error
31*9880d681SAndroid Build Coastguard WorkerCHECK-LTO: ---
32*9880d681SAndroid Build Coastguard WorkerCHECK-LTO: triple: 'x86_64-apple-darwin'
33*9880d681SAndroid Build Coastguard WorkerCHECK-LTO: binary-path:{{.*}}/Inputs/basic-lto.macho.x86_64
34*9880d681SAndroid Build Coastguard WorkerCHECK-LTO: /Inputs/basic-lto.macho.x86_64.o
35*9880d681SAndroid Build Coastguard WorkerCHECK-LTO-DAG: 	sym: _bar, objAddr: 0x0000000000000050, binAddr: 0x0000000100000F90, size: 0x00000024
36*9880d681SAndroid Build Coastguard WorkerCHECK-LTO-DAG: 	sym: _baz, objAddr: 0x0000000000000658, binAddr: 0x0000000100001000, size: 0x00000000
37*9880d681SAndroid Build Coastguard WorkerCHECK-LTO-DAG: 	sym: _foo, objAddr: 0x0000000000000010, binAddr: 0x0000000100000F50, size: 0x00000040
38*9880d681SAndroid Build Coastguard WorkerCHECK-LTO-DAG: 	sym: _main, objAddr: 0x0000000000000000, binAddr: 0x0000000100000F40, size: 0x00000010
39*9880d681SAndroid Build Coastguard WorkerCHECK-LTO-DAG: 	sym: _private_int, objAddr: 0x00000000000008E8, binAddr: 0x0000000100001008, size: 0x00000000
40*9880d681SAndroid Build Coastguard WorkerCHECK-LTO-DAG: 	sym: _val, objAddr: 0x00000000000008EC, binAddr: 0x0000000100001004, size: 0x00000000
41*9880d681SAndroid Build Coastguard WorkerCHECK-LTO: ...
42*9880d681SAndroid Build Coastguard Worker
43*9880d681SAndroid Build Coastguard WorkerCheck thet we correctly handle debug maps with archive members (including only
44*9880d681SAndroid Build Coastguard Workeropening the archive once if mulitple of its members are used).
45*9880d681SAndroid Build Coastguard Worker
46*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE:      trying to open {{.*}}basic-archive.macho.x86_64'
47*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE-NEXT: 	loaded file.
48*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE-NEXT: trying to open {{.*}}/Inputs/basic1.macho.x86_64.o'
49*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE-NEXT: 	loaded file.
50*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE-NEXT: trying to open {{.*}}/libbasic.a(basic2.macho.x86_64.o)'
51*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE-NEXT: 	opened new archive {{.*}}/libbasic.a'
52*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE-NEXT: 	found member in current archive.
53*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE-NEXT: trying to open {{.*}}/libbasic.a(basic3.macho.x86_64.o)'
54*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE-NEXT: 	found member in current archive.
55*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE: ---
56*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE: triple: 'x86_64-apple-darwin'
57*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE: binary-path:{{.*}}/Inputs/basic-archive.macho.x86_64
58*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE: /Inputs/basic1.macho.x86_64.o
59*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE-DAG: 	sym: _main, objAddr: 0x0000000000000000, binAddr: 0x0000000100000EA0, size: 0x00000024
60*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE: /Inputs/./libbasic.a(basic2.macho.x86_64.o)
61*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE-DAG: 	sym: _baz, objAddr: 0x0000000000000310, binAddr: 0x0000000100001000, size: 0x00000000
62*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE-DAG: 	sym: _foo, objAddr: 0x0000000000000020, binAddr: 0x0000000100000ED0, size: 0x00000050
63*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE-DAG: 	sym: _inc, objAddr: 0x0000000000000070, binAddr: 0x0000000100000F20, size: 0x00000017
64*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE-DAG: 	sym: _private_int, objAddr: 0x0000000000000560, binAddr: 0x0000000100001004, size: 0x00000000
65*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE: /Inputs/./libbasic.a(basic3.macho.x86_64.o)
66*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE-DAG: 	sym: _bar, objAddr: 0x0000000000000020, binAddr: 0x0000000100000F40, size: 0x00000050
67*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE-DAG: 	sym: _inc, objAddr: 0x0000000000000070, binAddr: 0x0000000100000F90, size: 0x00000019
68*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE-DAG: 	sym: _val, binAddr: 0x0000000100001008, size: 0x00000000
69*9880d681SAndroid Build Coastguard WorkerCHECK-ARCHIVE: ...
70*9880d681SAndroid Build Coastguard Worker
71*9880d681SAndroid Build Coastguard WorkerCheck that we warn about missing object files (this presumes that the files aren't
72*9880d681SAndroid Build Coastguard Workerpresent in the machine's /Inputs/ folder, which should be a pretty safe bet).
73*9880d681SAndroid Build Coastguard Worker
74*9880d681SAndroid Build Coastguard WorkerNOT-FOUND: cannot open{{.*}}"/Inputs/basic1.macho.x86_64.o": {{[Nn]o}} such file
75*9880d681SAndroid Build Coastguard WorkerNOT-FOUND: cannot open{{.*}}"/Inputs/basic2.macho.x86_64.o": {{[Nn]o}} such file
76*9880d681SAndroid Build Coastguard WorkerNOT-FOUND: cannot open{{.*}}"/Inputs/basic3.macho.x86_64.o": {{[Nn]o}} such file
77*9880d681SAndroid Build Coastguard WorkerNOT-FOUND: ---
78*9880d681SAndroid Build Coastguard WorkerNOT-FOUND-NEXT: triple: 'x86_64-apple-darwin'
79*9880d681SAndroid Build Coastguard WorkerNOT-FOUND-NEXT: binary-path:{{.*}}/Inputs/basic.macho.x86_64
80*9880d681SAndroid Build Coastguard WorkerNOT-FOUND-NEXT: ...
81*9880d681SAndroid Build Coastguard Worker
82*9880d681SAndroid Build Coastguard WorkerCheck that we correctly error out on invalid executatble.
83*9880d681SAndroid Build Coastguard Worker
84*9880d681SAndroid Build Coastguard WorkerNO-EXECUTABLE: cannot parse{{.*}}/inexistant": {{[Nn]o}} such file
85*9880d681SAndroid Build Coastguard WorkerNO-EXECUTABLE-NOT: ---
86