1; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -all -show-form -v - \
2; RUN:   | FileCheck %s
3;
4; Generated from the following source with clang -S -emit-llvm -gdwarf-5.
5;
6; enum E {
7;  econst1,
8;  econst2,
9;  ...
10;  econst254
11; } glob;
12;
13; This test verifies that we generate DW_FORM_strx2 for indexed strings properly.
14; Check that the first usage of DW_FORM_strx2 is with index 256.
15;
16; CHECK:     .debug_info contents:
17; CHECK-NOT: DW_FORM_strx2
18; CHECK:     DW_AT_name [DW_FORM_strx2] (indexed (00000100) string =
19
20; ModuleID = 'enum.cpp'
21source_filename = "enum.cpp"
22
23@glob = global i32 0, align 4, !dbg !0
24
25!llvm.dbg.cu = !{!2}
26!llvm.module.flags = !{!260, !261, !262}
27!llvm.ident = !{!263}
28
29!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
30!1 = distinct !DIGlobalVariable(name: "glob", scope: !2, file: !3, line: 255, type: !5, isLocal: false, isDefinition: true)
31!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 7.0.0 (trunk 322415)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !259)
32!3 = !DIFile(filename: "enum.cpp", directory: "/home/test", checksumkind: CSK_MD5, checksum: "8965080a8027790e641e30c7762c53a0")
33!4 = !{!5}
34!5 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "E", file: !3, line: 1, size: 32, elements: !6, identifier: "_ZTS1E")
35!6 = !{!7, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30, !31, !32, !33, !34, !35, !36, !37, !38, !39, !40, !41, !42, !43, !44, !45, !46, !47, !48, !49, !50, !51, !52, !53, !54, !55, !56, !57, !58, !59, !60, !61, !62, !63, !64, !65, !66, !67, !68, !69, !70, !71, !72, !73, !74, !75, !76, !77, !78, !79, !80, !81, !82, !83, !84, !85, !86, !87, !88, !89, !90, !91, !92, !93, !94, !95, !96, !97, !98, !99, !100, !101, !102, !103, !104, !105, !106, !107, !108, !109, !110, !111, !112, !113, !114, !115, !116, !117, !118, !119, !120, !121, !122, !123, !124, !125, !126, !127, !128, !129, !130, !131, !132, !133, !134, !135, !136, !137, !138, !139, !140, !141, !142, !143, !144, !145, !146, !147, !148, !149, !150, !151, !152, !153, !154, !155, !156, !157, !158, !159, !160, !161, !162, !163, !164, !165, !166, !167, !168, !169, !170, !171, !172, !173, !174, !175, !176, !177, !178, !179, !180, !181, !182, !183, !184, !185, !186, !187, !188, !189, !190, !191, !192, !193, !194, !195, !196, !197, !198, !199, !200, !201, !202, !203, !204, !205, !206, !207, !208, !209, !210, !211, !212, !213, !214, !215, !216, !217, !218, !219, !220, !221, !222, !223, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249, !250, !251, !252, !253, !254, !255, !256, !257, !258}
36!7 = !DIEnumerator(name: "econst1", value: 0)
37!8 = !DIEnumerator(name: "econst2", value: 1)
38!9 = !DIEnumerator(name: "econst3", value: 2)
39!10 = !DIEnumerator(name: "econst4", value: 3)
40!11 = !DIEnumerator(name: "econst5", value: 4)
41!12 = !DIEnumerator(name: "econst6", value: 5)
42!13 = !DIEnumerator(name: "econst7", value: 6)
43!14 = !DIEnumerator(name: "econst8", value: 7)
44!15 = !DIEnumerator(name: "econst9", value: 8)
45!16 = !DIEnumerator(name: "econst10", value: 9)
46!17 = !DIEnumerator(name: "econst11", value: 10)
47!18 = !DIEnumerator(name: "econst12", value: 11)
48!19 = !DIEnumerator(name: "econst13", value: 12)
49!20 = !DIEnumerator(name: "econst14", value: 13)
50!21 = !DIEnumerator(name: "econst15", value: 14)
51!22 = !DIEnumerator(name: "econst16", value: 15)
52!23 = !DIEnumerator(name: "econst17", value: 16)
53!24 = !DIEnumerator(name: "econst18", value: 17)
54!25 = !DIEnumerator(name: "econst19", value: 18)
55!26 = !DIEnumerator(name: "econst20", value: 19)
56!27 = !DIEnumerator(name: "econst21", value: 20)
57!28 = !DIEnumerator(name: "econst22", value: 21)
58!29 = !DIEnumerator(name: "econst23", value: 22)
59!30 = !DIEnumerator(name: "econst24", value: 23)
60!31 = !DIEnumerator(name: "econst25", value: 24)
61!32 = !DIEnumerator(name: "econst26", value: 25)
62!33 = !DIEnumerator(name: "econst27", value: 26)
63!34 = !DIEnumerator(name: "econst28", value: 27)
64!35 = !DIEnumerator(name: "econst29", value: 28)
65!36 = !DIEnumerator(name: "econst30", value: 29)
66!37 = !DIEnumerator(name: "econst31", value: 30)
67!38 = !DIEnumerator(name: "econst32", value: 31)
68!39 = !DIEnumerator(name: "econst33", value: 32)
69!40 = !DIEnumerator(name: "econst34", value: 33)
70!41 = !DIEnumerator(name: "econst35", value: 34)
71!42 = !DIEnumerator(name: "econst36", value: 35)
72!43 = !DIEnumerator(name: "econst37", value: 36)
73!44 = !DIEnumerator(name: "econst38", value: 37)
74!45 = !DIEnumerator(name: "econst39", value: 38)
75!46 = !DIEnumerator(name: "econst40", value: 39)
76!47 = !DIEnumerator(name: "econst41", value: 40)
77!48 = !DIEnumerator(name: "econst42", value: 41)
78!49 = !DIEnumerator(name: "econst43", value: 42)
79!50 = !DIEnumerator(name: "econst44", value: 43)
80!51 = !DIEnumerator(name: "econst45", value: 44)
81!52 = !DIEnumerator(name: "econst46", value: 45)
82!53 = !DIEnumerator(name: "econst47", value: 46)
83!54 = !DIEnumerator(name: "econst48", value: 47)
84!55 = !DIEnumerator(name: "econst49", value: 48)
85!56 = !DIEnumerator(name: "econst50", value: 49)
86!57 = !DIEnumerator(name: "econst51", value: 50)
87!58 = !DIEnumerator(name: "econst52", value: 51)
88!59 = !DIEnumerator(name: "econst53", value: 52)
89!60 = !DIEnumerator(name: "econst54", value: 53)
90!61 = !DIEnumerator(name: "econst55", value: 54)
91!62 = !DIEnumerator(name: "econst56", value: 55)
92!63 = !DIEnumerator(name: "econst57", value: 56)
93!64 = !DIEnumerator(name: "econst58", value: 57)
94!65 = !DIEnumerator(name: "econst59", value: 58)
95!66 = !DIEnumerator(name: "econst60", value: 59)
96!67 = !DIEnumerator(name: "econst61", value: 60)
97!68 = !DIEnumerator(name: "econst62", value: 61)
98!69 = !DIEnumerator(name: "econst63", value: 62)
99!70 = !DIEnumerator(name: "econst64", value: 63)
100!71 = !DIEnumerator(name: "econst65", value: 64)
101!72 = !DIEnumerator(name: "econst66", value: 65)
102!73 = !DIEnumerator(name: "econst67", value: 66)
103!74 = !DIEnumerator(name: "econst68", value: 67)
104!75 = !DIEnumerator(name: "econst69", value: 68)
105!76 = !DIEnumerator(name: "econst70", value: 69)
106!77 = !DIEnumerator(name: "econst71", value: 70)
107!78 = !DIEnumerator(name: "econst72", value: 71)
108!79 = !DIEnumerator(name: "econst73", value: 72)
109!80 = !DIEnumerator(name: "econst74", value: 73)
110!81 = !DIEnumerator(name: "econst75", value: 74)
111!82 = !DIEnumerator(name: "econst76", value: 75)
112!83 = !DIEnumerator(name: "econst77", value: 76)
113!84 = !DIEnumerator(name: "econst78", value: 77)
114!85 = !DIEnumerator(name: "econst79", value: 78)
115!86 = !DIEnumerator(name: "econst80", value: 79)
116!87 = !DIEnumerator(name: "econst81", value: 80)
117!88 = !DIEnumerator(name: "econst82", value: 81)
118!89 = !DIEnumerator(name: "econst83", value: 82)
119!90 = !DIEnumerator(name: "econst84", value: 83)
120!91 = !DIEnumerator(name: "econst85", value: 84)
121!92 = !DIEnumerator(name: "econst86", value: 85)
122!93 = !DIEnumerator(name: "econst87", value: 86)
123!94 = !DIEnumerator(name: "econst88", value: 87)
124!95 = !DIEnumerator(name: "econst89", value: 88)
125!96 = !DIEnumerator(name: "econst90", value: 89)
126!97 = !DIEnumerator(name: "econst91", value: 90)
127!98 = !DIEnumerator(name: "econst92", value: 91)
128!99 = !DIEnumerator(name: "econst93", value: 92)
129!100 = !DIEnumerator(name: "econst94", value: 93)
130!101 = !DIEnumerator(name: "econst95", value: 94)
131!102 = !DIEnumerator(name: "econst96", value: 95)
132!103 = !DIEnumerator(name: "econst97", value: 96)
133!104 = !DIEnumerator(name: "econst98", value: 97)
134!105 = !DIEnumerator(name: "econst99", value: 98)
135!106 = !DIEnumerator(name: "econst100", value: 99)
136!107 = !DIEnumerator(name: "econst101", value: 100)
137!108 = !DIEnumerator(name: "econst102", value: 101)
138!109 = !DIEnumerator(name: "econst103", value: 102)
139!110 = !DIEnumerator(name: "econst104", value: 103)
140!111 = !DIEnumerator(name: "econst105", value: 104)
141!112 = !DIEnumerator(name: "econst106", value: 105)
142!113 = !DIEnumerator(name: "econst107", value: 106)
143!114 = !DIEnumerator(name: "econst108", value: 107)
144!115 = !DIEnumerator(name: "econst109", value: 108)
145!116 = !DIEnumerator(name: "econst110", value: 109)
146!117 = !DIEnumerator(name: "econst111", value: 110)
147!118 = !DIEnumerator(name: "econst112", value: 111)
148!119 = !DIEnumerator(name: "econst113", value: 112)
149!120 = !DIEnumerator(name: "econst114", value: 113)
150!121 = !DIEnumerator(name: "econst115", value: 114)
151!122 = !DIEnumerator(name: "econst116", value: 115)
152!123 = !DIEnumerator(name: "econst117", value: 116)
153!124 = !DIEnumerator(name: "econst118", value: 117)
154!125 = !DIEnumerator(name: "econst119", value: 118)
155!126 = !DIEnumerator(name: "econst120", value: 119)
156!127 = !DIEnumerator(name: "econst121", value: 120)
157!128 = !DIEnumerator(name: "econst122", value: 121)
158!129 = !DIEnumerator(name: "econst123", value: 122)
159!130 = !DIEnumerator(name: "econst124", value: 123)
160!131 = !DIEnumerator(name: "econst125", value: 124)
161!132 = !DIEnumerator(name: "econst126", value: 125)
162!133 = !DIEnumerator(name: "econst127", value: 126)
163!134 = !DIEnumerator(name: "econst128", value: 127)
164!135 = !DIEnumerator(name: "econst129", value: 128)
165!136 = !DIEnumerator(name: "econst130", value: 129)
166!137 = !DIEnumerator(name: "econst131", value: 130)
167!138 = !DIEnumerator(name: "econst132", value: 131)
168!139 = !DIEnumerator(name: "econst133", value: 132)
169!140 = !DIEnumerator(name: "econst134", value: 133)
170!141 = !DIEnumerator(name: "econst135", value: 134)
171!142 = !DIEnumerator(name: "econst136", value: 135)
172!143 = !DIEnumerator(name: "econst137", value: 136)
173!144 = !DIEnumerator(name: "econst138", value: 137)
174!145 = !DIEnumerator(name: "econst139", value: 138)
175!146 = !DIEnumerator(name: "econst140", value: 139)
176!147 = !DIEnumerator(name: "econst141", value: 140)
177!148 = !DIEnumerator(name: "econst142", value: 141)
178!149 = !DIEnumerator(name: "econst143", value: 142)
179!150 = !DIEnumerator(name: "econst144", value: 143)
180!151 = !DIEnumerator(name: "econst145", value: 144)
181!152 = !DIEnumerator(name: "econst146", value: 145)
182!153 = !DIEnumerator(name: "econst147", value: 146)
183!154 = !DIEnumerator(name: "econst148", value: 147)
184!155 = !DIEnumerator(name: "econst149", value: 148)
185!156 = !DIEnumerator(name: "econst150", value: 149)
186!157 = !DIEnumerator(name: "econst151", value: 150)
187!158 = !DIEnumerator(name: "econst152", value: 151)
188!159 = !DIEnumerator(name: "econst153", value: 152)
189!160 = !DIEnumerator(name: "econst154", value: 153)
190!161 = !DIEnumerator(name: "econst155", value: 154)
191!162 = !DIEnumerator(name: "econst156", value: 155)
192!163 = !DIEnumerator(name: "econst157", value: 156)
193!164 = !DIEnumerator(name: "econst158", value: 157)
194!165 = !DIEnumerator(name: "econst159", value: 158)
195!166 = !DIEnumerator(name: "econst160", value: 159)
196!167 = !DIEnumerator(name: "econst161", value: 160)
197!168 = !DIEnumerator(name: "econst162", value: 161)
198!169 = !DIEnumerator(name: "econst163", value: 162)
199!170 = !DIEnumerator(name: "econst164", value: 163)
200!171 = !DIEnumerator(name: "econst165", value: 164)
201!172 = !DIEnumerator(name: "econst166", value: 165)
202!173 = !DIEnumerator(name: "econst167", value: 166)
203!174 = !DIEnumerator(name: "econst168", value: 167)
204!175 = !DIEnumerator(name: "econst169", value: 168)
205!176 = !DIEnumerator(name: "econst170", value: 169)
206!177 = !DIEnumerator(name: "econst171", value: 170)
207!178 = !DIEnumerator(name: "econst172", value: 171)
208!179 = !DIEnumerator(name: "econst173", value: 172)
209!180 = !DIEnumerator(name: "econst174", value: 173)
210!181 = !DIEnumerator(name: "econst175", value: 174)
211!182 = !DIEnumerator(name: "econst176", value: 175)
212!183 = !DIEnumerator(name: "econst177", value: 176)
213!184 = !DIEnumerator(name: "econst178", value: 177)
214!185 = !DIEnumerator(name: "econst179", value: 178)
215!186 = !DIEnumerator(name: "econst180", value: 179)
216!187 = !DIEnumerator(name: "econst181", value: 180)
217!188 = !DIEnumerator(name: "econst182", value: 181)
218!189 = !DIEnumerator(name: "econst183", value: 182)
219!190 = !DIEnumerator(name: "econst184", value: 183)
220!191 = !DIEnumerator(name: "econst185", value: 184)
221!192 = !DIEnumerator(name: "econst186", value: 185)
222!193 = !DIEnumerator(name: "econst187", value: 186)
223!194 = !DIEnumerator(name: "econst188", value: 187)
224!195 = !DIEnumerator(name: "econst189", value: 188)
225!196 = !DIEnumerator(name: "econst190", value: 189)
226!197 = !DIEnumerator(name: "econst191", value: 190)
227!198 = !DIEnumerator(name: "econst192", value: 191)
228!199 = !DIEnumerator(name: "econst193", value: 192)
229!200 = !DIEnumerator(name: "econst194", value: 193)
230!201 = !DIEnumerator(name: "econst195", value: 194)
231!202 = !DIEnumerator(name: "econst196", value: 195)
232!203 = !DIEnumerator(name: "econst197", value: 196)
233!204 = !DIEnumerator(name: "econst198", value: 197)
234!205 = !DIEnumerator(name: "econst199", value: 198)
235!206 = !DIEnumerator(name: "econst200", value: 199)
236!207 = !DIEnumerator(name: "econst201", value: 200)
237!208 = !DIEnumerator(name: "econst202", value: 201)
238!209 = !DIEnumerator(name: "econst203", value: 202)
239!210 = !DIEnumerator(name: "econst204", value: 203)
240!211 = !DIEnumerator(name: "econst205", value: 204)
241!212 = !DIEnumerator(name: "econst206", value: 205)
242!213 = !DIEnumerator(name: "econst207", value: 206)
243!214 = !DIEnumerator(name: "econst208", value: 207)
244!215 = !DIEnumerator(name: "econst209", value: 208)
245!216 = !DIEnumerator(name: "econst210", value: 209)
246!217 = !DIEnumerator(name: "econst211", value: 210)
247!218 = !DIEnumerator(name: "econst212", value: 211)
248!219 = !DIEnumerator(name: "econst213", value: 212)
249!220 = !DIEnumerator(name: "econst214", value: 213)
250!221 = !DIEnumerator(name: "econst215", value: 214)
251!222 = !DIEnumerator(name: "econst216", value: 215)
252!223 = !DIEnumerator(name: "econst217", value: 216)
253!224 = !DIEnumerator(name: "econst218", value: 217)
254!225 = !DIEnumerator(name: "econst219", value: 218)
255!226 = !DIEnumerator(name: "econst220", value: 219)
256!227 = !DIEnumerator(name: "econst221", value: 220)
257!228 = !DIEnumerator(name: "econst222", value: 221)
258!229 = !DIEnumerator(name: "econst223", value: 222)
259!230 = !DIEnumerator(name: "econst224", value: 223)
260!231 = !DIEnumerator(name: "econst225", value: 224)
261!232 = !DIEnumerator(name: "econst226", value: 225)
262!233 = !DIEnumerator(name: "econst227", value: 226)
263!234 = !DIEnumerator(name: "econst228", value: 227)
264!235 = !DIEnumerator(name: "econst229", value: 228)
265!236 = !DIEnumerator(name: "econst230", value: 229)
266!237 = !DIEnumerator(name: "econst231", value: 230)
267!238 = !DIEnumerator(name: "econst232", value: 231)
268!239 = !DIEnumerator(name: "econst233", value: 232)
269!240 = !DIEnumerator(name: "econst234", value: 233)
270!241 = !DIEnumerator(name: "econst235", value: 234)
271!242 = !DIEnumerator(name: "econst236", value: 235)
272!243 = !DIEnumerator(name: "econst237", value: 236)
273!244 = !DIEnumerator(name: "econst238", value: 237)
274!245 = !DIEnumerator(name: "econst239", value: 238)
275!246 = !DIEnumerator(name: "econst240", value: 239)
276!247 = !DIEnumerator(name: "econst241", value: 240)
277!248 = !DIEnumerator(name: "econst242", value: 241)
278!249 = !DIEnumerator(name: "econst243", value: 242)
279!250 = !DIEnumerator(name: "econst244", value: 243)
280!251 = !DIEnumerator(name: "econst245", value: 244)
281!252 = !DIEnumerator(name: "econst246", value: 245)
282!253 = !DIEnumerator(name: "econst247", value: 246)
283!254 = !DIEnumerator(name: "econst248", value: 247)
284!255 = !DIEnumerator(name: "econst249", value: 248)
285!256 = !DIEnumerator(name: "econst250", value: 249)
286!257 = !DIEnumerator(name: "econst251", value: 250)
287!258 = !DIEnumerator(name: "econst252", value: 251)
288!259 = !{!0}
289!260 = !{i32 2, !"Dwarf Version", i32 5}
290!261 = !{i32 2, !"Debug Info Version", i32 3}
291!262 = !{i32 1, !"wchar_size", i32 4}
292!263 = !{!"clang version 7.0.0 (trunk 322415)"}
293