• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## This checks that llvm-mc is able to produce 64-bit debug info.
2
3# RUN: llvm-mc -g -dwarf-version 3 -dwarf64 -triple x86_64 %s -filetype=obj -o %t3.o
4# RUN: llvm-readobj -r %t3.o | FileCheck --check-prefixes=REL,REL3 %s --implicit-check-not="R_{{.*}} .debug_"
5# RUN: llvm-dwarfdump -v %t3.o | FileCheck --check-prefixes=DUMP,DUMP3 %s
6
7# RUN: llvm-mc -g -dwarf-version 5 -dwarf64 -triple x86_64 %s -filetype=obj -o %t5.o
8# RUN: llvm-readobj -r %t5.o | FileCheck --check-prefixes=REL,REL5 %s --implicit-check-not="R_{{.*}} .debug_"
9# RUN: llvm-dwarfdump -v %t5.o | FileCheck --check-prefixes=DUMP,DUMP5 %s
10
11## The references to other debug info sections are 64-bit, as required for DWARF64.
12# REL:         Section ({{[0-9]+}}) .rela.debug_frame {
13# REL-NEXT:      R_X86_64_64 .debug_frame 0x0
14# REL:         Section ({{[0-9]+}}) .rela.debug_info {
15# REL-NEXT:      R_X86_64_64 .debug_abbrev 0x0
16# REL-NEXT:      R_X86_64_64 .debug_line 0x0
17# REL3-NEXT:     R_X86_64_64 .debug_ranges 0x0
18# REL5-NEXT:     R_X86_64_64 .debug_rnglists 0x14
19# REL:         Section ({{[0-9]+}}) .rela.debug_aranges {
20# REL-NEXT:      R_X86_64_64 .debug_info 0x0
21# REL5:        Section ({{[0-9]+}}) .rela.debug_line {
22# REL5-NEXT:     R_X86_64_64 .debug_line_str 0x0
23# REL5-NEXT:     R_X86_64_64 .debug_line_str 0x
24
25## DW_FORM_sec_offset was introduced in DWARFv4.
26## For DWARFv3, DW_FORM_data8 is used instead.
27# DUMP:       .debug_abbrev contents:
28# DUMP3:        DW_AT_stmt_list DW_FORM_data8
29# DUMP3-NEXT:   DW_AT_ranges    DW_FORM_data8
30# DUMP5:        DW_AT_stmt_list DW_FORM_sec_offset
31# DUMP5-NEXT:   DW_AT_ranges    DW_FORM_sec_offset
32
33# DUMP:       .debug_info contents:
34# DUMP-NEXT:  0x00000000: Compile Unit: {{.*}} format = DWARF64
35# DUMP:       DW_TAG_compile_unit [1] *
36# DUMP3-NEXT:   DW_AT_stmt_list [DW_FORM_data8] (0x0000000000000000)
37# DUMP5-NEXT:   DW_AT_stmt_list [DW_FORM_sec_offset] (0x0000000000000000)
38# DUMP3-NEXT:   DW_AT_ranges [DW_FORM_data8] (0x0000000000000000
39# DUMP5-NEXT:   DW_AT_ranges [DW_FORM_sec_offset] (0x0000000000000014
40# DUMP-NEXT:      [0x0000000000000000, 0x0000000000000001) ".foo"
41# DUMP-NEXT:      [0x0000000000000000, 0x0000000000000001) ".bar")
42# DUMP:       DW_TAG_label [2]
43# DUMP-NEXT:    DW_AT_name [DW_FORM_string] ("foo")
44# DUMP:       DW_TAG_label [2]
45# DUMP-NEXT:    DW_AT_name [DW_FORM_string] ("bar")
46
47# DUMP:       .debug_frame contents:
48# DUMP:       00000000 {{([[:xdigit:]]{16})}} ffffffffffffffff CIE
49# DUMP-NEXT:    Format: DWARF64
50# DUMP:       {{([[:xdigit:]]{8})}} {{([[:xdigit:]]{16})}} 0000000000000000 FDE cie=00000000 pc=00000000...00000001
51# DUMP-NEXT:    Format: DWARF64
52
53## Even though the debug info sections are in the 64-bit format,
54## .eh_frame is still generated as 32-bit.
55# DUMP:       .eh_frame contents:
56# DUMP:       00000000 {{([[:xdigit:]]{8})}} 00000000 CIE
57# DUMP-NEXT:    Format: DWARF32
58# DUMP:       {{([[:xdigit:]]{8})}} {{([[:xdigit:]]{8})}} {{([[:xdigit:]]{8})}} FDE cie=00000000 pc=00000000...00000001
59# DUMP-NEXT:    Format: DWARF32
60
61# DUMP:       .debug_aranges contents:
62# DUMP-NEXT:  Address Range Header: length = 0x0000000000000044, format = DWARF64, version = 0x0002, cu_offset = 0x0000000000000000, addr_size = 0x08, seg_size = 0x00
63# DUMP-NEXT:  [0x0000000000000000,  0x0000000000000001)
64# DUMP-NEXT:  [0x0000000000000000,  0x0000000000000001)
65# DUMP-EMPTY:
66
67# DUMP:       .debug_line contents:
68# DUMP-NEXT:  debug_line[0x00000000]
69# DUMP-NEXT:  Line table prologue:
70# DUMP-NEXT:      total_length:
71# DUMP-NEXT:            format: DWARF64
72# DUMP5:      include_directories[  0] = .debug_line_str[0x0000000000000000] = "[[DIR:.+]]"
73# DUMP5-NEXT: file_names[  0]:
74# DUMP5-NEXT:            name: .debug_line_str[0x00000000[[FILEOFF:[[:xdigit:]]{8}]]] = "[[FILE:.+]]"
75# DUMP5-NEXT:       dir_index: 0
76
77# DUMP5:      .debug_line_str contents:
78# DUMP5-NEXT: 0x00000000: "[[DIR]]"
79# DUMP5-NEXT: 0x[[FILEOFF]]: "[[FILE]]"
80
81# DUMP3:      .debug_ranges contents:
82# DUMP3-NEXT: 00000000 ffffffffffffffff 0000000000000000
83# DUMP3-NEXT: 00000000 0000000000000000 0000000000000001
84# DUMP3-NEXT: 00000000 ffffffffffffffff 0000000000000000
85# DUMP3-NEXT: 00000000 0000000000000000 0000000000000001
86# DUMP3-NEXT: 00000000 <End of list>
87
88# DUMP5:      .debug_rnglists contents:
89# DUMP5-NEXT: 0x00000000: range list header: length = 0x000000000000001d, format = DWARF64, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
90# DUMP5-NEXT: ranges:
91# DUMP5-NEXT: 0x00000014: [DW_RLE_start_length]: 0x0000000000000000, 0x0000000000000001 => [0x0000000000000000, 0x0000000000000001)
92# DUMP5-NEXT: 0x0000001e: [DW_RLE_start_length]: 0x0000000000000000, 0x0000000000000001 => [0x0000000000000000, 0x0000000000000001)
93# DUMP5-NEXT: 0x00000028: [DW_RLE_end_of_list ]
94
95    .cfi_sections .eh_frame, .debug_frame
96
97    .section .foo, "ax", @progbits
98foo:
99    nop
100
101    .section .bar, "ax", @progbits
102bar:
103    .cfi_startproc
104    nop
105    .cfi_endproc
106