1// RUN: llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -fdebug-compilation-dir=/tmp
2// RUN: llvm-dwarfdump %t | FileCheck -check-prefix DWARF %s
3// RUN: llvm-objdump -r %t | FileCheck -check-prefix RELOC %s
4// RUN: llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -dwarf-version 2 2>&1 | FileCheck -check-prefix VERSION %s
5// RUN: not llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -dwarf-version 1 2>&1 | FileCheck -check-prefix DWARF1 %s
6// RUN: not llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -dwarf-version 5 2>&1 | FileCheck -check-prefix DWARF5 %s
7  .section .text, "ax"
8a:
9  mov r0, r0
10
11  .section foo, "ax"
12b:
13  mov r1, r1
14
15// DWARF: .debug_abbrev contents:
16// DWARF: Abbrev table for offset: 0x00000000
17// DWARF: [1] DW_TAG_compile_unit DW_CHILDREN_yes
18// DWARF:         DW_AT_stmt_list DW_FORM_data4
19// DWARF:         DW_AT_ranges    DW_FORM_data4
20// DWARF:         DW_AT_name      DW_FORM_string
21// DWARF:         DW_AT_comp_dir  DW_FORM_string
22// DWARF:         DW_AT_producer  DW_FORM_string
23// DWARF:         DW_AT_language  DW_FORM_data2
24
25// DWARF: .debug_info contents:
26// DWARF: 0x{{[0-9a-f]+}}: DW_TAG_compile_unit [1]
27// CHECK-NOT-DWARF: DW_TAG_
28// DWARF: DW_AT_ranges [DW_FORM_data4]      (0x00000000
29
30// DWARF: 0x{{[0-9a-f]+}}:   DW_TAG_label [2] *
31// DWARF-NEXT: DW_AT_name [DW_FORM_string]     ("a")
32
33// DWARF: 0x{{[0-9a-f]+}}:   DW_TAG_label [2] *
34// DWARF-NEXT: DW_AT_name [DW_FORM_string]     ("b")
35
36
37// DWARF: .debug_aranges contents:
38// DWARF-NEXT: Address Range Header: length = 0x00000024, version = 0x0002, cu_offset = 0x00000000, addr_size = 0x04, seg_size = 0x00
39// DWARF-NEXT: [0x00000000 - 0x00000004)
40// DWARF-NEXT: [0x00000000 - 0x00000004)
41
42
43// DWARF: .debug_line contents:
44// DWARF:      0x0000000000000000      9      0      1   0   0  is_stmt
45// DWARF-NEXT: 0x0000000000000004      9      0      1   0   0  is_stmt end_sequence
46// DWARF-NEXT: 0x0000000000000000     13      0      1   0   0  is_stmt
47// DWARF-NEXT: 0x0000000000000004     13      0      1   0   0  is_stmt end_sequence
48
49
50// DWARF: .debug_ranges contents:
51// DWARF: 00000000 ffffffff 00000000
52// DWARF: 00000000 00000000 00000004
53// DWARF: 00000000 ffffffff 00000000
54// DWARF: 00000000 00000000 00000004
55// DWARF: 00000000 <End of list>
56
57
58
59// RELOC: RELOCATION RECORDS FOR [.rel.debug_info]:
60// RELOC-NEXT: 00000006 R_ARM_ABS32 .debug_abbrev
61// RELOC-NEXT: 0000000c R_ARM_ABS32 .debug_line
62// RELOC-NEXT: 00000010 R_ARM_ABS32 .debug_ranges
63// RELOC-NEXT: R_ARM_ABS32 .text
64// RELOC-NEXT: R_ARM_ABS32 foo
65
66// RELOC: RELOCATION RECORDS FOR [.rel.debug_ranges]:
67// RELOC-NEXT: 00000004 R_ARM_ABS32 .text
68// RELOC-NEXT: 00000014 R_ARM_ABS32 foo
69
70// RELOC: RELOCATION RECORDS FOR [.rel.debug_aranges]:
71// RELOC-NEXT: 00000006 R_ARM_ABS32 .debug_info
72// RELOC-NEXT: 00000010 R_ARM_ABS32 .text
73// RELOC-NEXT: 00000018 R_ARM_ABS32 foo
74
75
76// VERSION: {{.*}} warning: DWARF2 only supports one section per compilation unit
77
78// DWARF1: Dwarf version 1 is not supported.
79// DWARF5: Dwarf version 5 is not supported.
80