Home | History | Annotate | Download | only in DebugInfo
      1 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400559" > %t.input
      2 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64.debuglink 0x400559" >> %t.input
      3 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400436" >> %t.input
      4 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400528" >> %t.input
      5 RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x400586" >> %t.input
      6 RUN: echo "%p/Inputs/dwarfdump-test2.elf-x86-64 0x4004e8" >> %t.input
      7 RUN: echo "%p/Inputs/dwarfdump-test2.elf-x86-64 0x4004f4" >> %t.input
      8 RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" >> %t.input
      9 RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x8dc" >> %t.input
     10 RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0xa05" >> %t.input
     11 RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x987" >> %t.input
     12 RUN: echo "%p/Inputs/dwarfdump-inl-test.high_pc.elf-x86-64 0x568" >> %t.input
     13 RUN: echo "\"%p/Inputs/dwarfdump-test3.elf-x86-64 space\" 0x640" >> %t.input
     14 RUN: echo "\"%p/Inputs/dwarfdump-test3.elf-x86-64 space\" 0x633" >> %t.input
     15 RUN: echo "\"%p/Inputs/dwarfdump-test3.elf-x86-64 space\" 0x62d" >> %t.input
     16 RUN: echo "%p/Inputs/macho-universal 0x1f84" >> %t.input
     17 RUN: echo "%p/Inputs/macho-universal:i386 0x1f67" >> %t.input
     18 RUN: echo "%p/Inputs/macho-universal:x86_64 0x100000f05" >> %t.input
     19 RUN: echo "%p/Inputs/llvm-symbolizer-dwo-test 0x400514" >> %t.input
     20 RUN: echo "%p/Inputs/fission-ranges.elf-x86_64 0x720" >> %t.input
     21 RUN: echo "%p/Inputs/arange-overlap.elf-x86_64 0x714" >> %t.input
     22 RUN: cp %p/Inputs/split-dwarf-test.dwo %T
     23 RUN: echo "%p/Inputs/split-dwarf-test 0x4005d4" >> %t.input
     24 RUN: echo "%p/Inputs/split-dwarf-test 0x4005c4" >> %t.input
     25 RUN: echo "%p/Inputs/cross-cu-inlining.x86_64-macho.o 0x17" >> %t.input
     26 
     27 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
     28 RUN:    --default-arch=i386 < %t.input | FileCheck --check-prefix=CHECK --check-prefix=SPLIT --check-prefix=DWO %s
     29 
     30 Ensure we get the same results in the absence of gmlt-like data in the executable but the presence of a .dwo file
     31 
     32 RUN: echo "%p/Inputs/split-dwarf-test-nogmlt 0x4005d4" >> %t.input
     33 RUN: echo "%p/Inputs/split-dwarf-test-nogmlt 0x4005c4" >> %t.input
     34 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
     35 RUN:    --default-arch=i386 < %t.input | FileCheck --check-prefix=SPLIT --check-prefix=DWO %s
     36 
     37 Ensure we get gmlt like results in the absence of a .dwo file but the presence of gmlt-like data in the executable
     38 
     39 RUN: rm %T/split-dwarf-test.dwo
     40 RUN: echo "%p/Inputs/split-dwarf-test 0x4005d4" >> %t.input
     41 RUN: echo "%p/Inputs/split-dwarf-test 0x4005c4" >> %t.input
     42 RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
     43 RUN:    --default-arch=i386 < %t.input | FileCheck --check-prefix=SPLIT --check-prefix=NODWO %s
     44 
     45 CHECK:       main
     46 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
     47 
     48 CHECK:       main
     49 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
     50 
     51 CHECK:      _start
     52 
     53 CHECK: _Z1fii
     54 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:11
     55 
     56 CHECK: DummyClass
     57 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:4
     58 
     59 CHECK: a
     60 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-helper.cc:2
     61 
     62 CHECK: main
     63 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-main.cc:4
     64 
     65 CHECK:      _Z1cv
     66 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test4-part1.cc:2
     67 
     68 CHECK:      inlined_h
     69 CHECK-NEXT: dwarfdump-inl-test.h:2
     70 CHECK-NEXT: inlined_g
     71 CHECK-NEXT: dwarfdump-inl-test.h:7
     72 CHECK-NEXT: inlined_f
     73 CHECK-NEXT: dwarfdump-inl-test.cc:3
     74 CHECK-NEXT: main
     75 CHECK-NEXT: dwarfdump-inl-test.cc:8
     76 
     77 CHECK:      inlined_g
     78 CHECK-NEXT: dwarfdump-inl-test.h:7
     79 CHECK-NEXT: inlined_f
     80 CHECK-NEXT: dwarfdump-inl-test.cc:3
     81 CHECK-NEXT: main
     82 CHECK-NEXT: dwarfdump-inl-test.cc:8
     83 
     84 CHECK:      inlined_f
     85 CHECK-NEXT: dwarfdump-inl-test.cc:3
     86 CHECK-NEXT: main
     87 CHECK-NEXT: dwarfdump-inl-test.cc:8
     88 
     89 CHECK:      inlined_h
     90 CHECK-NEXT: dwarfdump-inl-test.h:3
     91 CHECK-NEXT: inlined_g
     92 CHECK-NEXT: dwarfdump-inl-test.h:7
     93 CHECK-NEXT: inlined_f
     94 CHECK-NEXT: dwarfdump-inl-test.cc:3
     95 CHECK-NEXT: main
     96 CHECK-NEXT: dwarfdump-inl-test.cc:8
     97 
     98 CHECK: C
     99 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test3.cc:3
    100 
    101 CHECK: _Z3do1v
    102 CHECK-NEXT: /tmp/include{{[/\\]}}dwarfdump-test3-decl.h:7
    103 
    104 CHECK: _Z3do2v
    105 CHECK-NEXT: /tmp/dbginfo{{[/\\]}}include{{[/\\]}}dwarfdump-test3-decl2.h:1
    106 
    107 CHECK:      main
    108 CHECK:      _Z3inci
    109 CHECK:      _Z3inci
    110 
    111 CHECK: main
    112 CHECK-NEXT: llvm-symbolizer-dwo-test.cc:11
    113 
    114 CHECK: main
    115 CHECK-NEXT: {{.*}}fission-ranges.cc:6
    116 
    117 CHECK: _ZN1S3bazEv
    118 CHECK-NEXT: {{.*}}arange-overlap.cc:6
    119 
    120 DWO: _Z2f2v
    121 NODWO: {{^f2$}}
    122 SPLIT-NEXT: {{.*}}split-dwarf-test.cc
    123 SPLIT-NEXT: main
    124 SPLIT-NEXT: {{.*}}split-dwarf-test.cc
    125 
    126 SPLIT: _Z2f1v
    127 SPLIT-NEXT: {{.*}}split-dwarf-test.cc
    128 
    129 ; func has been inlined into main by LTO. Check that the symbolizer is able
    130 ; to resolve the cross-cu reference and retrieve func's name
    131 CHECK: func
    132 CHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:16:3
    133 CHECK-NEXT: main
    134 CHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:11:0
    135 
    136 RUN: echo "unexisting-file 0x1234" > %t.input2
    137 RUN: llvm-symbolizer < %t.input2 2>&1 | FileCheck %s --check-prefix=MISSING-FILE
    138 
    139 MISSING-FILE: LLVMSymbolizer: error reading file: {{[Nn]}}o such file or directory
    140 
    141 RUN: echo "%p/Inputs/macho-universal 0x1f84" > %t.input3
    142 RUN: llvm-symbolizer < %t.input3 | FileCheck %s --check-prefix=UNKNOWN-ARCH
    143 
    144 UNKNOWN-ARCH-NOT: main
    145 UNKNOWN-ARCH: ??
    146 UNKNOWN-ARCH-NOT: main
    147 
    148 RUN: echo "0x400559" > %t.input4
    149 RUN: echo "0x400436" >> %t.input4
    150 RUN: llvm-symbolizer --obj %p/Inputs/dwarfdump-test.elf-x86-64 < %t.input4 \
    151 RUN:   | FileCheck %s --check-prefix=BINARY
    152 
    153 BINARY:       main
    154 BINARY-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
    155 BINARY:      _start
    156 
    157 RUN: echo "0x400720" > %t.input5
    158 RUN: echo "0x4004a0" >> %t.input5
    159 RUN: echo "0x4006f0" >> %t.input5
    160 RUN: llvm-symbolizer --obj %p/Inputs/llvm-symbolizer-test.elf-x86-64 < %t.input5 \
    161 RUN:   | FileCheck %s --check-prefix=BINARY_C
    162 
    163 BINARY_C:       main
    164 BINARY_C-NEXT: /tmp/dbginfo{{[/\\]}}llvm-symbolizer-test.c:10
    165 BINARY_C:      _start
    166 BINARY_C:      {{g$}}
    167 
    168 RUN: echo "0x1f1" > %t.input6
    169 RUN: llvm-symbolizer --obj %p/Inputs/shared-object-stripped.elf-i386 < %t.input6 \
    170 RUN:   | FileCheck %s --check-prefix=STRIPPED
    171 
    172 STRIPPED:  global_func
    173 
    174 RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" > %t.input7
    175 RUN: llvm-symbolizer --functions=short --demangle=false < %t.input7 \
    176 RUN:    | FileCheck %s --check-prefix=SHORT_FUNCTION_NAME
    177 
    178 SHORT_FUNCTION_NAME-NOT: _Z1cv
    179