xref: /llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/dwarf5-implicit-const.s (revision 8a64d80a959bf2844df33f9112e456f33de7b468)
1# Test handling of DWARF5 DW_FORM_implicit_const as used by GCC.
2
3# RUN: llvm-mc -filetype=obj -o %t -triple x86_64-pc-linux %s
4# RUN: %lldb %t -o "expression -T -- variable_implicit_const" \
5# RUN:   -o exit | FileCheck %s
6
7# Failing case was:
8# error: need to add support for DW_TAG_base_type 'int' encoded with DW_ATE = 0x5, bit_size = 0
9# CHECK: (int) $0 = 0
10
11	.bss
12	.globl	variable_implicit_const
13	.type	variable_implicit_const, @object
14	.size	variable_implicit_const, 4
15variable_implicit_const:
16	.long	0
17.Lvariable_implicit_const_end:
18	.section	.debug_info,"",@progbits
19.Ldebug_info0:
20	.long	.Ldebug_info0_end - .Ldebug_info0_start	# Length of Compilation Unit Info
21.Ldebug_info0_start:
22	.value	0x5	# DWARF version number
23	.byte	0x1	# DW_UT_compile
24	.byte	0x8	# Pointer Size (in bytes)
25	.long	.Ldebug_abbrev0	# Offset Into Abbrev. Section
26	.uleb128 0x1	# (DIE DW_TAG_compile_unit)
27			# DW_AT_producer
28	.string	"GNU C17 11.0.0 20210210 (Red Hat 11.0.0-0) -mtune=generic -march=x86-64 -g"
29	.byte	0x1d	# DW_AT_language
30			# DW_AT_name
31	.string	"var4.c"
32	.uleb128 0x2	# (DIE DW_TAG_variable)
33			# DW_AT_name
34	.string	"variable_implicit_const"
35	.long	.Ltype_int - .Ldebug_info0	# DW_AT_type
36			# DW_AT_external
37	.uleb128 0x9	# DW_AT_location
38	.byte	0x3	# DW_OP_addr
39	.quad	variable_implicit_const
40.Ltype_int:
41	.uleb128 0x3	# (DIE DW_TAG_base_type)
42			# DW_AT_byte_size
43	.byte	0x5	# DW_AT_encoding
44	.ascii "int\0"	# DW_AT_name
45	.byte	0	# end of children of DIE DW_TAG_compile_unit
46.Ldebug_info0_end:
47	.section	.debug_abbrev,"",@progbits
48.Ldebug_abbrev0:
49	.uleb128 0x1	# (abbrev code)
50	.uleb128 0x11	# (TAG: DW_TAG_compile_unit)
51	.byte	0x1	# DW_children_yes
52	.uleb128 0x25	# (DW_AT_producer)
53	.uleb128 0x8	# (DW_FORM_string)
54	.uleb128 0x13	# (DW_AT_language)
55	.uleb128 0xb	# (DW_FORM_data1)
56	.uleb128 0x3	# (DW_AT_name)
57	.uleb128 0x8	# (DW_FORM_string)
58	.byte	0
59	.byte	0
60	.uleb128 0x2	# (abbrev code)
61	.uleb128 0x34	# (TAG: DW_TAG_variable)
62	.byte	0	# DW_children_no
63	.uleb128 0x3	# (DW_AT_name)
64	.uleb128 0x8	# (DW_FORM_string)
65	.uleb128 0x49	# (DW_AT_type)
66	.uleb128 0x13	# (DW_FORM_ref4)
67	.uleb128 0x3f	# (DW_AT_external)
68	.uleb128 0x19	# (DW_FORM_flag_present)
69	.uleb128 0x2	# (DW_AT_location)
70	.uleb128 0x18	# (DW_FORM_exprloc)
71	.byte	0
72	.byte	0
73	.uleb128 0x3	# (abbrev code)
74	.uleb128 0x24	# (TAG: DW_TAG_base_type)
75	.byte	0	# DW_children_no
76	.uleb128 0xb	# (DW_AT_byte_size)
77	.uleb128 0x21	# (DW_FORM_implicit_const)
78	.sleb128 .Lvariable_implicit_const_end - variable_implicit_const
79	.uleb128 0x3e	# (DW_AT_encoding)
80	.uleb128 0xb	# (DW_FORM_data1)
81	.uleb128 0x3	# (DW_AT_name)
82	.uleb128 0x8	# (DW_FORM_string)
83	.byte	0
84	.byte	0
85	.byte	0
86