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