diff --git a/llvm/test/tools/llvm-dwarfdump/X86/summarize-types.s b/llvm/test/tools/llvm-dwarfdump/X86/summarize-types.s new file mode 100644 --- /dev/null +++ b/llvm/test/tools/llvm-dwarfdump/X86/summarize-types.s @@ -0,0 +1,53 @@ +## Demonstrate that --summarize-types abbreviates output of type information +# RUN: llvm-mc -triple x86_64-unknown-linux %s -filetype=obj -o %t.o + +# RUN: llvm-dwarfdump --debug-types %t.o | FileCheck %s +# RUN: llvm-dwarfdump --debug-types --summarize-types %t.o | \ +# RUN: FileCheck %s --check-prefix=SUMMARIZED --match-full-lines + +# CHECK: .debug_types contents: +# CHECK-NEXT: 0x00000000: Type Unit: +# CHECK-SAME: length = 0x0000001a +# CHECK-SAME: format = DWARF32 +# CHECK-SAME: version = 0x0004 +# CHECK-SAME: abbr_offset = 0x0000 +# CHECK-SAME: addr_size = 0x08 +# CHECK-SAME: name = 'foo' +# CHECK-SAME: type_signature = 0x0011223344556677 +# CHECK-SAME: type_offset = 0x0017 (next unit at 0x0000001e) +# CHECK: DW_AT_name ("foo") + +# SUMMARIZED: .debug_types contents: +# SUMMARIZED-NEXT: name = 'foo', type_signature = 0x0011223344556677, length = 0x0000001a +# SUMMARIZED-NOT: DW_AT_name ("foo") + + .section .debug_str,"MS",@progbits,1 +.Lfoo: + .asciz "foo" + + .section .debug_abbrev,"",@progbits + .byte 0x01 # Abbrev code + .byte 0x36 # DW_TAG_base_type + .byte 0x00 # DW_CHILDREN_no (no members) + .byte 0x03 # DW_AT_name + .byte 0x0e # DW_FORM_strp + .byte 0x00 # EOM(1) + .byte 0x00 # EOM(2) + .byte 0x00 # EOM(3) + + .section .debug_types,"",@progbits +.Lstart: + .long .Lend-.Lversion # Length of Unit +.Lversion: + .short 4 # DWARF version number + .long .debug_abbrev # Offset Into Abbrev. Section + .byte 8 # Address Size (in bytes) + .quad 0x0011223344556677 # Type Signature + .long .Ltype-.Lstart # Type offset +.Ltype: + .byte 1 + .long .Lfoo + .byte 0 + .byte 0 +.Lend: +