blob: 4c099acccd5738c5427a35f08ff4258da28577fa [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 Robinsonceafcd42018-02-08 23:08:02 +00003// RUN: llvm-dwarfdump --debug-line %t | FileCheck -check-prefix DWARF-DL -check-prefix DWARF-DL-5 -DDWVER=5 -DDWFILE=0 %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 Robinsonceafcd42018-02-08 23:08:02 +00007// RUN: llvm-dwarfdump --debug-line %t | FileCheck -check-prefix DWARF-DL -DDWVER=4 -DDWFILE=1 %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 Robinsonceafcd42018-02-08 23:08:02 +000011// RUN: llvm-dwarfdump --debug-line %t | FileCheck -check-prefix DWARF-DL -DDWVER=3 -DDWFILE=1 %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
Jonas Devlieghere6f24c872018-01-16 11:17:57 +000050// DWARF-NEXT: [0x00000000, 0x00000004)
51// DWARF-NEXT: [0x00000000, 0x00000004)
Oliver Stannardd306c3c2014-06-19 16:35:19 +000052
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
Paul Robinson732e4432018-03-06 03:15:21 +000057// DWARF-DL-5: include_directories[ 0] = ""
Scott Linder16c7bda2018-02-23 23:01:06 +000058// DWARF-DL: file_names[ [[DWFILE]]]:
Paul Robinson732e4432018-03-06 03:15:21 +000059// DWARF-DL: name: "<stdin>"
Jonas Devlieghere26f9a0c2017-09-21 20:15:30 +000060// DWARF-DL: 0x0000000000000000 17 0 1 0 0 is_stmt
61// DWARF-DL-NEXT: 0x0000000000000004 17 0 1 0 0 is_stmt end_sequence
62// DWARF-DL-NEXT: 0x0000000000000000 21 0 1 0 0 is_stmt
63// DWARF-DL-NEXT: 0x0000000000000004 21 0 1 0 0 is_stmt end_sequence
Oliver Stannardd306c3c2014-06-19 16:35:19 +000064
65
66// DWARF: .debug_ranges contents:
67// DWARF: 00000000 ffffffff 00000000
68// DWARF: 00000000 00000000 00000004
69// DWARF: 00000000 ffffffff 00000000
70// DWARF: 00000000 00000000 00000004
71// DWARF: 00000000 <End of list>
72
73
74
Paul Robinsondccb4fe2017-02-28 23:40:46 +000075// Offsets are different in DWARF v5 due to different header layout.
Oliver Stannardd306c3c2014-06-19 16:35:19 +000076// RELOC: RELOCATION RECORDS FOR [.rel.debug_info]:
Paul Robinsondccb4fe2017-02-28 23:40:46 +000077// RELOC4-NEXT: 00000006 R_ARM_ABS32 .debug_abbrev
78// RELOC4-NEXT: 0000000c R_ARM_ABS32 .debug_line
79// RELOC4-NEXT: 00000010 R_ARM_ABS32 .debug_ranges
80// RELOC5-NEXT: 00000008 R_ARM_ABS32 .debug_abbrev
81// RELOC5-NEXT: 0000000d R_ARM_ABS32 .debug_line
82// RELOC5-NEXT: 00000011 R_ARM_ABS32 .debug_ranges
Eric Christopherb0a78ca2014-06-19 20:00:13 +000083// RELOC-NEXT: R_ARM_ABS32 .text
84// RELOC-NEXT: R_ARM_ABS32 foo
Oliver Stannardd306c3c2014-06-19 16:35:19 +000085
86// RELOC: RELOCATION RECORDS FOR [.rel.debug_ranges]:
87// RELOC-NEXT: 00000004 R_ARM_ABS32 .text
88// RELOC-NEXT: 00000014 R_ARM_ABS32 foo
89
90// RELOC: RELOCATION RECORDS FOR [.rel.debug_aranges]:
91// RELOC-NEXT: 00000006 R_ARM_ABS32 .debug_info
92// RELOC-NEXT: 00000010 R_ARM_ABS32 .text
93// RELOC-NEXT: 00000018 R_ARM_ABS32 foo
94
95
Oliver Stannard14f97d02014-09-22 10:45:16 +000096// VERSION: {{.*}} warning: DWARF2 only supports one section per compilation unit
Oliver Stannardd306c3c2014-06-19 16:35:19 +000097
98// DWARF1: Dwarf version 1 is not supported.
Paul Robinsondccb4fe2017-02-28 23:40:46 +000099// DWARF6: Dwarf version 6 is not supported.