blob: 0eb8bab8162099547a5de49aed17e1a31704c2ea [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
2// RUN: llvm-dwarfdump %t | FileCheck -check-prefix DWARF %s
3// RUN: llvm-objdump -r %t | FileCheck -check-prefix RELOC %s
Oliver Stannard14f97d02014-09-22 10:45:16 +00004// 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 +00005// 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_
Frederic Risse939b432014-10-23 04:08:34 +000028// DWARF: DW_AT_ranges [DW_FORM_data4] (0x00000000
Oliver Stannardd306c3c2014-06-19 16:35:19 +000029
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
Eric Christopherb0a78ca2014-06-19 20:00:13 +000063// RELOC-NEXT: R_ARM_ABS32 .text
64// RELOC-NEXT: R_ARM_ABS32 foo
Oliver Stannardd306c3c2014-06-19 16:35:19 +000065
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
Oliver Stannard14f97d02014-09-22 10:45:16 +000076// VERSION: {{.*}} warning: DWARF2 only supports one section per compilation unit
Oliver Stannardd306c3c2014-06-19 16:35:19 +000077
78// DWARF1: Dwarf version 1 is not supported.
79// DWARF5: Dwarf version 5 is not supported.