xref: /llvm-project/llvm/test/tools/llvm-dwarfdump/X86/debug-names-multi-find.s (revision 59870af66f015c13105bbb865fb30a5b22e5548b)
1*59870af6SPavel Labath# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj -o %t
2*59870af6SPavel Labath# RUN: llvm-dwarfdump -find=foo - <%t | FileCheck %s
3*59870af6SPavel Labath
4*59870af6SPavel Labath# CHECK: 12: DW_TAG_subprogram
5*59870af6SPavel Labath# CHECK-NEXT: DW_AT_name ("foo")
6*59870af6SPavel Labath# CHECK-NEXT: DW_AT_external
7*59870af6SPavel Labath# CHECK: 17: DW_TAG_subprogram
8*59870af6SPavel Labath# CHECK-NEXT: DW_AT_name ("foo")
9*59870af6SPavel Labath# CHECK-NEXT: DW_AT_external
10*59870af6SPavel Labath
11*59870af6SPavel Labath	.section	.debug_str,"MS",@progbits,1
12*59870af6SPavel Labath.Lstring_foo:
13*59870af6SPavel Labath	.asciz	"foo"
14*59870af6SPavel Labath.Lstring_producer:
15*59870af6SPavel Labath	.asciz	"Hand-written dwarf"
16*59870af6SPavel Labath
17*59870af6SPavel Labath	.section	.debug_abbrev,"",@progbits
18*59870af6SPavel Labath.Lsection_abbrev:
19*59870af6SPavel Labath	.byte	1                       # Abbreviation Code
20*59870af6SPavel Labath	.byte	17                      # DW_TAG_compile_unit
21*59870af6SPavel Labath	.byte	1                       # DW_CHILDREN_yes
22*59870af6SPavel Labath	.byte	37                      # DW_AT_producer
23*59870af6SPavel Labath	.byte	14                      # DW_FORM_strp
24*59870af6SPavel Labath	.byte	19                      # DW_AT_language
25*59870af6SPavel Labath	.byte	5                       # DW_FORM_data2
26*59870af6SPavel Labath	.byte	0                       # EOM(1)
27*59870af6SPavel Labath	.byte	0                       # EOM(2)
28*59870af6SPavel Labath	.byte	2                       # Abbreviation Code
29*59870af6SPavel Labath	.byte	46                      # DW_TAG_subprogram
30*59870af6SPavel Labath	.byte	0                       # DW_CHILDREN_no
31*59870af6SPavel Labath	.byte	3                       # DW_AT_name
32*59870af6SPavel Labath	.byte	14                      # DW_FORM_strp
33*59870af6SPavel Labath	.byte	63                      # DW_AT_external
34*59870af6SPavel Labath	.byte	25                      # DW_FORM_flag_present
35*59870af6SPavel Labath	.byte	0                       # EOM(1)
36*59870af6SPavel Labath	.byte	0                       # EOM(2)
37*59870af6SPavel Labath	.byte	0                       # EOM(3)
38*59870af6SPavel Labath
39*59870af6SPavel Labath	.section	.debug_info,"",@progbits
40*59870af6SPavel Labath.Lcu_begin0:
41*59870af6SPavel Labath	.long	.Lcu_end0-.Lcu_start0   # Length of Unit
42*59870af6SPavel Labath.Lcu_start0:
43*59870af6SPavel Labath	.short	4                       # DWARF version number
44*59870af6SPavel Labath	.long	.Lsection_abbrev        # Offset Into Abbrev. Section
45*59870af6SPavel Labath	.byte	8                       # Address Size (in bytes)
46*59870af6SPavel Labath	.byte	1                       # Abbrev [1] DW_TAG_compile_unit
47*59870af6SPavel Labath	.long	.Lstring_producer       # DW_AT_producer
48*59870af6SPavel Labath	.short	12                      # DW_AT_language
49*59870af6SPavel Labath.Ldie_foo:
50*59870af6SPavel Labath	.byte	2                       # Abbrev [2] DW_TAG_subprogram
51*59870af6SPavel Labath	.long	.Lstring_foo            # DW_AT_name
52*59870af6SPavel Labath                                        # DW_AT_external
53*59870af6SPavel Labath.Ldie_foo2:
54*59870af6SPavel Labath	.byte	2                       # Abbrev [2] DW_TAG_subprogram
55*59870af6SPavel Labath	.long	.Lstring_foo            # DW_AT_name
56*59870af6SPavel Labath                                        # DW_AT_external
57*59870af6SPavel Labath	.byte	0                       # End Of Children Mark
58*59870af6SPavel Labath.Lcu_end0:
59*59870af6SPavel Labath
60*59870af6SPavel Labath	.section	.debug_names,"",@progbits
61*59870af6SPavel Labath	.long	.Lnames_end0-.Lnames_start0 # Header: contribution length
62*59870af6SPavel Labath.Lnames_start0:
63*59870af6SPavel Labath	.short	5                       # Header: version
64*59870af6SPavel Labath	.short	0                       # Header: padding
65*59870af6SPavel Labath	.long	1                       # Header: compilation unit count
66*59870af6SPavel Labath	.long	0                       # Header: local type unit count
67*59870af6SPavel Labath	.long	0                       # Header: foreign type unit count
68*59870af6SPavel Labath	.long	0                       # Header: bucket count
69*59870af6SPavel Labath	.long	1                       # Header: name count
70*59870af6SPavel Labath	.long	.Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size
71*59870af6SPavel Labath	.long	0                       # Header: augmentation length
72*59870af6SPavel Labath	.long	.Lcu_begin0             # Compilation unit 0
73*59870af6SPavel Labath	.long	.Lstring_foo            # String in Bucket 0: foo
74*59870af6SPavel Labath	.long	.Lnames0-.Lnames_entries0 # Offset in Bucket 0
75*59870af6SPavel Labath.Lnames_abbrev_start0:
76*59870af6SPavel Labath	.byte	46                      # Abbrev code
77*59870af6SPavel Labath	.byte	46                      # DW_TAG_subprogram
78*59870af6SPavel Labath	.byte	3                       # DW_IDX_die_offset
79*59870af6SPavel Labath	.byte	19                      # DW_FORM_ref4
80*59870af6SPavel Labath	.byte	0                       # End of abbrev
81*59870af6SPavel Labath	.byte	0                       # End of abbrev
82*59870af6SPavel Labath	.byte	0                       # End of abbrev list
83*59870af6SPavel Labath.Lnames_abbrev_end0:
84*59870af6SPavel Labath.Lnames_entries0:
85*59870af6SPavel Labath.Lnames0:
86*59870af6SPavel Labath	.byte	46                      # Abbrev code
87*59870af6SPavel Labath	.long	.Ldie_foo-.Lcu_begin0   # DW_IDX_die_offset
88*59870af6SPavel Labath	.byte	46                      # Abbrev code
89*59870af6SPavel Labath	.long	.Ldie_foo2-.Lcu_begin0  # DW_IDX_die_offset
90*59870af6SPavel Labath	.long	0                       # End of list: foo
91*59870af6SPavel Labath	.p2align	2
92*59870af6SPavel Labath.Lnames_end0:
93