• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llvm-mc -triple x86_64-pc-linux -filetype=obj %s -o %t
2# RUN: llvm-dwarfdump -v %t | FileCheck %s
3
4# CHECK: .debug_info contents:
5# CHECK: DW_TAG_compile_unit
6# CHECK: DW_AT_ranges [DW_FORM_sec_offset] (0x00000000
7# CHECK-NEXT:  [0x0000000000000000, 0x0000000000000001) ".text.foo1"
8# CHECK-NEXT:  [0x0000000000000000, 0x0000000000000002) ".text.foo2" [4]
9# CHECK-NEXT:  [0x0000000000000000, 0x0000000000000003) ".text.foo2" [5])
10
11# CHECK: .debug_ranges contents:
12# CHECK:   00000000 0000000000000000 0000000000000001
13# CHECK:   00000000 0000000000000000 0000000000000002
14# CHECK:   00000000 0000000000000000 0000000000000003
15# CHECK:   00000000 <End of list>
16
17# RUN: llvm-dwarfdump %t | FileCheck %s --check-prefix=BRIEF
18# BRIEF: DW_TAG_compile_unit
19# BRIEF: DW_AT_ranges         (0x00000000
20# BRIEF-NEXT:  [0x0000000000000000, 0x0000000000000001)
21# BRIEF-NEXT:  [0x0000000000000000, 0x0000000000000002)
22# BRIEF-NEXT:  [0x0000000000000000, 0x0000000000000003))
23
24# RUN: llvm-dwarfdump -diff %t | FileCheck %s --check-prefix=DIFF
25# DIFF: DW_TAG_compile_unit
26# DIFF-NEXT: DW_AT_producer	()
27# DIFF-NEXT: DW_AT_language	(DW_LANG_C_plus_plus)
28# DIFF-NEXT: DW_AT_name	()
29# DIFF-NEXT: DW_AT_stmt_list	()
30# DIFF-NEXT: DW_AT_comp_dir	()
31# DIFF-NEXT: DW_AT_low_pc	()
32# DIFF-NEXT: DW_AT_ranges	()
33
34## Asm code for testcase is a reduced and modified output from next
35## invocation and source:
36# clang test.cpp -S -o test.s -gmlt -ffunction-sections
37# test.cpp:
38#   void foo1() { }
39#   void foo2() { }
40
41.section .text.foo1,"ax",@progbits
42.Lfunc_begin0:
43 nop
44.Lfunc_end0:
45
46.section .text.foo2,"ax",@progbits, unique, 1
47.Lfunc_begin1:
48 nop
49 nop
50.Lfunc_end1:
51
52.section .text.foo2,"ax",@progbits, unique, 2
53.Lfunc_begin2:
54 nop
55 nop
56 nop
57.Lfunc_end2:
58
59.section .debug_abbrev,"",@progbits
60.byte 1                       # Abbreviation Code
61.byte 17                      # DW_TAG_compile_unit
62.byte 0                       # DW_CHILDREN_no
63.byte 37                      # DW_AT_producer
64.byte 14                      # DW_FORM_strp
65.byte 19                      # DW_AT_language
66.byte 5                       # DW_FORM_data2
67.byte 3                       # DW_AT_name
68.byte 14                      # DW_FORM_strp
69.byte 16                      # DW_AT_stmt_list
70.byte 23                      # DW_FORM_sec_offset
71.byte 27                      # DW_AT_comp_dir
72.byte 14                      # DW_FORM_strp
73.byte 17                      # DW_AT_low_pc
74.byte 1                       # DW_FORM_addr
75.byte 85                      # DW_AT_ranges
76.byte 23                      # DW_FORM_sec_offset
77.byte 0                       # EOM(1)
78.byte 0                       # EOM(2)
79.byte 0                       # EOM(3)
80
81.section .debug_info,"",@progbits
82.Lcu_begin0:
83.long 38                      # Length of Unit
84.short 4                      # DWARF version number
85.long .debug_abbrev           # Offset Into Abbrev. Section
86.byte 8                       # Address Size (in bytes)
87.byte 1                       # Abbrev [1] 0xb:0x1f DW_TAG_compile_unit
88.long 0                       # DW_AT_producer
89.short 4                      # DW_AT_language
90.long 0                       # DW_AT_name
91.long 0                       # DW_AT_stmt_list
92.long 0                       # DW_AT_comp_dir
93.quad 0                       # DW_AT_low_pc
94.long .Ldebug_ranges0         # DW_AT_ranges
95
96.section .debug_ranges,"",@progbits
97.Ldebug_ranges0:
98.quad .Lfunc_begin0
99.quad .Lfunc_end0
100.quad .Lfunc_begin1
101.quad .Lfunc_end1
102.quad .Lfunc_begin2
103.quad .Lfunc_end2
104.quad 0
105.quad 0
106