• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -dwarf-version=5 -o %t.o
2# RUN: llvm-dwarfdump %t.o | FileCheck %s
3# RUN: llvm-dwarfdump -verify %t.o
4
5# CHECK: DW_AT_location  (DW_OP_constu 0x7b, DW_OP_convert 0x0, DW_OP_stack_value)
6
7	.text
8	.file	"const.ll"
9	.globl	foo                     # -- Begin function foo
10	.p2align	4, 0x90
11	.type	foo,@function
12foo:                                    # @foo
13.Lfoo$local:
14.Lfunc_begin0:
15	.file	0 "/const.c"
16	.loc	0 1 0                   # const.c:1:0
17	.cfi_startproc
18# %bb.0:                                # %entry
19	.loc	0 3 1 prologue_end      # const.c:3:1
20	retq
21.Ltmp0:
22.Lfunc_end0:
23	.size	foo, .Lfunc_end0-foo
24	.cfi_endproc
25                                        # -- End function
26	.section	.debug_abbrev,"",@progbits
27	.byte	1                       # Abbreviation Code
28	.byte	17                      # DW_TAG_compile_unit
29	.byte	1                       # DW_CHILDREN_yes
30	.byte	37                      # DW_AT_producer
31	.byte	37                      # DW_FORM_strx1
32	.byte	19                      # DW_AT_language
33	.byte	5                       # DW_FORM_data2
34	.byte	3                       # DW_AT_name
35	.byte	37                      # DW_FORM_strx1
36	.byte	114                     # DW_AT_str_offsets_base
37	.byte	23                      # DW_FORM_sec_offset
38	.byte	16                      # DW_AT_stmt_list
39	.byte	23                      # DW_FORM_sec_offset
40	.byte	27                      # DW_AT_comp_dir
41	.byte	37                      # DW_FORM_strx1
42	.byte	17                      # DW_AT_low_pc
43	.byte	27                      # DW_FORM_addrx
44	.byte	18                      # DW_AT_high_pc
45	.byte	6                       # DW_FORM_data4
46	.byte	115                     # DW_AT_addr_base
47	.byte	23                      # DW_FORM_sec_offset
48	.byte	0                       # EOM(1)
49	.byte	0                       # EOM(2)
50	.byte	2                       # Abbreviation Code
51	.byte	46                      # DW_TAG_subprogram
52	.byte	1                       # DW_CHILDREN_yes
53	.byte	17                      # DW_AT_low_pc
54	.byte	27                      # DW_FORM_addrx
55	.byte	18                      # DW_AT_high_pc
56	.byte	6                       # DW_FORM_data4
57	.byte	64                      # DW_AT_frame_base
58	.byte	24                      # DW_FORM_exprloc
59	.byte	122                     # DW_AT_call_all_calls
60	.byte	25                      # DW_FORM_flag_present
61	.byte	3                       # DW_AT_name
62	.byte	37                      # DW_FORM_strx1
63	.byte	58                      # DW_AT_decl_file
64	.byte	11                      # DW_FORM_data1
65	.byte	59                      # DW_AT_decl_line
66	.byte	11                      # DW_FORM_data1
67	.byte	63                      # DW_AT_external
68	.byte	25                      # DW_FORM_flag_present
69	.byte	0                       # EOM(1)
70	.byte	0                       # EOM(2)
71	.byte	3                       # Abbreviation Code
72	.byte	52                      # DW_TAG_variable
73	.byte	0                       # DW_CHILDREN_no
74	.byte	2                       # DW_AT_location
75	.byte	24                      # DW_FORM_exprloc
76	.byte	3                       # DW_AT_name
77	.byte	37                      # DW_FORM_strx1
78	.byte	58                      # DW_AT_decl_file
79	.byte	11                      # DW_FORM_data1
80	.byte	59                      # DW_AT_decl_line
81	.byte	11                      # DW_FORM_data1
82	.byte	73                      # DW_AT_type
83	.byte	19                      # DW_FORM_ref4
84	.byte	0                       # EOM(1)
85	.byte	0                       # EOM(2)
86	.byte	4                       # Abbreviation Code
87	.byte	36                      # DW_TAG_base_type
88	.byte	0                       # DW_CHILDREN_no
89	.byte	3                       # DW_AT_name
90	.byte	37                      # DW_FORM_strx1
91	.byte	62                      # DW_AT_encoding
92	.byte	11                      # DW_FORM_data1
93	.byte	11                      # DW_AT_byte_size
94	.byte	11                      # DW_FORM_data1
95	.byte	0                       # EOM(1)
96	.byte	0                       # EOM(2)
97	.byte	0                       # EOM(3)
98	.section	.debug_info,"",@progbits
99.Lcu_begin0:
100	.long	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
101.Ldebug_info_start0:
102	.short	5                       # DWARF version number
103	.byte	1                       # DWARF Unit Type
104	.byte	8                       # Address Size (in bytes)
105	.long	.debug_abbrev           # Offset Into Abbrev. Section
106	.byte	1                       # Abbrev [1] 0xc:0x36 DW_TAG_compile_unit
107	.byte	0                       # DW_AT_producer
108	.short	12                      # DW_AT_language
109	.byte	1                       # DW_AT_name
110	.long	.Lstr_offsets_base0     # DW_AT_str_offsets_base
111	.long	.Lline_table_start0     # DW_AT_stmt_list
112	.byte	2                       # DW_AT_comp_dir
113	.byte	0                       # DW_AT_low_pc
114	.long	.Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
115	.long	.Laddr_table_base0      # DW_AT_addr_base
116	.byte	2                       # Abbrev [2] 0x23:0x1a DW_TAG_subprogram
117	.byte	0                       # DW_AT_low_pc
118	.long	.Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
119	.byte	1                       # DW_AT_frame_base
120	.byte	87
121                                        # DW_AT_call_all_calls
122	.byte	3                       # DW_AT_name
123	.byte	0                       # DW_AT_decl_file
124	.byte	1                       # DW_AT_decl_line
125                                        # DW_AT_external
126	.byte	3                       # Abbrev [3] 0x2e:0xe DW_TAG_variable
127	.byte	5                       # DW_AT_location
128	.byte	16
129	.byte	123
130	.byte	168
131	.byte	0
132	.byte	159
133	.byte	4                       # DW_AT_name
134	.byte	0                       # DW_AT_decl_file
135	.byte	2                       # DW_AT_decl_line
136	.long	61                      # DW_AT_type
137	.byte	0                       # End Of Children Mark
138	.byte	4                       # Abbrev [4] 0x3d:0x4 DW_TAG_base_type
139	.byte	5                       # DW_AT_name
140	.byte	5                       # DW_AT_encoding
141	.byte	4                       # DW_AT_byte_size
142	.byte	0                       # End Of Children Mark
143.Ldebug_info_end0:
144	.section	.debug_str_offsets,"",@progbits
145	.long	28
146	.short	5
147	.short	0
148.Lstr_offsets_base0:
149	.section	.debug_str,"MS",@progbits,1
150.Linfo_string0:
151	.asciz	"clang version 11.0.0"  # string offset=0
152.Linfo_string1:
153	.asciz	"const.c"               # string offset=21
154.Linfo_string2:
155	.asciz	"/"                     # string offset=29
156.Linfo_string3:
157	.asciz	"foo"                   # string offset=31
158.Linfo_string4:
159	.asciz	"local"                 # string offset=35
160.Linfo_string5:
161	.asciz	"int"                   # string offset=41
162	.section	.debug_str_offsets,"",@progbits
163	.long	.Linfo_string0
164	.long	.Linfo_string1
165	.long	.Linfo_string2
166	.long	.Linfo_string3
167	.long	.Linfo_string4
168	.long	.Linfo_string5
169	.section	.debug_addr,"",@progbits
170	.long	.Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
171.Ldebug_addr_start0:
172	.short	5                       # DWARF version number
173	.byte	8                       # Address size
174	.byte	0                       # Segment selector size
175.Laddr_table_base0:
176	.quad	.Lfunc_begin0
177.Ldebug_addr_end0:
178	.ident	"clang version 11.0.0"
179	.section	".note.GNU-stack","",@progbits
180	.section	.debug_line,"",@progbits
181.Lline_table_start0:
182