string-offsets-form.ll 15 KB

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