diff options
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/DebugInfo/Inputs/dwarfdump-type-units.cc | 15 | ||||
| -rw-r--r-- | llvm/test/DebugInfo/Inputs/dwarfdump-type-units.elf-x86-64 | bin | 0 -> 3928 bytes | |||
| -rw-r--r-- | llvm/test/DebugInfo/dwarfdump-type-units.test | 21 |
3 files changed, 36 insertions, 0 deletions
diff --git a/llvm/test/DebugInfo/Inputs/dwarfdump-type-units.cc b/llvm/test/DebugInfo/Inputs/dwarfdump-type-units.cc new file mode 100644 index 00000000000..06bc9a2102c --- /dev/null +++ b/llvm/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/llvm/test/DebugInfo/Inputs/dwarfdump-type-units.elf-x86-64 b/llvm/test/DebugInfo/Inputs/dwarfdump-type-units.elf-x86-64 Binary files differnew file mode 100644 index 00000000000..064b4f06764 --- /dev/null +++ b/llvm/test/DebugInfo/Inputs/dwarfdump-type-units.elf-x86-64 diff --git a/llvm/test/DebugInfo/dwarfdump-type-units.test b/llvm/test/DebugInfo/dwarfdump-type-units.test new file mode 100644 index 00000000000..64f4899a17d --- /dev/null +++ b/llvm/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" |

