From 563a29d449def26b9e3bdf9fb1bf59d03b461a62 Mon Sep 17 00:00:00 2001 From: James Henderson Date: Fri, 1 Feb 2019 10:24:55 +0000 Subject: [PATCH] [llvm-symbolizer][test] Rename and tweak tests using llvm-symbolizer Prior to this change, there are a few tests called llvm-symbolizer* in the DebugInfo test area. These really were testing either the DebugInfo or Symbolizer library, rather than the llvm-symbolizer tool itself, so this patch renames them to be clearer that they aren't explicitly tests for llvm-symbolizer (such tests belong in test/tools/llvm-symbolizer). This patch also reinstates the copying of a DWO file, removed previously in r352752. The test needs this so that it could possibly fail. Finally, some of the tests have been simplified slightly by removing unnecessary switches and/or unused check-prefixes. Reviewed by: dblaikie Differential Revision: https://reviews.llvm.org/D57518 llvm-svn: 352847 --- .../llvm-symbolizer-split-dwarf-empty.test | 10 ---------- .../test/DebugInfo/symbolize-split-dwarf-empty.test | 9 +++++++++ ...t => symbolize-split-dwarf-no-skel-address.test} | 9 +++++++-- .../{llvm-symbolizer-tu.test => symbolize-tu.test} | 0 ...lvm-symbolizer-zlib.test => symbolize-zlib.test} | 0 .../{llvm-symbolizer.test => symbolize.test} | 13 ++++++------- 6 files changed, 22 insertions(+), 19 deletions(-) delete mode 100644 llvm/test/DebugInfo/llvm-symbolizer-split-dwarf-empty.test create mode 100644 llvm/test/DebugInfo/symbolize-split-dwarf-empty.test rename llvm/test/DebugInfo/{llvm-symbolizer-split-dwarf-no-skel-address.test => symbolize-split-dwarf-no-skel-address.test} (62%) rename llvm/test/DebugInfo/{llvm-symbolizer-tu.test => symbolize-tu.test} (100%) rename llvm/test/DebugInfo/{llvm-symbolizer-zlib.test => symbolize-zlib.test} (100%) rename llvm/test/DebugInfo/{llvm-symbolizer.test => symbolize.test} (78%) diff --git a/llvm/test/DebugInfo/llvm-symbolizer-split-dwarf-empty.test b/llvm/test/DebugInfo/llvm-symbolizer-split-dwarf-empty.test deleted file mode 100644 index 994a58e73c08..000000000000 --- a/llvm/test/DebugInfo/llvm-symbolizer-split-dwarf-empty.test +++ /dev/null @@ -1,10 +0,0 @@ -RUN: rm -rf %t && mkdir -p %t -RUN: cd %t -RUN: cp %p/Inputs/split-dwarf-empty.dwo %t -RUN: echo "%p/Inputs/split-dwarf-empty.o 0xdeadbeef" > %t.input - -RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \ -RUN: --default-arch=i386 < %t.input | FileCheck %s - -CHECK: ?? -CHECK: ??:0:0 diff --git a/llvm/test/DebugInfo/symbolize-split-dwarf-empty.test b/llvm/test/DebugInfo/symbolize-split-dwarf-empty.test new file mode 100644 index 000000000000..090baf24e0e0 --- /dev/null +++ b/llvm/test/DebugInfo/symbolize-split-dwarf-empty.test @@ -0,0 +1,9 @@ +cd and copy the DWO into the same directory so that it can be found by the +symbolizer. +RUN: rm -rf %t && mkdir -p %t +RUN: cd %t +RUN: cp %p/Inputs/split-dwarf-empty.dwo %t +RUN: llvm-symbolizer --inlining --obj=%p/Inputs/split-dwarf-empty.o 0xdeadbeef | FileCheck %s + +CHECK: ?? +CHECK: ??:0:0 diff --git a/llvm/test/DebugInfo/llvm-symbolizer-split-dwarf-no-skel-address.test b/llvm/test/DebugInfo/symbolize-split-dwarf-no-skel-address.test similarity index 62% rename from llvm/test/DebugInfo/llvm-symbolizer-split-dwarf-no-skel-address.test rename to llvm/test/DebugInfo/symbolize-split-dwarf-no-skel-address.test index 13965e07f092..6c3f5ed35fd1 100644 --- a/llvm/test/DebugInfo/llvm-symbolizer-split-dwarf-no-skel-address.test +++ b/llvm/test/DebugInfo/symbolize-split-dwarf-no-skel-address.test @@ -1,5 +1,10 @@ -RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \ -RUN: --default-arch=i386 --obj=%p/Inputs/split-dwarf-no-skel-address.o 0x4 | FileCheck %s +Copy the DWO and then cd into the output directory, so that the symbolizer would +find the DWO if it attempted to. +RUN: rm -rf %t && mkdir -p %t +RUN: cd %t +RUN: cp %p/Inputs/split-dwarf-no-skel-address.dwo %t +RUN: llvm-symbolizer --inlining --no-demangle \ +RUN: --obj=%p/Inputs/split-dwarf-no-skel-address.o 0x4 | FileCheck %s Built from the following source: void f1(); diff --git a/llvm/test/DebugInfo/llvm-symbolizer-tu.test b/llvm/test/DebugInfo/symbolize-tu.test similarity index 100% rename from llvm/test/DebugInfo/llvm-symbolizer-tu.test rename to llvm/test/DebugInfo/symbolize-tu.test diff --git a/llvm/test/DebugInfo/llvm-symbolizer-zlib.test b/llvm/test/DebugInfo/symbolize-zlib.test similarity index 100% rename from llvm/test/DebugInfo/llvm-symbolizer-zlib.test rename to llvm/test/DebugInfo/symbolize-zlib.test diff --git a/llvm/test/DebugInfo/llvm-symbolizer.test b/llvm/test/DebugInfo/symbolize.test similarity index 78% rename from llvm/test/DebugInfo/llvm-symbolizer.test rename to llvm/test/DebugInfo/symbolize.test index 7b0bd1426104..8b43a11cd0ce 100644 --- a/llvm/test/DebugInfo/llvm-symbolizer.test +++ b/llvm/test/DebugInfo/symbolize.test @@ -6,25 +6,24 @@ 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: llvm-symbolizer --functions=linkage --inlining --demangle=false \ -RUN: < %t.input | FileCheck --check-prefix=CHECK --check-prefix=SPLIT --check-prefix=DWO %s +RUN: llvm-symbolizer < %t.input | FileCheck %s CHECK: main CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16 CHECK: _start -CHECK: _Z1fii +CHECK: f(int, int) CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:11 -CHECK: DummyClass +CHECK: DummyClass CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:4 -CHECK: a +CHECK: a CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-helper.cc:2 -CHECK: main +CHECK: main CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-main.cc:4 -CHECK: _Z1cv +CHECK: c() CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test4-part1.cc:2