xref: /llvm-project/llvm/test/tools/llvm-dwarfdump/X86/debug_loc_OP_GNU_entry_value.s (revision a0d45058ebb39dc18cbcdcba01d11d36eca001be)
1# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj | llvm-dwarfdump - | FileCheck %s
2#
3# CHECK: DW_TAG_variable
4# CHECK-NEXT: DW_AT_name ("a")
5# CHECK-NEXT: DW_AT_location
6# CHECK-NEXT: DW_OP_GNU_entry_value(DW_OP_reg5 RDI), DW_OP_stack_value)
7
8	.section	.debug_str,"MS",@progbits,1
9.Linfo_producer:
10	.asciz	"hand-written DWARF"
11.Lname_a:
12	.asciz	"a"
13
14	.section	.debug_loc,"",@progbits
15.Ldebug_loc0:
16	.quad	0
17	.quad	1
18	.short	.Lloc0_end-.Lloc0_start # Loc expr size
19.Lloc0_start:
20	.byte	243                     # DW_OP_GNU_entry_value
21	.byte	1                       # 1
22	.byte	85                      # super-register DW_OP_reg5
23	.byte	159                     # DW_OP_stack_value
24.Lloc0_end:
25	.quad	0
26	.quad	0
27	.section	.debug_abbrev,"",@progbits
28	.byte	1                       # Abbreviation Code
29	.byte	17                      # DW_TAG_compile_unit
30	.byte	1                       # DW_CHILDREN_yes
31	.byte	37                      # DW_AT_producer
32	.byte	14                      # DW_FORM_strp
33	.byte	0                       # EOM(1)
34	.byte	0                       # EOM(2)
35	.byte	5                       # Abbreviation Code
36	.byte	52                      # DW_TAG_variable
37	.byte	0                       # DW_CHILDREN_no
38	.byte	3                       # DW_AT_name
39	.byte	14                      # DW_FORM_strp
40	.byte	2                       # DW_AT_location
41	.byte	23                      # DW_FORM_sec_offset
42	.byte	0                       # EOM(1)
43	.byte	0                       # EOM(2)
44	.byte	0                       # EOM(3)
45
46	.section	.debug_info,"",@progbits
47.Lcu_begin0:
48	.long	.Lcu_end0-.Lcu_start0   # Length of Unit
49.Lcu_start0:
50	.short	4                       # DWARF version number
51	.long	.debug_abbrev           # Offset Into Abbrev. Section
52	.byte	8                       # Address Size (in bytes)
53	.byte	1                       # Abbrev [1] DW_TAG_compile_unit
54	.long	.Linfo_producer         # DW_AT_producer
55	.byte	5                       # Abbrev [5] DW_TAG_variable
56	.long	.Lname_a                # DW_AT_name
57	.long	.Ldebug_loc0            # DW_AT_location
58	.byte	0                       # End Of Children Mark
59.Lcu_end0:
60