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