1# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj | \
2# RUN:   llvm-dwarfdump - | \
3# RUN:   FileCheck %s
4
5# This checks that the operand of DW_OP_call_ref is always parsed corresponding
6# to the DWARF format of CU. Our code used to have an exception for verson == 2,
7# where it treated the operand like it had the size of address, but since
8# DW_OP_call_ref was introduced only in DWARF3, the code could be simplified.
9
10# CHECK: DW_TAG_variable
11# CHECK-NEXT: DW_AT_location (DW_OP_call_ref 0x11223344)
12
13	.section	.debug_abbrev,"",@progbits
14	.byte	1                       # Abbreviation Code
15	.byte	17                      # DW_TAG_compile_unit
16	.byte	1                       # DW_CHILDREN_yes
17	.byte	0                       # EOM(1)
18	.byte	0                       # EOM(2)
19	.byte	5                       # Abbreviation Code
20	.byte	52                      # DW_TAG_variable
21	.byte	0                       # DW_CHILDREN_no
22	.byte	2                       # DW_AT_location
23	.byte	10                      # DW_FORM_block1
24	.byte	0                       # EOM(1)
25	.byte	0                       # EOM(2)
26	.byte	0                       # EOM(3)
27
28	.section	.debug_info,"",@progbits
29	.long	.Lcu_end-.Lcu_start     # Length of Unit
30.Lcu_start:
31	.short	2                       # DWARF version number
32	.long	.debug_abbrev           # Offset Into Abbrev. Section
33	.byte	8                       # Address Size (in bytes)
34	.byte	1                       # Abbrev [1] DW_TAG_compile_unit
35	.byte	5                       # Abbrev [5] DW_TAG_variable
36	.byte	.Lloc_end-.Lloc_begin   # DW_AT_location
37.Lloc_begin:
38	.byte	154                     # DW_OP_call_ref
39	.long	0x11223344              # Offset
40.Lloc_end:
41	.byte	0                       # End Of Children Mark
42.Lcu_end:
43