blob: 3f2e9b8efa30394ce2ec676f0465afee739d8a1e [file] [log] [blame]
Paul Robinsondccb4fe2017-02-28 23:40:46 +00001// RUN: llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -dwarf-version 5 -fdebug-compilation-dir=/tmp
Adrian Prantl16aa4cf2017-09-11 23:05:20 +00002// RUN: llvm-dwarfdump -v %t | FileCheck -check-prefix DWARF -check-prefix DWARF45 %s
Paul Robinson795ab0d2017-12-05 20:35:00 +00003// RUN: llvm-dwarfdump --debug-line %t | FileCheck -check-prefix DWARF-DL -check-prefix DWARF-DL-5 -DDWVER=5 %s
Paul Robinsondccb4fe2017-02-28 23:40:46 +00004// RUN: llvm-objdump -r %t | FileCheck -check-prefix RELOC -check-prefix RELOC5 %s
Oliver Stannardd306c3c2014-06-19 16:35:19 +00005// RUN: llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -fdebug-compilation-dir=/tmp
Adrian Prantl16aa4cf2017-09-11 23:05:20 +00006// RUN: llvm-dwarfdump -v %t | FileCheck -check-prefix DWARF -check-prefix DWARF45 %s
Paul Robinson795ab0d2017-12-05 20:35:00 +00007// RUN: llvm-dwarfdump --debug-line %t | FileCheck -check-prefix DWARF-DL -DDWVER=4 %s
Paul Robinsondccb4fe2017-02-28 23:40:46 +00008// RUN: llvm-objdump -r %t | FileCheck -check-prefix RELOC -check-prefix RELOC4 %s
Paul Robinson22d0d312015-12-23 01:57:31 +00009// RUN: llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -dwarf-version 3 -fdebug-compilation-dir=/tmp
Adrian Prantl16aa4cf2017-09-11 23:05:20 +000010// RUN: llvm-dwarfdump -v %t | FileCheck -check-prefix DWARF -check-prefix DWARF3 %s
Paul Robinson795ab0d2017-12-05 20:35:00 +000011// RUN: llvm-dwarfdump --debug-line %t | FileCheck -check-prefix DWARF-DL -DDWVER=3 %s
Oliver Stannard14f97d02014-09-22 10:45:16 +000012// 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 +000013// RUN: not llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -dwarf-version 1 2>&1 | FileCheck -check-prefix DWARF1 %s
Paul Robinsondccb4fe2017-02-28 23:40:46 +000014// RUN: not llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -dwarf-version 6 2>&1 | FileCheck -check-prefix DWARF6 %s
Oliver Stannardd306c3c2014-06-19 16:35:19 +000015 .section .text, "ax"
16a:
17 mov r0, r0
18
19 .section foo, "ax"
20b:
21 mov r1, r1
22
23// DWARF: .debug_abbrev contents:
24// DWARF: Abbrev table for offset: 0x00000000
25// DWARF: [1] DW_TAG_compile_unit DW_CHILDREN_yes
Paul Robinson22d0d312015-12-23 01:57:31 +000026// DWARF3: DW_AT_stmt_list DW_FORM_data4
Paul Robinsondccb4fe2017-02-28 23:40:46 +000027// DWARF45: DW_AT_stmt_list DW_FORM_sec_offset
Paul Robinson22d0d312015-12-23 01:57:31 +000028// DWARF3: DW_AT_ranges DW_FORM_data4
Paul Robinsondccb4fe2017-02-28 23:40:46 +000029// DWARF45: DW_AT_ranges DW_FORM_sec_offset
Oliver Stannardd306c3c2014-06-19 16:35:19 +000030// DWARF: DW_AT_name DW_FORM_string
31// DWARF: DW_AT_comp_dir DW_FORM_string
32// DWARF: DW_AT_producer DW_FORM_string
33// DWARF: DW_AT_language DW_FORM_data2
34
35// DWARF: .debug_info contents:
36// DWARF: 0x{{[0-9a-f]+}}: DW_TAG_compile_unit [1]
Paul Robinson22d0d312015-12-23 01:57:31 +000037// DWARF-NOT: DW_TAG_
Paul Robinsondccb4fe2017-02-28 23:40:46 +000038// DWARF3: DW_AT_ranges [DW_FORM_data4] (0x00000000
39// DWARF45: DW_AT_ranges [DW_FORM_sec_offset] (0x00000000
Oliver Stannardd306c3c2014-06-19 16:35:19 +000040
41// DWARF: 0x{{[0-9a-f]+}}: DW_TAG_label [2] *
42// DWARF-NEXT: DW_AT_name [DW_FORM_string] ("a")
43
44// DWARF: 0x{{[0-9a-f]+}}: DW_TAG_label [2] *
45// DWARF-NEXT: DW_AT_name [DW_FORM_string] ("b")
46
47
48// DWARF: .debug_aranges contents:
49// DWARF-NEXT: Address Range Header: length = 0x00000024, version = 0x0002, cu_offset = 0x00000000, addr_size = 0x04, seg_size = 0x00
50// DWARF-NEXT: [0x00000000 - 0x00000004)
51// DWARF-NEXT: [0x00000000 - 0x00000004)
52
53
Jonas Devlieghere26f9a0c2017-09-21 20:15:30 +000054// DWARF-DL: .debug_line contents:
Paul Robinson795ab0d2017-12-05 20:35:00 +000055// DWARF-DL: version: [[DWVER]]
56// DWARF-DL-5: address_size: 4
57// DWARF-DL-5: include_directories[ 1] = ''
58// DWARF-DL: file_names[ 1] {{.*}} <stdin>
Jonas Devlieghere26f9a0c2017-09-21 20:15:30 +000059// DWARF-DL: 0x0000000000000000 17 0 1 0 0 is_stmt
60// DWARF-DL-NEXT: 0x0000000000000004 17 0 1 0 0 is_stmt end_sequence
61// DWARF-DL-NEXT: 0x0000000000000000 21 0 1 0 0 is_stmt
62// DWARF-DL-NEXT: 0x0000000000000004 21 0 1 0 0 is_stmt end_sequence
Oliver Stannardd306c3c2014-06-19 16:35:19 +000063
64
65// DWARF: .debug_ranges contents:
66// DWARF: 00000000 ffffffff 00000000
67// DWARF: 00000000 00000000 00000004
68// DWARF: 00000000 ffffffff 00000000
69// DWARF: 00000000 00000000 00000004
70// DWARF: 00000000 <End of list>
71
72
73
Paul Robinsondccb4fe2017-02-28 23:40:46 +000074// Offsets are different in DWARF v5 due to different header layout.
Oliver Stannardd306c3c2014-06-19 16:35:19 +000075// RELOC: RELOCATION RECORDS FOR [.rel.debug_info]:
Paul Robinsondccb4fe2017-02-28 23:40:46 +000076// RELOC4-NEXT: 00000006 R_ARM_ABS32 .debug_abbrev
77// RELOC4-NEXT: 0000000c R_ARM_ABS32 .debug_line
78// RELOC4-NEXT: 00000010 R_ARM_ABS32 .debug_ranges
79// RELOC5-NEXT: 00000008 R_ARM_ABS32 .debug_abbrev
80// RELOC5-NEXT: 0000000d R_ARM_ABS32 .debug_line
81// RELOC5-NEXT: 00000011 R_ARM_ABS32 .debug_ranges
Eric Christopherb0a78ca2014-06-19 20:00:13 +000082// RELOC-NEXT: R_ARM_ABS32 .text
83// RELOC-NEXT: R_ARM_ABS32 foo
Oliver Stannardd306c3c2014-06-19 16:35:19 +000084
85// RELOC: RELOCATION RECORDS FOR [.rel.debug_ranges]:
86// RELOC-NEXT: 00000004 R_ARM_ABS32 .text
87// RELOC-NEXT: 00000014 R_ARM_ABS32 foo
88
89// RELOC: RELOCATION RECORDS FOR [.rel.debug_aranges]:
90// RELOC-NEXT: 00000006 R_ARM_ABS32 .debug_info
91// RELOC-NEXT: 00000010 R_ARM_ABS32 .text
92// RELOC-NEXT: 00000018 R_ARM_ABS32 foo
93
94
Oliver Stannard14f97d02014-09-22 10:45:16 +000095// VERSION: {{.*}} warning: DWARF2 only supports one section per compilation unit
Oliver Stannardd306c3c2014-06-19 16:35:19 +000096
97// DWARF1: Dwarf version 1 is not supported.
Paul Robinsondccb4fe2017-02-28 23:40:46 +000098// DWARF6: Dwarf version 6 is not supported.