xref: /llvm-project/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-wrong-hash.s (revision 2d1fc4375f3885f0ee0ffcb58fc554530cd74ef2)
1906b777aSPavel Labath# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj | \
2906b777aSPavel Labath# RUN:   not llvm-dwarfdump -verify - | FileCheck %s
3906b777aSPavel Labath
4906b777aSPavel Labath# CHECK: Name Index @ 0x0: String (baz) at index 2 hashes to 0xb8860c2, but the Name Index hash is 0xb8860c4
5906b777aSPavel Labath# CHECK: Name Index @ 0x0: Bucket 1 is not empty but points to a mismatched hash value 0xb8860c4 (belonging to bucket 0).
6906b777aSPavel Labath	.section	.debug_str,"MS",@progbits,1
7906b777aSPavel Labath.Lstring_bar:
8906b777aSPavel Labath	.asciz	"bar"
9906b777aSPavel Labath.Lstring_baz:
10906b777aSPavel Labath	.asciz	"baz"
11906b777aSPavel Labath.Lstring_producer:
12906b777aSPavel Labath	.asciz	"Hand-written dwarf"
13906b777aSPavel Labath
14906b777aSPavel Labath	.section	.debug_abbrev,"",@progbits
15906b777aSPavel Labath.Lsection_abbrev:
16906b777aSPavel Labath	.byte	1                       # Abbreviation Code
17906b777aSPavel Labath	.byte	17                      # DW_TAG_compile_unit
18906b777aSPavel Labath	.byte	1                       # DW_CHILDREN_yes
19906b777aSPavel Labath	.byte	37                      # DW_AT_producer
20906b777aSPavel Labath	.byte	14                      # DW_FORM_strp
21906b777aSPavel Labath	.byte	19                      # DW_AT_language
22906b777aSPavel Labath	.byte	5                       # DW_FORM_data2
23906b777aSPavel Labath	.byte	0                       # EOM(1)
24906b777aSPavel Labath	.byte	0                       # EOM(2)
25906b777aSPavel Labath	.byte	2                       # Abbreviation Code
26906b777aSPavel Labath	.byte	46                      # DW_TAG_subprogram
27906b777aSPavel Labath	.byte	0                       # DW_CHILDREN_no
28906b777aSPavel Labath	.byte	3                       # DW_AT_name
29906b777aSPavel Labath	.byte	14                      # DW_FORM_strp
30906b777aSPavel Labath	.byte	63                      # DW_AT_external
31906b777aSPavel Labath	.byte	25                      # DW_FORM_flag_present
32906b777aSPavel Labath	.byte	0                       # EOM(1)
33906b777aSPavel Labath	.byte	0                       # EOM(2)
34906b777aSPavel Labath	.byte	0                       # EOM(3)
35906b777aSPavel Labath
36906b777aSPavel Labath	.section	.debug_info,"",@progbits
37906b777aSPavel Labath.Lcu_begin0:
38906b777aSPavel Labath	.long	.Lcu_end0-.Lcu_start0   # Length of Unit
39906b777aSPavel Labath.Lcu_start0:
40906b777aSPavel Labath	.short	4                       # DWARF version number
41906b777aSPavel Labath	.long	.Lsection_abbrev        # Offset Into Abbrev. Section
42906b777aSPavel Labath	.byte	8                       # Address Size (in bytes)
43906b777aSPavel Labath	.byte	1                       # Abbrev [1] DW_TAG_compile_unit
44906b777aSPavel Labath	.long	.Lstring_producer       # DW_AT_producer
45906b777aSPavel Labath	.short	12                      # DW_AT_language
46906b777aSPavel Labath.Ldie_bar:
47906b777aSPavel Labath	.byte	2                       # Abbrev [2] DW_TAG_subprogram
48906b777aSPavel Labath	.long	.Lstring_bar            # DW_AT_name
49906b777aSPavel Labath                                        # DW_AT_external
50906b777aSPavel Labath.Ldie_baz:
51906b777aSPavel Labath	.byte	2                       # Abbrev [2] DW_TAG_subprogram
52906b777aSPavel Labath	.long	.Lstring_baz            # DW_AT_name
53906b777aSPavel Labath                                        # DW_AT_external
54906b777aSPavel Labath	.byte	0                       # End Of Children Mark
55906b777aSPavel Labath.Lcu_end0:
56906b777aSPavel Labath
57906b777aSPavel Labath	.section	.debug_names,"",@progbits
58906b777aSPavel Labath	.long	.Lnames_end0-.Lnames_start0 # Header: contribution length
59906b777aSPavel Labath.Lnames_start0:
60906b777aSPavel Labath	.short	5                       # Header: version
61906b777aSPavel Labath	.short	0                       # Header: padding
62906b777aSPavel Labath	.long	1                       # Header: compilation unit count
63906b777aSPavel Labath	.long	0                       # Header: local type unit count
64906b777aSPavel Labath	.long	0                       # Header: foreign type unit count
65906b777aSPavel Labath	.long	2                       # Header: bucket count
66906b777aSPavel Labath	.long	2                       # Header: name count
67906b777aSPavel Labath	.long	.Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size
68906b777aSPavel Labath	.long	0                       # Header: augmentation length
69906b777aSPavel Labath	.long	.Lcu_begin0             # Compilation unit 0
70906b777aSPavel Labath	.long	1                       # Bucket 0
71906b777aSPavel Labath	.long	2                       # Bucket 1
72906b777aSPavel Labath	.long	193487034               # Hash in Bucket 1
73906b777aSPavel Labath	.long	193487044               # Hash in Bucket 1 and 2
74906b777aSPavel Labath	.long	.Lstring_bar            # String in Bucket 1: bar
75906b777aSPavel Labath	.long	.Lstring_baz            # String in Bucket 1 and 2: baz
76906b777aSPavel Labath	.long	.Lnames0-.Lnames_entries0 # Offset in Bucket 1
77906b777aSPavel Labath	.long	.Lnames1-.Lnames_entries0 # Offset in Bucket 1 and 2
78906b777aSPavel Labath.Lnames_abbrev_start0:
79906b777aSPavel Labath	.byte	46                      # Abbrev code
80906b777aSPavel Labath	.byte	46                      # DW_TAG_subprogram
81906b777aSPavel Labath	.byte	3                       # DW_IDX_die_offset
82*2d1fc437SPavel Labath	.byte	19                      # DW_FORM_ref4
83906b777aSPavel Labath	.byte	0                       # End of abbrev
84906b777aSPavel Labath	.byte	0                       # End of abbrev
85906b777aSPavel Labath	.byte	0                       # End of abbrev list
86906b777aSPavel Labath.Lnames_abbrev_end0:
87906b777aSPavel Labath.Lnames_entries0:
88906b777aSPavel Labath.Lnames0:
89906b777aSPavel Labath	.byte	46                      # Abbrev code
90906b777aSPavel Labath	.long	.Ldie_bar-.Lcu_begin0   # DW_IDX_die_offset
91906b777aSPavel Labath	.long	0                       # End of list: bar
92906b777aSPavel Labath.Lnames1:
93906b777aSPavel Labath	.byte	46                      # Abbrev code
94906b777aSPavel Labath	.long	.Ldie_baz-.Lcu_begin0   # DW_IDX_die_offset
95906b777aSPavel Labath	.long	0                       # End of list: baz
96906b777aSPavel Labath	.p2align	2
97906b777aSPavel Labath.Lnames_end0:
98