1 # Test object to verify dwarfdump handles a syntactically correct line-number
2 # program containing unrecognized extended opcodes.
3 # RUN: llvm-mc -triple x86_64-unknown-linux %s -filetype=obj -o %t.o
4 # RUN: llvm-dwarfdump -v %t.o | FileCheck %s
5 # RUN: llvm-dwarfdump -v %t.o 2>&1 | FileCheck %s --check-prefix=ERR
11 # FIXME: When we can dump a line-table without a unit, we could remove
12 # the .debug_abbrev and .debug_info sections from this test.
13 .section .debug_abbrev,"",@progbits
14 .byte 0x01 # Abbrev code
15 .byte 0x11 # DW_TAG_compile_unit
16 .byte 0x00 # DW_CHILDREN_no
17 .byte 0x10 # DW_AT_stmt_list
18 .byte 0x17 # DW_FORM_sec_offset
22 .section .debug_info,"",@progbits
23 .long CU_end-CU_version # Length of Unit
25 .short 4 # DWARF version number
26 .long .debug_abbrev # Offset Into Abbrev. Section
27 .byte 8 # Address Size (in bytes)
28 # The compile-unit DIE, with DW_AT_stmt_list.
34 .long CU2_end-CU2_version # Length of Unit
36 .short 4 # DWARF version number
37 .long .debug_abbrev # Offset Into Abbrev. Section
38 .byte 8 # Address Size (in bytes)
39 # The compile-unit DIE, with DW_AT_stmt_list.
45 .section .debug_line,"",@progbits
46 # CHECK-LABEL: .debug_line contents:
48 # DWARF v4 line-table header.
50 .long LT_end-LT_version # Length of Unit (DWARF-32 format)
52 .short 4 # DWARF version number
53 .long LT_header_end-LT_params # Length of Prologue
55 .byte 1 # Minimum Instruction Length
56 .byte 1 # Maximum Operations per Instruction
57 .byte 1 # Default is_stmt
60 .byte 13 # Opcode Base
61 .byte 0 # Standard Opcode Lengths
78 # Bogus extended opcode with zero length.
79 .byte 0 # Extended opcode indicator.
80 .byte 0 # LEB length of extended opcode + operands.
81 # Real opcode and operand.
84 .byte 2 # DW_LNE_set_address
86 # Bogus extended opcode with multibyte LEB length.
88 .byte 0x82 # Length of 2 but with additional length byte.
89 .byte 0 # Additional length byte.
90 .byte 0x47 # Unrecognized opcode...
91 .byte 0 # with its 1-byte operand.
92 # Proper end-sequence opcode.
95 .byte 1 # DW_LNE_end_sequence
98 # CHECK: Line table prologue:
100 # Exact prologue length isn't important but it tells us where to expect the
101 # line-number program to start, and we do want to verify those offsets.
102 # CHECK-NEXT: prologue_length: 0x00000014
103 # CHECK: 0x0000001e: 00 Badly formed extended line op
104 # CHECK-NEXT: 0x00000020: 00 DW_LNE_set_address
105 # CHECK-NEXT: 0x0000002b: 00 Unrecognized extended op 0x47 length 2
106 # CHECK-NEXT: 0x00000030: 00 DW_LNE_end_sequence
107 # CHECK-NEXT: 0x0000000000000000 {{.*}} is_stmt end_sequence
110 # DWARF v4 line-table header #2.
112 .long LT2_end-LT2_version # Length of Unit (DWARF-32 format)
114 .short 4 # DWARF version number
115 .long LT2_header_end-LT2_params # Length of Prologue
117 .byte 1 # Minimum Instruction Length
118 .byte 1 # Maximum Operations per Instruction
119 .byte 1 # Default is_stmt
121 .byte 14 # Line Range
122 .byte 13 # Opcode Base
123 .byte 0 # Standard Opcode Lengths
140 # Real opcode and operand.
143 .byte 2 # DW_LNE_set_address
145 # Real opcode with incorrect length.
147 .byte 2 # Wrong length, should be 1.
148 .byte 1 # DW_LNE_end_sequence
151 # ERR: warning: unexpected line op length at offset 0x0000005e
152 # ERR-SAME: expected 0x02 found 0x01