1 // RUN
: llvm-mc
%s
-defsym ALIGN_4
=1 -save-temp-labels
-filetype obj
-triple arm-none-eabi
-o
%t.o
2 // RUN
: llvm-nm
%t.o | FileCheck
%s
--check-prefix
=L4
3 // RUN
: llvm-dwarfdump
-debug-line
%t.o
2>&1 | FileCheck
%s
--implicit-check-
not='warning:' --check-prefix
=MULT4
5 // RUN
: llvm-mc
%s
-defsym ALIGN_8
=1 -save-temp-labels
-filetype obj
-triple arm-none-eabi
-o
%t.o
6 // RUN
: llvm-nm
%t.o | FileCheck
%s
--check-prefix
=L8
7 // RUN
: llvm-dwarfdump
-debug-line
%t.o
2>&1 | FileCheck
%s
--implicit-check-
not='warning:' --check-prefix
=MULT8
9 // RUN
: llvm-mc
%s
-defsym UNALIGNED_PADDING
=1 -save-temp-labels
-filetype obj
-triple arm-none-eabi
-o
%t.o
10 // RUN
: llvm-nm
%t.o | FileCheck
%s
--check-prefix
=LUNALIGN
11 // RUN
: llvm-dwarfdump
-debug-line
%t.o
2>&1 | FileCheck
%s
--check-prefix
=UNALIGN
13 /// This test is based on
a real example from ARM C
/C+
+ Compiler.
14 /// It verifies llvm-dwarfdump is able to dump line tables even if they
've been
15 /// placed at aligned offsets.
17 // L4: 0000002b N .Ltable0_end
18 // MULT4: Address Line Column File ISA Discriminator OpIndex Flags
19 // MULT4-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------
20 // MULT4-NEXT: 0x0000000000000000 1 0 1 0 0 0 is_stmt end_sequence
22 // MULT4-NEXT: debug_line[0x0000002c]
23 // MULT4-NEXT: Line table prologue:
24 // MULT4-NEXT: total_length: 0x0000003a{{$}}
25 // MULT4-NEXT: format: DWARF32
26 // MULT4-NEXT: version: 2{{$}}
27 // MULT4-NEXT: prologue_length: 0x0000001a
28 // MULT4-NEXT: min_inst_length: 2
29 // MULT4-NEXT: default_is_stmt: 1
31 // L8: 00000027 N .Ltable0_end
32 // MULT8: Address Line Column File ISA Discriminator OpIndex Flags
33 // MULT8-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------
34 // MULT8-NEXT: 0x0000000000000000 1 0 1 0 0 0 is_stmt end_sequence
36 // MULT8-NEXT: debug_line[0x00000028]
37 // MULT8-NEXT: Line table prologue:
38 // MULT8-NEXT: total_length: 0x0000003a{{$}}
39 // MULT8-NEXT: format: DWARF32
40 // MULT8-NEXT: version: 2{{$}}
41 // MULT8-NEXT: prologue_length: 0x0000001a
42 // MULT8-NEXT: min_inst_length: 2
43 // MULT8-NEXT: default_is_stmt: 1
45 /// This should fail to dump:
46 // LUNALIGN: 00000027 N .Ltable0_end
47 // UNALIGN: warning: parsing line table prologue at offset 0x00000027: unsupported version
51 /// Unit total length:
52 .long .Ltable0_end - .Ltable0_start
56 .long .Ltable0_header_end - .Ltable0_header_start
57 .Ltable0_header_start:
58 .byte 4 /// Min instruction length
59 .byte 1 /// Max operations per instruction
60 .byte 0 /// Default is statement
61 .byte 6 /// Line range
62 .byte 10 /// Opcode base
63 .byte 0 /// standard_opcode_lengths[DW_LNS_copy] = 0
64 .byte 1 /// standard_opcode_lengths[DW_LNS_advance_pc] = 1
65 .byte 1 /// standard_opcode_lengths[DW_LNS_advance_line] = 1
66 .byte 1 /// standard_opcode_lengths[DW_LNS_set_file] = 1
67 .byte 1 /// standard_opcode_lengths[DW_LNS_set_column] = 1
68 .byte 0 /// standard_opcode_lengths[DW_LNS_negate_stmt] = 0
69 .byte 0 /// standard_opcode_lengths[DW_LNS_set_basic_block] = 0
70 .byte 0 /// standard_opcode_lengths[DW_LNS_const_add_pc] = 0
71 .byte 0 /// standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 0
72 .byte 0 /// No include directories
75 /// Pad out filename so next 4 byte aligned offset is a multiple of 4 and not 8.
85 /// Line table operations
86 .byte 0 /// Extended opcode
88 .byte 1 /// DW_LNE_end_sequence
90 /// End first line table
92 .ifdef UNALIGNED_PADDING
98 /// Unit total length:
99 .long .Ltable1_end - .Ltable1_start
103 .long .Ltable1_header_end - .Ltable1_header_start
104 .Ltable1_header_start:
105 .byte 2 /// Min instruction length
106 .byte 1 /// Max operations per instruction
107 .byte 0 /// Default is statement
108 .byte 6 /// Line range
109 .byte 10 /// Opcode base
110 .byte 0 /// standard_opcode_lengths[DW_LNS_copy] = 0
111 .byte 1 /// standard_opcode_lengths[DW_LNS_advance_pc] = 1
112 .byte 1 /// standard_opcode_lengths[DW_LNS_advance_line] = 1
113 .byte 1 /// standard_opcode_lengths[DW_LNS_set_file] = 1
114 .byte 1 /// standard_opcode_lengths[DW_LNS_set_column] = 1
115 .byte 0 /// standard_opcode_lengths[DW_LNS_negate_stmt] = 0
116 .byte 0 /// standard_opcode_lengths[DW_LNS_set_basic_block] = 0
117 .byte 0 /// standard_opcode_lengths[DW_LNS_const_add_pc] = 0
118 .byte 0 /// standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 0
119 .byte 0 /// No include directories
120 .asciz "test.c" /// File name
124 .byte 0 /// End files
126 /// Line table operations
127 .byte 4 /// DW_LNS_set_file
129 .byte 5 /// DW_LNS_set_column
131 .byte 0 /// Extended opcode
133 .byte 2 /// DW_LNE_set_address
134 .long 32896 /// Address = 0x00008080
135 .byte 3 /// DW_LNS_advance_line
136 .byte 6 /// Line += 6
137 .byte 1 /// DW_LNS_copy
138 .byte 5 /// DW_LNS_set_column
140 .byte 12 /// Special opcode (address += 0, line += 2)
141 .byte 30 /// Special opcode (address += 6, line += 2)
142 .byte 5 /// DW_LNS_set_column
144 .byte 17 /// Special opcode (address += 2, line += 1)
145 .byte 2 /// DW_LNS_advance_pc
146 .byte 4 /// += (4 * min instruction length)
147 .byte 0 /// Extended opcode
149 .byte 1 /// DW_LNE_end_sequence
151 /// End second line table
152 .short 0 /// Padding (to make section a word multiple)