brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.1 KiB · 5355083 Raw
153 lines · plain
1// RUN: llvm-mc %s -defsym ALIGN_4=1 -save-temp-labels -filetype obj -triple arm-none-eabi -o %t.o2// RUN: llvm-nm %t.o | FileCheck %s --check-prefix=L43// RUN: llvm-dwarfdump -debug-line %t.o 2>&1 | FileCheck %s --implicit-check-not='warning:' --check-prefix=MULT44 5// RUN: llvm-mc %s -defsym ALIGN_8=1 -save-temp-labels -filetype obj -triple arm-none-eabi -o %t.o6// RUN: llvm-nm %t.o | FileCheck %s --check-prefix=L87// RUN: llvm-dwarfdump -debug-line %t.o 2>&1 | FileCheck %s --implicit-check-not='warning:' --check-prefix=MULT88 9// RUN: llvm-mc %s -defsym UNALIGNED_PADDING=1 -save-temp-labels -filetype obj -triple arm-none-eabi -o %t.o10// RUN: llvm-nm %t.o | FileCheck %s --check-prefix=LUNALIGN11// RUN: llvm-dwarfdump -debug-line %t.o 2>&1 | FileCheck %s --check-prefix=UNALIGN12 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 been15/// placed at aligned offsets.16 17// L4: 0000002b N .Ltable0_end18// MULT4:      Address            Line   Column File   ISA Discriminator OpIndex Flags19// MULT4-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------20// MULT4-NEXT: 0x0000000000000000      1      0      1   0             0       0  is_stmt end_sequence21// MULT4-EMPTY:22// MULT4-NEXT: debug_line[0x0000002c]23// MULT4-NEXT: Line table prologue:24// MULT4-NEXT:    total_length: 0x0000003a{{$}}25// MULT4-NEXT:          format: DWARF3226// MULT4-NEXT:         version: 2{{$}}27// MULT4-NEXT: prologue_length: 0x0000001a28// MULT4-NEXT: min_inst_length: 229// MULT4-NEXT: default_is_stmt: 130 31// L8: 00000027 N .Ltable0_end32// MULT8:      Address            Line   Column File   ISA Discriminator OpIndex Flags33// MULT8-NEXT: ------------------ ------ ------ ------ --- ------------- ------- -------------34// MULT8-NEXT: 0x0000000000000000      1      0      1   0             0       0  is_stmt end_sequence35// MULT8-EMPTY:36// MULT8-NEXT: debug_line[0x00000028]37// MULT8-NEXT: Line table prologue:38// MULT8-NEXT:    total_length: 0x0000003a{{$}}39// MULT8-NEXT:          format: DWARF3240// MULT8-NEXT:         version: 2{{$}}41// MULT8-NEXT: prologue_length: 0x0000001a42// MULT8-NEXT: min_inst_length: 243// MULT8-NEXT: default_is_stmt: 144 45/// This should fail to dump:46// LUNALIGN: 00000027 N .Ltable0_end47// UNALIGN: warning: parsing line table prologue at offset 0x00000027: unsupported version48 49.section .debug_line50/// First line table51/// Unit total length:52.long .Ltable0_end - .Ltable0_start53.Ltable0_start:54.short 2        /// Version55/// Header length:56.long .Ltable0_header_end - .Ltable0_header_start57.Ltable0_header_start:58.byte 4         /// Min instruction length59.byte 1         /// Max operations per instruction60.byte 0         /// Default is statement61.byte 6         /// Line range62.byte 10        /// Opcode base63.byte 0         /// standard_opcode_lengths[DW_LNS_copy] = 064.byte 1         /// standard_opcode_lengths[DW_LNS_advance_pc] = 165.byte 1         /// standard_opcode_lengths[DW_LNS_advance_line] = 166.byte 1         /// standard_opcode_lengths[DW_LNS_set_file] = 167.byte 1         /// standard_opcode_lengths[DW_LNS_set_column] = 168.byte 0         /// standard_opcode_lengths[DW_LNS_negate_stmt] = 069.byte 0         /// standard_opcode_lengths[DW_LNS_set_basic_block] = 070.byte 0         /// standard_opcode_lengths[DW_LNS_const_add_pc] = 071.byte 0         /// standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 072.byte 0         /// No include directories73/// File name:74.ifdef ALIGN_475/// Pad out filename so next 4 byte aligned offset is a multiple of 4 and not 8.76.asciz "foobar.cpp"77.else78.asciz "test.c"79.endif80.byte 0         /// Dir idx81.byte 0         /// Mod time82.byte 0         /// Length83.byte 0         /// End files84.Ltable0_header_end:85/// Line table operations86.byte 0         /// Extended opcode87.byte 1         /// Length 188.byte 1         /// DW_LNE_end_sequence89.Ltable0_end:90/// End first line table91/// Padding:92.ifdef UNALIGNED_PADDING93.short 094.else95.byte 096.endif97/// Second line table98/// Unit total length:99.long .Ltable1_end - .Ltable1_start100.Ltable1_start:101.short 2        /// Version102/// Header length:103.long .Ltable1_header_end - .Ltable1_header_start104.Ltable1_header_start:105.byte 2         /// Min instruction length106.byte 1         /// Max operations per instruction107.byte 0         /// Default is statement108.byte 6         /// Line range109.byte 10        /// Opcode base110.byte 0         /// standard_opcode_lengths[DW_LNS_copy] = 0111.byte 1         /// standard_opcode_lengths[DW_LNS_advance_pc] = 1112.byte 1         /// standard_opcode_lengths[DW_LNS_advance_line] = 1113.byte 1         /// standard_opcode_lengths[DW_LNS_set_file] = 1114.byte 1         /// standard_opcode_lengths[DW_LNS_set_column] = 1115.byte 0         /// standard_opcode_lengths[DW_LNS_negate_stmt] = 0116.byte 0         /// standard_opcode_lengths[DW_LNS_set_basic_block] = 0117.byte 0         /// standard_opcode_lengths[DW_LNS_const_add_pc] = 0118.byte 0         /// standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 0119.byte 0         /// No include directories120.asciz "test.c" /// File name121.byte 0         /// Dir idx122.byte 0         /// Mod time123.byte 0         /// Length124.byte 0         /// End files125.Ltable1_header_end:126/// Line table operations127.byte 4         /// DW_LNS_set_file128.byte 1         /// File 1129.byte 5         /// DW_LNS_set_column130.byte 1         /// Column 1131.byte 0         /// Extended opcode132.byte 5         /// Length 5133.byte 2         /// DW_LNE_set_address134.long 32896     /// Address = 0x00008080135.byte 3         /// DW_LNS_advance_line136.byte 6         /// Line += 6137.byte 1         /// DW_LNS_copy138.byte 5         /// DW_LNS_set_column139.byte 2         /// Column 2140.byte 12        /// Special opcode (address += 0,  line += 2)141.byte 30        /// Special opcode (address += 6,  line += 2)142.byte 5         /// DW_LNS_set_column143.byte 1         /// Column 1144.byte 17        /// Special opcode (address += 2,  line += 1)145.byte 2         /// DW_LNS_advance_pc146.byte 4         /// += (4 * min instruction length)147.byte 0         /// Extended opcode148.byte 1         /// Length 1149.byte 1         /// DW_LNE_end_sequence150.Ltable1_end:151/// End second line table152.short 0        /// Padding (to make section a word multiple)153