1# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj | \
2# RUN:   not llvm-dwarfdump -verify - | FileCheck %s
3
4# CHECK: error: Bucket 0 of Name Index @ 0x0 contains invalid value 2. Valid range is [0, 1].
5	.section	.debug_str,"MS",@progbits,1
6.Lstring_foo:
7	.asciz	"foo"
8.Lstring_producer:
9	.asciz	"Hand-written dwarf"
10
11	.section	.debug_abbrev,"",@progbits
12.Lsection_abbrev:
13	.byte	1                       # Abbreviation Code
14	.byte	17                      # DW_TAG_compile_unit
15	.byte	1                       # DW_CHILDREN_yes
16	.byte	37                      # DW_AT_producer
17	.byte	14                      # DW_FORM_strp
18	.byte	19                      # DW_AT_language
19	.byte	5                       # DW_FORM_data2
20	.byte	0                       # EOM(1)
21	.byte	0                       # EOM(2)
22	.byte	2                       # Abbreviation Code
23	.byte	46                      # DW_TAG_subprogram
24	.byte	0                       # DW_CHILDREN_no
25	.byte	3                       # DW_AT_name
26	.byte	14                      # DW_FORM_strp
27	.byte	63                      # DW_AT_external
28	.byte	25                      # DW_FORM_flag_present
29	.byte	0                       # EOM(1)
30	.byte	0                       # EOM(2)
31	.byte	0                       # EOM(3)
32
33	.section	.debug_info,"",@progbits
34.Lcu_begin0:
35	.long	.Lcu_end0-.Lcu_start0   # Length of Unit
36.Lcu_start0:
37	.short	4                       # DWARF version number
38	.long	.Lsection_abbrev        # Offset Into Abbrev. Section
39	.byte	8                       # Address Size (in bytes)
40	.byte	1                       # Abbrev [1] DW_TAG_compile_unit
41	.long	.Lstring_producer       # DW_AT_producer
42	.short	12                      # DW_AT_language
43.Ldie_foo:
44	.byte	2                       # Abbrev [2] DW_TAG_subprogram
45	.long	.Lstring_foo            # DW_AT_name
46                                        # DW_AT_external
47	.byte	0                       # End Of Children Mark
48.Lcu_end0:
49
50	.section	.debug_names,"",@progbits
51	.long	.Lnames_end0-.Lnames_start0 # Header: contribution length
52.Lnames_start0:
53	.short	5                       # Header: version
54	.short	0                       # Header: padding
55	.long	1                       # Header: compilation unit count
56	.long	0                       # Header: local type unit count
57	.long	0                       # Header: foreign type unit count
58	.long	2                       # Header: bucket count
59	.long	1                       # Header: name count
60	.long	.Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size
61	.long	0                       # Header: augmentation length
62	.long	.Lcu_begin0             # Compilation unit 0
63	.long	2                       # Bucket 0
64	.long	1                       # Bucket 1
65	.long	193491849               # Hash in Bucket 1
66	.long	.Lstring_foo            # String in Bucket 1: foo
67	.long	.Lnames0-.Lnames_entries0 # Offset in Bucket 1
68.Lnames_abbrev_start0:
69	.byte	46                      # Abbrev code
70	.byte	46                      # DW_TAG_subprogram
71	.byte	3                       # DW_IDX_die_offset
72	.byte	19                      # DW_FORM_ref4
73	.byte	0                       # End of abbrev
74	.byte	0                       # End of abbrev
75	.byte	0                       # End of abbrev list
76.Lnames_abbrev_end0:
77.Lnames_entries0:
78.Lnames0:
79	.byte	46                      # Abbrev code
80	.long	.Ldie_foo-.Lcu_begin0   # DW_IDX_die_offset
81	.long	0                       # End of list: foo
82	.p2align	2
83.Lnames_end0:
84