[llvm] r175168 - Add testcase for llvm-dwarfdump to test parsing of the pubnames data.

Krzysztof Parzyszek kparzysz at codeaurora.org
Thu Feb 14 08:10:59 PST 2013


Author: kparzysz
Date: Thu Feb 14 10:10:58 2013
New Revision: 175168

URL: http://llvm.org/viewvc/llvm-project?rev=175168&view=rev
Log:
Add testcase for llvm-dwarfdump to test parsing of the pubnames data.

Added:
    llvm/trunk/test/DebugInfo/Inputs/dwarfdump-pubnames.cc
    llvm/trunk/test/DebugInfo/Inputs/dwarfdump-pubnames.elf-x86-64
    llvm/trunk/test/DebugInfo/dwarfdump-pubnames.test

Added: llvm/trunk/test/DebugInfo/Inputs/dwarfdump-pubnames.cc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-pubnames.cc?rev=175168&view=auto
==============================================================================
--- llvm/trunk/test/DebugInfo/Inputs/dwarfdump-pubnames.cc (added)
+++ llvm/trunk/test/DebugInfo/Inputs/dwarfdump-pubnames.cc Thu Feb 14 10:10:58 2013
@@ -0,0 +1,32 @@
+// Object file built using:
+// clang -g -mllvm -generate-dwarf-pubnames -o dwarfdump-pubnames.elf-x86_64 \
+//    dwarfdump-pubnames.cc  -c
+
+struct C {
+  void member_function();
+  static int static_member_function();
+  static int static_member_variable;
+};
+
+int C::static_member_variable = 0;
+
+void C::member_function() {
+  static_member_variable = 0;
+}
+
+int C::static_member_function() {
+  return static_member_variable;
+}
+
+C global_variable;
+
+int global_function() {
+  return -1;
+}
+
+namespace ns {
+  void global_namespace_function() {
+    global_variable.member_function();
+  }
+  int global_namespace_variable = 1;
+}

Added: llvm/trunk/test/DebugInfo/Inputs/dwarfdump-pubnames.elf-x86-64
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-pubnames.elf-x86-64?rev=175168&view=auto
==============================================================================
Binary files llvm/trunk/test/DebugInfo/Inputs/dwarfdump-pubnames.elf-x86-64 (added) and llvm/trunk/test/DebugInfo/Inputs/dwarfdump-pubnames.elf-x86-64 Thu Feb 14 10:10:58 2013 differ

Added: llvm/trunk/test/DebugInfo/dwarfdump-pubnames.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dwarfdump-pubnames.test?rev=175168&view=auto
==============================================================================
--- llvm/trunk/test/DebugInfo/dwarfdump-pubnames.test (added)
+++ llvm/trunk/test/DebugInfo/dwarfdump-pubnames.test Thu Feb 14 10:10:58 2013
@@ -0,0 +1,16 @@
+RUN: llvm-dwarfdump %p/Inputs/dwarfdump-pubnames.elf-x86-64 \
+RUN:   -debug-dump=pubnames | FileCheck %s
+
+CHECK: .debug_pubnames contents:
+CHECK: Length:                161
+CHECK: Version:               2
+CHECK: Offset in .debug_info: 0
+CHECK: Size:                  321
+
+CHECK:  Offset    Name
+CHECK:      98    global_namespace_variable
+CHECK:      a7    global_namespace_function
+CHECK:      ec    static_member_function
+CHECK:      7c    global_variable
+CHECK:     103    global_function
+CHECK:      c2    member_function





More information about the llvm-commits mailing list