diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-04-23 10:17:34 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-04-23 10:17:34 +0000 |
commit | 068fc8ae6ef710400b1baf9440ceb3e5ba0f3d08 (patch) | |
tree | ea2f6cfced2e618be083f6df327495e4b7d2401f /llvm/test | |
parent | 63761d4bc455eec16b42e76b9e7f84973a41f4a0 (diff) | |
download | bcm5719-llvm-068fc8ae6ef710400b1baf9440ceb3e5ba0f3d08.tar.gz bcm5719-llvm-068fc8ae6ef710400b1baf9440ceb3e5ba0f3d08.zip |
Use zlib to uncompress debug sections in DWARF parser.
This makes llvm-dwarfdump and llvm-symbolizer understand
debug info sections compressed by ld.gold linker.
llvm-svn: 180088
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/DebugInfo/Inputs/dwarfdump-test-zlib.cc | 24 | ||||
-rwxr-xr-x | llvm/test/DebugInfo/Inputs/dwarfdump-test-zlib.elf-x86-64 | bin | 0 -> 9589 bytes | |||
-rw-r--r-- | llvm/test/DebugInfo/dwarfdump-zlib.test | 12 | ||||
-rw-r--r-- | llvm/test/Makefile | 1 | ||||
-rw-r--r-- | llvm/test/lit.cfg | 3 | ||||
-rw-r--r-- | llvm/test/lit.site.cfg.in | 1 |
6 files changed, 41 insertions, 0 deletions
diff --git a/llvm/test/DebugInfo/Inputs/dwarfdump-test-zlib.cc b/llvm/test/DebugInfo/Inputs/dwarfdump-test-zlib.cc new file mode 100644 index 00000000000..260c3c435c1 --- /dev/null +++ b/llvm/test/DebugInfo/Inputs/dwarfdump-test-zlib.cc @@ -0,0 +1,24 @@ +class DummyClass { + int a_; + public: + DummyClass(int a) : a_(a) {} + int add(int b) { + return a_ + b; + } +}; + +int f(int a, int b) { + DummyClass c(a); + return c.add(b); +} + +int main() { + return f(2, 3); +} + +// Built with Clang 3.2 and ld.gold linker: +// $ mkdir -p /tmp/dbginfo +// $ cp dwarfdump-test-zlib.cc /tmp/dbginfo +// $ cd /tmp/dbginfo +// $ clang++ -g dwarfdump-test-zlib.cc -Wl,--compress-debug-sections=zlib \ +// -o <output> diff --git a/llvm/test/DebugInfo/Inputs/dwarfdump-test-zlib.elf-x86-64 b/llvm/test/DebugInfo/Inputs/dwarfdump-test-zlib.elf-x86-64 Binary files differnew file mode 100755 index 00000000000..16b3153939f --- /dev/null +++ b/llvm/test/DebugInfo/Inputs/dwarfdump-test-zlib.elf-x86-64 diff --git a/llvm/test/DebugInfo/dwarfdump-zlib.test b/llvm/test/DebugInfo/dwarfdump-zlib.test new file mode 100644 index 00000000000..8ce2cf7690d --- /dev/null +++ b/llvm/test/DebugInfo/dwarfdump-zlib.test @@ -0,0 +1,12 @@ +REQUIRES: zlib + +RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test-zlib.elf-x86-64 \ +RUN: | FileCheck %s -check-prefix FULLDUMP +RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test-zlib.elf-x86-64 \ +RUN: --address=0x400559 --functions | FileCheck %s -check-prefix MAIN + +FULLDUMP: .debug_abbrev contents +FULLDUMP: .debug_info contents + +MAIN: main +MAIN-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test-zlib.cc:16 diff --git a/llvm/test/Makefile b/llvm/test/Makefile index 8d05c57f862..2213319df81 100644 --- a/llvm/test/Makefile +++ b/llvm/test/Makefile @@ -141,6 +141,7 @@ lit.site.cfg: FORCE @$(ECHOPATH) s=@LLVM_BINDINGS@=$(BINDINGS_TO_BUILD)=g >> lit.tmp @$(ECHOPATH) s=@HOST_OS@=$(HOST_OS)=g >> lit.tmp @$(ECHOPATH) s=@HOST_ARCH@=$(HOST_ARCH)=g >> lit.tmp + @$(ECHOPATH) s=@HAVE_LIBZ@=$(HAVE_LIBZ)=g >> lit.tmp @sed -f lit.tmp $(PROJ_SRC_DIR)/lit.site.cfg.in > $@ @-rm -f lit.tmp diff --git a/llvm/test/lit.cfg b/llvm/test/lit.cfg index ea91f45754d..b423c6e80b7 100644 --- a/llvm/test/lit.cfg +++ b/llvm/test/lit.cfg @@ -268,6 +268,9 @@ if (config.llvm_use_sanitizer == "Memory" or if not 'hexagon' in config.target_triple: config.available_features.add("object-emission") +if config.have_zlib == "1": + config.available_features.add("zlib") + # llc knows whether he is compiled with -DNDEBUG. import subprocess try: diff --git a/llvm/test/lit.site.cfg.in b/llvm/test/lit.site.cfg.in index 8024b24fcde..3a680b28126 100644 --- a/llvm/test/lit.site.cfg.in +++ b/llvm/test/lit.site.cfg.in @@ -19,6 +19,7 @@ config.host_os = "@HOST_OS@" config.host_arch = "@HOST_ARCH@" config.llvm_use_intel_jitevents = "@LLVM_USE_INTEL_JITEVENTS@" config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@" +config.have_zlib = "@HAVE_LIBZ@" # Support substitution of the tools_dir with user parameters. This is # used when we can't determine the tool dir at configuration time. |