mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
e5c30b9eef
Pulling out the split-dwarf tests by way of example of how I think llvm-symbolizer should be tested going forward. Open to debate/discussion, though. llvm-svn: 352004
167 lines
5.8 KiB
Plaintext
167 lines
5.8 KiB
Plaintext
RUN: rm -rf %t
|
|
RUN: mkdir -p %t
|
|
RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x40113f" > %t.input
|
|
RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64.debuglink 0x40113f" >> %t.input
|
|
RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x401020" >> %t.input
|
|
RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x40110e" >> %t.input
|
|
RUN: echo "%p/Inputs/dwarfdump-test.elf-x86-64 0x401160" >> %t.input
|
|
RUN: echo "%p/Inputs/dwarfdump-test2.elf-x86-64 0x4004e8" >> %t.input
|
|
RUN: echo "%p/Inputs/dwarfdump-test2.elf-x86-64 0x4004f4" >> %t.input
|
|
RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" >> %t.input
|
|
RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x8dc" >> %t.input
|
|
RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0xa05" >> %t.input
|
|
RUN: echo "%p/Inputs/dwarfdump-inl-test.elf-x86-64 0x987" >> %t.input
|
|
RUN: echo "%p/Inputs/dwarfdump-inl-test.high_pc.elf-x86-64 0x568" >> %t.input
|
|
RUN: cp "%p/Inputs/dwarfdump-test3.elf-x86-64-space" "%t/dwarfdump-test3.elf-x86-64 space"
|
|
RUN: echo "\"%t/dwarfdump-test3.elf-x86-64 space\" 0x640" >> %t.input
|
|
RUN: echo "\"%t/dwarfdump-test3.elf-x86-64 space\" 0x633" >> %t.input
|
|
RUN: echo "\"%t/dwarfdump-test3.elf-x86-64 space\" 0x62d" >> %t.input
|
|
RUN: echo "%p/Inputs/macho-universal 0x1f84" >> %t.input
|
|
RUN: echo "%p/Inputs/macho-universal:i386 0x1f67" >> %t.input
|
|
RUN: echo "%p/Inputs/macho-universal:x86_64 0x100000f05" >> %t.input
|
|
RUN: echo "%p/Inputs/llvm-symbolizer-local-mem-func-gcc.elf-x86-64 0x61a" >> %t.input
|
|
RUN: echo "%p/Inputs/arange-overlap.elf-x86_64 0x714" >> %t.input
|
|
RUN: echo "%p/Inputs/cross-cu-inlining.x86_64-macho.o 0x17" >> %t.input
|
|
|
|
RUN: cd %t
|
|
RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
|
|
RUN: --default-arch=i386 < %t.input | FileCheck --check-prefix=CHECK --check-prefix=SPLIT --check-prefix=DWO %s
|
|
|
|
CHECK: main
|
|
CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
|
|
|
|
CHECK: main
|
|
CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
|
|
|
|
CHECK: _start
|
|
|
|
CHECK: _Z1fii
|
|
CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:11
|
|
|
|
CHECK: DummyClass
|
|
CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:4
|
|
|
|
CHECK: a
|
|
CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-helper.cc:2
|
|
|
|
CHECK: main
|
|
CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-main.cc:4
|
|
|
|
CHECK: _Z1cv
|
|
CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test4-part1.cc:2
|
|
|
|
CHECK: inlined_h
|
|
CHECK-NEXT: dwarfdump-inl-test.h:2
|
|
CHECK-NEXT: inlined_g
|
|
CHECK-NEXT: dwarfdump-inl-test.h:7
|
|
CHECK-NEXT: inlined_f
|
|
CHECK-NEXT: dwarfdump-inl-test.cc:3
|
|
CHECK-NEXT: main
|
|
CHECK-NEXT: dwarfdump-inl-test.cc:8
|
|
|
|
CHECK: inlined_g
|
|
CHECK-NEXT: dwarfdump-inl-test.h:7
|
|
CHECK-NEXT: inlined_f
|
|
CHECK-NEXT: dwarfdump-inl-test.cc:3
|
|
CHECK-NEXT: main
|
|
CHECK-NEXT: dwarfdump-inl-test.cc:8
|
|
|
|
CHECK: inlined_f
|
|
CHECK-NEXT: dwarfdump-inl-test.cc:3
|
|
CHECK-NEXT: main
|
|
CHECK-NEXT: dwarfdump-inl-test.cc:8
|
|
|
|
CHECK: inlined_h
|
|
CHECK-NEXT: dwarfdump-inl-test.h:3
|
|
CHECK-NEXT: inlined_g
|
|
CHECK-NEXT: dwarfdump-inl-test.h:7
|
|
CHECK-NEXT: inlined_f
|
|
CHECK-NEXT: dwarfdump-inl-test.cc:3
|
|
CHECK-NEXT: main
|
|
CHECK-NEXT: dwarfdump-inl-test.cc:8
|
|
|
|
CHECK: C
|
|
CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test3.cc:3
|
|
|
|
CHECK: _Z3do1v
|
|
CHECK-NEXT: /tmp/include{{[/\\]}}dwarfdump-test3-decl.h:7
|
|
|
|
CHECK: _Z3do2v
|
|
CHECK-NEXT: /tmp/dbginfo{{[/\\]}}include{{[/\\]}}dwarfdump-test3-decl2.h:1
|
|
|
|
CHECK: main
|
|
CHECK: _Z3inci
|
|
CHECK: _Z3inci
|
|
|
|
CHECK-NOT: local_mem_func
|
|
CHECK: _ZZ2f1vEN3foo14local_mem_funcEv
|
|
CHECK-NEXT: {{.*}}local-mem-func.cpp:3:0
|
|
|
|
CHECK: _ZN1S3bazEv
|
|
CHECK-NEXT: {{.*}}arange-overlap.cc:6
|
|
|
|
; func has been inlined into main by LTO. Check that the symbolizer is able
|
|
; to resolve the cross-cu reference and retrieve func's name
|
|
CHECK: func
|
|
CHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:16:3
|
|
CHECK-NEXT: main
|
|
CHECK-NEXT: /tmp{{[/\\]}}cross-cu-inlining.c:11:0
|
|
|
|
RUN: echo "unexisting-file 0x1234" > %t.input2
|
|
RUN: llvm-symbolizer < %t.input2 2>&1 | FileCheck %s --check-prefix=MISSING-FILE
|
|
|
|
MISSING-FILE: LLVMSymbolizer: error reading file: {{[Nn]}}o such file or directory
|
|
|
|
RUN: echo "%p/Inputs/macho-universal 0x1f84" > %t.input3
|
|
RUN: llvm-symbolizer < %t.input3 | FileCheck %s --check-prefix=UNKNOWN-ARCH
|
|
|
|
UNKNOWN-ARCH-NOT: main
|
|
UNKNOWN-ARCH: ??
|
|
UNKNOWN-ARCH-NOT: main
|
|
|
|
RUN: echo "0x40113f" > %t.input4
|
|
RUN: echo "0x401020" >> %t.input4
|
|
RUN: llvm-symbolizer --obj %p/Inputs/dwarfdump-test.elf-x86-64 < %t.input4 \
|
|
RUN: | FileCheck %s --check-prefix=BINARY
|
|
|
|
BINARY: main
|
|
BINARY-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
|
|
BINARY: _start
|
|
|
|
RUN: echo "0x401140" > %t.input5
|
|
RUN: echo "0x401020" >> %t.input5
|
|
RUN: echo "0x401120" >> %t.input5
|
|
RUN: llvm-symbolizer --obj %p/Inputs/llvm-symbolizer-test.elf-x86-64 < %t.input5 \
|
|
RUN: | FileCheck %s --check-prefix=BINARY_C
|
|
|
|
BINARY_C: main
|
|
BINARY_C-NEXT: /tmp/dbginfo{{[/\\]}}llvm-symbolizer-test.c:10
|
|
BINARY_C: _start
|
|
BINARY_C: {{g$}}
|
|
|
|
RUN: echo "0x1f1" > %t.input6
|
|
RUN: llvm-symbolizer --obj %p/Inputs/shared-object-stripped.elf-i386 < %t.input6 \
|
|
RUN: | FileCheck %s --check-prefix=STRIPPED
|
|
|
|
STRIPPED: global_func
|
|
|
|
; Check that the last of --demangle and --no-demangle wins.
|
|
RUN: echo "%p/Inputs/dwarfdump-test4.elf-x86-64 0x62c" > %t.input7
|
|
RUN: llvm-symbolizer --demangle < %t.input7 \
|
|
RUN: | FileCheck %s --check-prefix=DEMANGLED_FUNCTION_NAME
|
|
RUN: llvm-symbolizer -C < %t.input7 \
|
|
RUN: | FileCheck %s --check-prefix=DEMANGLED_FUNCTION_NAME
|
|
RUN: llvm-symbolizer --no-demangle < %t.input7 \
|
|
RUN: | FileCheck %s --check-prefix=MANGLED_FUNCTION_NAME
|
|
RUN: llvm-symbolizer --demangle --no-demangle < %t.input7 \
|
|
RUN: | FileCheck %s --check-prefix=MANGLED_FUNCTION_NAME
|
|
RUN: llvm-symbolizer -C --no-demangle < %t.input7 \
|
|
RUN: | FileCheck %s --check-prefix=MANGLED_FUNCTION_NAME
|
|
RUN: llvm-symbolizer --no-demangle --demangle < %t.input7 \
|
|
RUN: | FileCheck %s --check-prefix=DEMANGLED_FUNCTION_NAME
|
|
RUN: llvm-symbolizer --no-demangle -C < %t.input7 \
|
|
RUN: | FileCheck %s --check-prefix=DEMANGLED_FUNCTION_NAME
|
|
|
|
MANGLED_FUNCTION_NAME: _Z1cv
|
|
DEMANGLED_FUNCTION_NAME: c()
|