diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-09-23 22:44:47 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-09-23 22:44:47 +0000 |
commit | 438f5391b2d502a132a4a20469e9e56305b221a4 (patch) | |
tree | fe0d4fa820a272f3d909f07fc2eb084b14fcad47 /test | |
parent | cd7c4980d4ee2d22d92a4907f2d029e67b52d732 (diff) | |
download | external_llvm-438f5391b2d502a132a4a20469e9e56305b221a4.zip external_llvm-438f5391b2d502a132a4a20469e9e56305b221a4.tar.gz external_llvm-438f5391b2d502a132a4a20469e9e56305b221a4.tar.bz2 |
llvm-dwarfdump/libDebugInfo support for type units
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191234 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/DebugInfo/Inputs/dwarfdump-type-units.cc | 15 | ||||
-rw-r--r-- | test/DebugInfo/Inputs/dwarfdump-type-units.elf-x86-64 | bin | 0 -> 3928 bytes | |||
-rw-r--r-- | test/DebugInfo/dwarfdump-type-units.test | 21 |
3 files changed, 36 insertions, 0 deletions
diff --git a/test/DebugInfo/Inputs/dwarfdump-type-units.cc b/test/DebugInfo/Inputs/dwarfdump-type-units.cc new file mode 100644 index 0000000..06bc9a2 --- /dev/null +++ b/test/DebugInfo/Inputs/dwarfdump-type-units.cc @@ -0,0 +1,15 @@ +struct foo {}; +struct bar {}; +void sink(void*); +int main() { + foo f; + sink(&f); + bar b; + sink(&b); +} + +// Built with GCC 4.8.1 +// $ mkdir -p /tmp/dbginfo +// $ cp dwarfdump-type-units.cc /tmp/dbginfo +// $ cd /tmp/dbginfo +// $ g++-4.8.1 -g -fdebug-types-section -c dwarfdump-type-units.cc -o dwarfdump-type-units.elf-x86-64 diff --git a/test/DebugInfo/Inputs/dwarfdump-type-units.elf-x86-64 b/test/DebugInfo/Inputs/dwarfdump-type-units.elf-x86-64 Binary files differnew file mode 100644 index 0000000..064b4f0 --- /dev/null +++ b/test/DebugInfo/Inputs/dwarfdump-type-units.elf-x86-64 diff --git a/test/DebugInfo/dwarfdump-type-units.test b/test/DebugInfo/dwarfdump-type-units.test new file mode 100644 index 0000000..64f4899 --- /dev/null +++ b/test/DebugInfo/dwarfdump-type-units.test @@ -0,0 +1,21 @@ +RUN: llvm-dwarfdump %p/Inputs/dwarfdump-type-units.elf-x86-64 | FileCheck %s + +CHECK: debug_info contents: +CHECK: DW_TAG_variable +CHECK-NEXT: DW_AT_name {{.*}}"f" +CHECK: DW_AT_type [DW_FORM_ref_sig8] ([[FOO_SIG:0x[0-9a-f]*]]) +CHECK: DW_TAG_variable +CHECK-NEXT: DW_AT_name {{.*}}"b" +CHECK: DW_AT_type [DW_FORM_ref_sig8] ([[BAR_SIG:0x[0-9a-f]*]]) + +CHECK: debug_types contents: +CHECK: 0x00000000: Type Unit: {{.*}} type_signature = [[FOO_SIG]] type_offset = 0x[[FOO_OFF:[0-9a-f]*]] (next unit at +CHECK: DW_TAG_type_unit +CHECK-NOT: NULL +CHECK: 0x0000[[FOO_OFF]]: DW_TAG_structure_type +CHECK-NEXT: DW_AT_name {{.*}}"foo" +CHECK: 0x00000000: Type Unit: {{.*}} type_signature = [[BAR_SIG]] type_offset = 0x[[BAR_OFF:[0-9a-f]*]] (next unit at +CHECK: DW_TAG_type_unit +CHECK-NOT: NULL +CHECK: 0x0000[[BAR_OFF]]: DW_TAG_structure_type +CHECK-NEXT: DW_AT_name {{.*}}"bar" |