break_continue.carbon 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon
  6. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/for/break_continue.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/for/break_continue.carbon
  12. import Core library "range";
  13. fn F() -> bool;
  14. fn G() -> bool;
  15. fn H();
  16. fn For() {
  17. for (n: i32 in Core.Range(100)) {
  18. if (F()) { break; }
  19. if (G()) { continue; }
  20. H();
  21. }
  22. }
  23. // CHECK:STDOUT: ; ModuleID = 'break_continue.carbon'
  24. // CHECK:STDOUT: source_filename = "break_continue.carbon"
  25. // CHECK:STDOUT:
  26. // CHECK:STDOUT: declare i1 @_CF.Main()
  27. // CHECK:STDOUT:
  28. // CHECK:STDOUT: declare i1 @_CG.Main()
  29. // CHECK:STDOUT:
  30. // CHECK:STDOUT: declare void @_CH.Main()
  31. // CHECK:STDOUT:
  32. // CHECK:STDOUT: ; Function Attrs: nounwind
  33. // CHECK:STDOUT: define void @_CFor.Main() #0 !dbg !4 {
  34. // CHECK:STDOUT: entry:
  35. // CHECK:STDOUT: %.loc20_32.1.temp = alloca { i32, i32 }, align 8, !dbg !7
  36. // CHECK:STDOUT: %var = alloca i32, align 4, !dbg !8
  37. // CHECK:STDOUT: %.loc20_33.1.temp = alloca { i32, i1 }, align 8, !dbg !8
  38. // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_32.1.temp), !dbg !7
  39. // CHECK:STDOUT: call void @_CRange.Core(ptr %.loc20_32.1.temp, i32 100), !dbg !7
  40. // CHECK:STDOUT: %IntRange.as.Iterate.impl.NewCursor.call = call i32 @"_CNewCursor.IntRange.Core:Iterate.Core.be1e879c1ad406d8"(ptr %.loc20_32.1.temp), !dbg !8
  41. // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %var), !dbg !8
  42. // CHECK:STDOUT: store i32 %IntRange.as.Iterate.impl.NewCursor.call, ptr %var, align 4, !dbg !8
  43. // CHECK:STDOUT: br label %for.next, !dbg !8
  44. // CHECK:STDOUT:
  45. // CHECK:STDOUT: for.next: ; preds = %if.else.loc22, %if.then.loc22, %entry
  46. // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_33.1.temp), !dbg !8
  47. // CHECK:STDOUT: call void @"_CNext.IntRange.Core:Iterate.Core.be1e879c1ad406d8"(ptr %.loc20_33.1.temp, ptr %.loc20_32.1.temp, ptr %var), !dbg !8
  48. // CHECK:STDOUT: %Optional.HasValue.call = call i1 @_CHasValue.Optional.Core.e41cc9bfe4f9d0c5(ptr %.loc20_33.1.temp), !dbg !8
  49. // CHECK:STDOUT: br i1 %Optional.HasValue.call, label %for.body, label %for.done, !dbg !8
  50. // CHECK:STDOUT:
  51. // CHECK:STDOUT: for.body: ; preds = %for.next
  52. // CHECK:STDOUT: %Optional.Get.call = call i32 @_CGet.Optional.Core.e41cc9bfe4f9d0c5(ptr %.loc20_33.1.temp), !dbg !8
  53. // CHECK:STDOUT: %F.call = call i1 @_CF.Main(), !dbg !9
  54. // CHECK:STDOUT: br i1 %F.call, label %if.then.loc21, label %if.else.loc21, !dbg !10
  55. // CHECK:STDOUT:
  56. // CHECK:STDOUT: if.then.loc21: ; preds = %for.body
  57. // CHECK:STDOUT: br label %for.done, !dbg !11
  58. // CHECK:STDOUT:
  59. // CHECK:STDOUT: if.else.loc21: ; preds = %for.body
  60. // CHECK:STDOUT: %G.call = call i1 @_CG.Main(), !dbg !12
  61. // CHECK:STDOUT: br i1 %G.call, label %if.then.loc22, label %if.else.loc22, !dbg !13
  62. // CHECK:STDOUT:
  63. // CHECK:STDOUT: if.then.loc22: ; preds = %if.else.loc21
  64. // CHECK:STDOUT: br label %for.next, !dbg !14
  65. // CHECK:STDOUT:
  66. // CHECK:STDOUT: if.else.loc22: ; preds = %if.else.loc21
  67. // CHECK:STDOUT: call void @_CH.Main(), !dbg !15
  68. // CHECK:STDOUT: br label %for.next, !dbg !16
  69. // CHECK:STDOUT:
  70. // CHECK:STDOUT: for.done: ; preds = %if.then.loc21, %for.next
  71. // CHECK:STDOUT: ret void, !dbg !17
  72. // CHECK:STDOUT: }
  73. // CHECK:STDOUT:
  74. // CHECK:STDOUT: declare void @_CRange.Core(ptr sret({ i32, i32 }), i32)
  75. // CHECK:STDOUT:
  76. // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
  77. // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #1
  78. // CHECK:STDOUT:
  79. // CHECK:STDOUT: ; Function Attrs: nounwind
  80. // CHECK:STDOUT: define linkonce_odr i32 @"_CNewCursor.IntRange.Core:Iterate.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !18 {
  81. // CHECK:STDOUT: %start = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 0, !dbg !26
  82. // CHECK:STDOUT: %1 = load i32, ptr %start, align 4, !dbg !26
  83. // CHECK:STDOUT: ret i32 %1, !dbg !27
  84. // CHECK:STDOUT: }
  85. // CHECK:STDOUT:
  86. // CHECK:STDOUT: ; Function Attrs: nounwind
  87. // CHECK:STDOUT: define linkonce_odr void @"_CNext.IntRange.Core:Iterate.Core.be1e879c1ad406d8"(ptr sret({ i32, i1 }) %return, ptr %self, ptr %cursor) #0 !dbg !28 {
  88. // CHECK:STDOUT: %1 = alloca i32, align 4, !dbg !34
  89. // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %1), !dbg !34
  90. // CHECK:STDOUT: %2 = load i32, ptr %cursor, align 4, !dbg !35
  91. // CHECK:STDOUT: store i32 %2, ptr %1, align 4, !dbg !34
  92. // CHECK:STDOUT: %end = getelementptr inbounds nuw { i32, i32 }, ptr %self, i32 0, i32 1, !dbg !36
  93. // CHECK:STDOUT: %3 = load i32, ptr %end, align 4, !dbg !36
  94. // CHECK:STDOUT: %4 = load i32, ptr %1, align 4, !dbg !37
  95. // CHECK:STDOUT: %5 = icmp slt i32 %4, %3, !dbg !37
  96. // CHECK:STDOUT: br i1 %5, label %6, label %8, !dbg !38
  97. // CHECK:STDOUT:
  98. // CHECK:STDOUT: 6: ; preds = %0
  99. // CHECK:STDOUT: call void @"_COp.Int.Core:Inc.Core.be1e879c1ad406d8"(ptr %cursor), !dbg !39
  100. // CHECK:STDOUT: %7 = load i32, ptr %1, align 4, !dbg !40
  101. // CHECK:STDOUT: call void @_CSome.Optional.Core.e41cc9bfe4f9d0c5(ptr %return, i32 %7), !dbg !41
  102. // CHECK:STDOUT: ret void, !dbg !42
  103. // CHECK:STDOUT:
  104. // CHECK:STDOUT: 8: ; preds = %0
  105. // CHECK:STDOUT: call void @_CNone.Optional.Core.e41cc9bfe4f9d0c5(ptr %return), !dbg !43
  106. // CHECK:STDOUT: ret void, !dbg !44
  107. // CHECK:STDOUT: }
  108. // CHECK:STDOUT:
  109. // CHECK:STDOUT: ; Function Attrs: nounwind
  110. // CHECK:STDOUT: define linkonce_odr i1 @_CHasValue.Optional.Core.e41cc9bfe4f9d0c5(ptr %self) #0 !dbg !45 {
  111. // CHECK:STDOUT: %1 = call i1 @"_CHas.e5bf07b1b9c2cbc2:OptionalStorage.Core.fabd868a8778e18e"(ptr %self), !dbg !51
  112. // CHECK:STDOUT: ret i1 %1, !dbg !52
  113. // CHECK:STDOUT: }
  114. // CHECK:STDOUT:
  115. // CHECK:STDOUT: ; Function Attrs: nounwind
  116. // CHECK:STDOUT: define linkonce_odr i32 @_CGet.Optional.Core.e41cc9bfe4f9d0c5(ptr %self) #0 !dbg !53 {
  117. // CHECK:STDOUT: %1 = call i32 @"_CGet.e5bf07b1b9c2cbc2:OptionalStorage.Core.fabd868a8778e18e"(ptr %self), !dbg !56
  118. // CHECK:STDOUT: ret i32 %1, !dbg !57
  119. // CHECK:STDOUT: }
  120. // CHECK:STDOUT:
  121. // CHECK:STDOUT: declare void @_CInclusiveRange.Core(ptr sret({ i32, i32 }), i32, i32)
  122. // CHECK:STDOUT:
  123. // CHECK:STDOUT: ; Function Attrs: nounwind
  124. // CHECK:STDOUT: define linkonce_odr void @"_COp.Int.Core:Inc.Core.be1e879c1ad406d8"(ptr %self) #0 !dbg !58 {
  125. // CHECK:STDOUT: call void @"_COp:thunk.Int.Core:AddAssignWith.Core.e03500d7605334b8"(ptr %self, i32 1), !dbg !64
  126. // CHECK:STDOUT: ret void, !dbg !65
  127. // CHECK:STDOUT: }
  128. // CHECK:STDOUT:
  129. // CHECK:STDOUT: ; Function Attrs: nounwind
  130. // CHECK:STDOUT: define linkonce_odr void @_CSome.Optional.Core.e41cc9bfe4f9d0c5(ptr sret({ i32, i1 }) %return, i32 %value) #0 !dbg !66 {
  131. // CHECK:STDOUT: call void @"_CSome.e5bf07b1b9c2cbc2:OptionalStorage.Core.fabd868a8778e18e"(ptr %return, i32 %value), !dbg !71
  132. // CHECK:STDOUT: ret void, !dbg !72
  133. // CHECK:STDOUT: }
  134. // CHECK:STDOUT:
  135. // CHECK:STDOUT: ; Function Attrs: nounwind
  136. // CHECK:STDOUT: define linkonce_odr void @_CNone.Optional.Core.e41cc9bfe4f9d0c5(ptr sret({ i32, i1 }) %return) #0 !dbg !73 {
  137. // CHECK:STDOUT: call void @"_CNone.e5bf07b1b9c2cbc2:OptionalStorage.Core.fabd868a8778e18e"(ptr %return), !dbg !76
  138. // CHECK:STDOUT: ret void, !dbg !77
  139. // CHECK:STDOUT: }
  140. // CHECK:STDOUT:
  141. // CHECK:STDOUT: ; Function Attrs: nounwind
  142. // CHECK:STDOUT: define linkonce_odr i1 @"_CHas.e5bf07b1b9c2cbc2:OptionalStorage.Core.fabd868a8778e18e"(ptr %value) #0 !dbg !78 {
  143. // CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %value, i32 0, i32 1, !dbg !81
  144. // CHECK:STDOUT: %1 = load i8, ptr %has_value, align 1, !dbg !81
  145. // CHECK:STDOUT: %2 = trunc i8 %1 to i1, !dbg !81
  146. // CHECK:STDOUT: ret i1 %2, !dbg !82
  147. // CHECK:STDOUT: }
  148. // CHECK:STDOUT:
  149. // CHECK:STDOUT: ; Function Attrs: nounwind
  150. // CHECK:STDOUT: define linkonce_odr i32 @"_CGet.e5bf07b1b9c2cbc2:OptionalStorage.Core.fabd868a8778e18e"(ptr %value) #0 !dbg !83 {
  151. // CHECK:STDOUT: %value1 = getelementptr inbounds nuw { i32, i1 }, ptr %value, i32 0, i32 0, !dbg !86
  152. // CHECK:STDOUT: %1 = load i32, ptr %value1, align 4, !dbg !86
  153. // CHECK:STDOUT: ret i32 %1, !dbg !87
  154. // CHECK:STDOUT: }
  155. // CHECK:STDOUT:
  156. // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
  157. // CHECK:STDOUT: define linkonce_odr void @"_COp:thunk.Int.Core:AddAssignWith.Core.e03500d7605334b8"(ptr %self, i32 %other) #2 !dbg !88 {
  158. // CHECK:STDOUT: %1 = call i32 @"_CConvert.e5bf07b1b9c2cbc2:ImplicitAs.Core.fabd868a8778e18e"(i32 %other), !dbg !94
  159. // CHECK:STDOUT: %2 = load i32, ptr %self, align 4, !dbg !95
  160. // CHECK:STDOUT: %3 = add i32 %2, %1, !dbg !95
  161. // CHECK:STDOUT: store i32 %3, ptr %self, align 4, !dbg !95
  162. // CHECK:STDOUT: ret void, !dbg !95
  163. // CHECK:STDOUT: }
  164. // CHECK:STDOUT:
  165. // CHECK:STDOUT: ; Function Attrs: nounwind
  166. // CHECK:STDOUT: define linkonce_odr void @"_CSome.e5bf07b1b9c2cbc2:OptionalStorage.Core.fabd868a8778e18e"(ptr sret({ i32, i1 }) %return, i32 %self) #0 !dbg !96 {
  167. // CHECK:STDOUT: %value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 0, !dbg !99
  168. // CHECK:STDOUT: store i32 %self, ptr %value, align 4, !dbg !99
  169. // CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !100
  170. // CHECK:STDOUT: store i8 1, ptr %has_value, align 1, !dbg !100
  171. // CHECK:STDOUT: ret void, !dbg !101
  172. // CHECK:STDOUT: }
  173. // CHECK:STDOUT:
  174. // CHECK:STDOUT: ; Function Attrs: nounwind
  175. // CHECK:STDOUT: define linkonce_odr void @"_CNone.e5bf07b1b9c2cbc2:OptionalStorage.Core.fabd868a8778e18e"(ptr sret({ i32, i1 }) %return) #0 !dbg !102 {
  176. // CHECK:STDOUT: %has_value = getelementptr inbounds nuw { i32, i1 }, ptr %return, i32 0, i32 1, !dbg !103
  177. // CHECK:STDOUT: store i8 0, ptr %has_value, align 1, !dbg !103
  178. // CHECK:STDOUT: ret void, !dbg !104
  179. // CHECK:STDOUT: }
  180. // CHECK:STDOUT:
  181. // CHECK:STDOUT: ; Function Attrs: nounwind
  182. // CHECK:STDOUT: define linkonce_odr i32 @"_CConvert.e5bf07b1b9c2cbc2:ImplicitAs.Core.fabd868a8778e18e"(i32 %self) #0 !dbg !105 {
  183. // CHECK:STDOUT: ret i32 %self, !dbg !111
  184. // CHECK:STDOUT: }
  185. // CHECK:STDOUT:
  186. // CHECK:STDOUT: ; uselistorder directives
  187. // CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 0, 3, 2, 1 }
  188. // CHECK:STDOUT:
  189. // CHECK:STDOUT: attributes #0 = { nounwind }
  190. // CHECK:STDOUT: attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
  191. // CHECK:STDOUT: attributes #2 = { alwaysinline nounwind }
  192. // CHECK:STDOUT:
  193. // CHECK:STDOUT: !llvm.module.flags = !{!0, !1}
  194. // CHECK:STDOUT: !llvm.dbg.cu = !{!2}
  195. // CHECK:STDOUT:
  196. // CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
  197. // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
  198. // CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
  199. // CHECK:STDOUT: !3 = !DIFile(filename: "break_continue.carbon", directory: "")
  200. // CHECK:STDOUT: !4 = distinct !DISubprogram(name: "For", linkageName: "_CFor.Main", scope: null, file: !3, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2)
  201. // CHECK:STDOUT: !5 = !DISubroutineType(types: !6)
  202. // CHECK:STDOUT: !6 = !{null}
  203. // CHECK:STDOUT: !7 = !DILocation(line: 20, column: 18, scope: !4)
  204. // CHECK:STDOUT: !8 = !DILocation(line: 20, column: 7, scope: !4)
  205. // CHECK:STDOUT: !9 = !DILocation(line: 21, column: 9, scope: !4)
  206. // CHECK:STDOUT: !10 = !DILocation(line: 21, column: 8, scope: !4)
  207. // CHECK:STDOUT: !11 = !DILocation(line: 21, column: 16, scope: !4)
  208. // CHECK:STDOUT: !12 = !DILocation(line: 22, column: 9, scope: !4)
  209. // CHECK:STDOUT: !13 = !DILocation(line: 22, column: 8, scope: !4)
  210. // CHECK:STDOUT: !14 = !DILocation(line: 22, column: 16, scope: !4)
  211. // CHECK:STDOUT: !15 = !DILocation(line: 23, column: 5, scope: !4)
  212. // CHECK:STDOUT: !16 = !DILocation(line: 20, column: 3, scope: !4)
  213. // CHECK:STDOUT: !17 = !DILocation(line: 19, column: 1, scope: !4)
  214. // CHECK:STDOUT: !18 = distinct !DISubprogram(name: "NewCursor", linkageName: "_CNewCursor.IntRange.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !19, line: 25, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !24)
  215. // CHECK:STDOUT: !19 = !DIFile(filename: "{{.*}}/range.carbon", directory: "")
  216. // CHECK:STDOUT: !20 = !DISubroutineType(types: !21)
  217. // CHECK:STDOUT: !21 = !{!22, !23}
  218. // CHECK:STDOUT: !22 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
  219. // CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
  220. // CHECK:STDOUT: !24 = !{!25}
  221. // CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !18, type: !23)
  222. // CHECK:STDOUT: !26 = !DILocation(line: 25, column: 51, scope: !18)
  223. // CHECK:STDOUT: !27 = !DILocation(line: 25, column: 44, scope: !18)
  224. // CHECK:STDOUT: !28 = distinct !DISubprogram(name: "Next", linkageName: "_CNext.IntRange.Core:Iterate.Core.be1e879c1ad406d8", scope: null, file: !19, line: 26, type: !29, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !31)
  225. // CHECK:STDOUT: !29 = !DISubroutineType(types: !30)
  226. // CHECK:STDOUT: !30 = !{!23, !23, !23}
  227. // CHECK:STDOUT: !31 = !{!32, !33}
  228. // CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !28, type: !23)
  229. // CHECK:STDOUT: !33 = !DILocalVariable(arg: 2, scope: !28, type: !23)
  230. // CHECK:STDOUT: !34 = !DILocation(line: 27, column: 7, scope: !28)
  231. // CHECK:STDOUT: !35 = !DILocation(line: 27, column: 27, scope: !28)
  232. // CHECK:STDOUT: !36 = !DILocation(line: 28, column: 19, scope: !28)
  233. // CHECK:STDOUT: !37 = !DILocation(line: 28, column: 11, scope: !28)
  234. // CHECK:STDOUT: !38 = !DILocation(line: 28, column: 10, scope: !28)
  235. // CHECK:STDOUT: !39 = !DILocation(line: 29, column: 9, scope: !28)
  236. // CHECK:STDOUT: !40 = !DILocation(line: 30, column: 38, scope: !28)
  237. // CHECK:STDOUT: !41 = !DILocation(line: 30, column: 16, scope: !28)
  238. // CHECK:STDOUT: !42 = !DILocation(line: 30, column: 9, scope: !28)
  239. // CHECK:STDOUT: !43 = !DILocation(line: 32, column: 16, scope: !28)
  240. // CHECK:STDOUT: !44 = !DILocation(line: 32, column: 9, scope: !28)
  241. // CHECK:STDOUT: !45 = distinct !DISubprogram(name: "HasValue", linkageName: "_CHasValue.Optional.Core.e41cc9bfe4f9d0c5", scope: null, file: !46, line: 32, type: !47, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !49)
  242. // CHECK:STDOUT: !46 = !DIFile(filename: "{{.*}}/prelude/types/optional.carbon", directory: "")
  243. // CHECK:STDOUT: !47 = !DISubroutineType(types: !48)
  244. // CHECK:STDOUT: !48 = !{!23, !23}
  245. // CHECK:STDOUT: !49 = !{!50}
  246. // CHECK:STDOUT: !50 = !DILocalVariable(arg: 1, scope: !45, type: !23)
  247. // CHECK:STDOUT: !51 = !DILocation(line: 33, column: 12, scope: !45)
  248. // CHECK:STDOUT: !52 = !DILocation(line: 33, column: 5, scope: !45)
  249. // CHECK:STDOUT: !53 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.Optional.Core.e41cc9bfe4f9d0c5", scope: null, file: !46, line: 35, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !54)
  250. // CHECK:STDOUT: !54 = !{!55}
  251. // CHECK:STDOUT: !55 = !DILocalVariable(arg: 1, scope: !53, type: !23)
  252. // CHECK:STDOUT: !56 = !DILocation(line: 36, column: 12, scope: !53)
  253. // CHECK:STDOUT: !57 = !DILocation(line: 36, column: 5, scope: !53)
  254. // CHECK:STDOUT: !58 = distinct !DISubprogram(name: "Op", linkageName: "_COp.Int.Core:Inc.Core.be1e879c1ad406d8", scope: null, file: !59, line: 339, type: !60, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !62)
  255. // CHECK:STDOUT: !59 = !DIFile(filename: "{{.*}}/prelude/types/int.carbon", directory: "")
  256. // CHECK:STDOUT: !60 = !DISubroutineType(types: !61)
  257. // CHECK:STDOUT: !61 = !{null, !22}
  258. // CHECK:STDOUT: !62 = !{!63}
  259. // CHECK:STDOUT: !63 = !DILocalVariable(arg: 1, scope: !58, type: !22)
  260. // CHECK:STDOUT: !64 = !DILocation(line: 341, column: 5, scope: !58)
  261. // CHECK:STDOUT: !65 = !DILocation(line: 339, column: 3, scope: !58)
  262. // CHECK:STDOUT: !66 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.Optional.Core.e41cc9bfe4f9d0c5", scope: null, file: !46, line: 29, type: !67, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !69)
  263. // CHECK:STDOUT: !67 = !DISubroutineType(types: !68)
  264. // CHECK:STDOUT: !68 = !{!23, !22}
  265. // CHECK:STDOUT: !69 = !{!70}
  266. // CHECK:STDOUT: !70 = !DILocalVariable(arg: 1, scope: !66, type: !22)
  267. // CHECK:STDOUT: !71 = !DILocation(line: 30, column: 12, scope: !66)
  268. // CHECK:STDOUT: !72 = !DILocation(line: 30, column: 5, scope: !66)
  269. // CHECK:STDOUT: !73 = distinct !DISubprogram(name: "None", linkageName: "_CNone.Optional.Core.e41cc9bfe4f9d0c5", scope: null, file: !46, line: 26, type: !74, spFlags: DISPFlagDefinition, unit: !2)
  270. // CHECK:STDOUT: !74 = !DISubroutineType(types: !75)
  271. // CHECK:STDOUT: !75 = !{!23}
  272. // CHECK:STDOUT: !76 = !DILocation(line: 27, column: 12, scope: !73)
  273. // CHECK:STDOUT: !77 = !DILocation(line: 27, column: 5, scope: !73)
  274. // CHECK:STDOUT: !78 = distinct !DISubprogram(name: "Has", linkageName: "_CHas.e5bf07b1b9c2cbc2:OptionalStorage.Core.fabd868a8778e18e", scope: null, file: !46, line: 112, type: !47, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !79)
  275. // CHECK:STDOUT: !79 = !{!80}
  276. // CHECK:STDOUT: !80 = !DILocalVariable(arg: 1, scope: !78, type: !23)
  277. // CHECK:STDOUT: !81 = !DILocation(line: 113, column: 12, scope: !78)
  278. // CHECK:STDOUT: !82 = !DILocation(line: 113, column: 5, scope: !78)
  279. // CHECK:STDOUT: !83 = distinct !DISubprogram(name: "Get", linkageName: "_CGet.e5bf07b1b9c2cbc2:OptionalStorage.Core.fabd868a8778e18e", scope: null, file: !46, line: 115, type: !20, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !84)
  280. // CHECK:STDOUT: !84 = !{!85}
  281. // CHECK:STDOUT: !85 = !DILocalVariable(arg: 1, scope: !83, type: !23)
  282. // CHECK:STDOUT: !86 = !DILocation(line: 116, column: 12, scope: !83)
  283. // CHECK:STDOUT: !87 = !DILocation(line: 116, column: 5, scope: !83)
  284. // CHECK:STDOUT: !88 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Int.Core:AddAssignWith.Core.e03500d7605334b8", scope: null, file: !59, line: 275, type: !89, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !91)
  285. // CHECK:STDOUT: !89 = !DISubroutineType(types: !90)
  286. // CHECK:STDOUT: !90 = !{null, !22, !22}
  287. // CHECK:STDOUT: !91 = !{!92, !93}
  288. // CHECK:STDOUT: !92 = !DILocalVariable(arg: 1, scope: !88, type: !22)
  289. // CHECK:STDOUT: !93 = !DILocalVariable(arg: 2, scope: !88, type: !22)
  290. // CHECK:STDOUT: !94 = !DILocation(line: 4294967295, scope: !88)
  291. // CHECK:STDOUT: !95 = !DILocation(line: 275, column: 3, scope: !88)
  292. // CHECK:STDOUT: !96 = distinct !DISubprogram(name: "Some", linkageName: "_CSome.e5bf07b1b9c2cbc2:OptionalStorage.Core.fabd868a8778e18e", scope: null, file: !46, line: 104, type: !67, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !97)
  293. // CHECK:STDOUT: !97 = !{!98}
  294. // CHECK:STDOUT: !98 = !DILocalVariable(arg: 1, scope: !96, type: !22)
  295. // CHECK:STDOUT: !99 = !DILocation(line: 108, column: 5, scope: !96)
  296. // CHECK:STDOUT: !100 = !DILocation(line: 109, column: 5, scope: !96)
  297. // CHECK:STDOUT: !101 = !DILocation(line: 110, column: 5, scope: !96)
  298. // CHECK:STDOUT: !102 = distinct !DISubprogram(name: "None", linkageName: "_CNone.e5bf07b1b9c2cbc2:OptionalStorage.Core.fabd868a8778e18e", scope: null, file: !46, line: 99, type: !74, spFlags: DISPFlagDefinition, unit: !2)
  299. // CHECK:STDOUT: !103 = !DILocation(line: 101, column: 5, scope: !102)
  300. // CHECK:STDOUT: !104 = !DILocation(line: 102, column: 5, scope: !102)
  301. // CHECK:STDOUT: !105 = distinct !DISubprogram(name: "Convert", linkageName: "_CConvert.e5bf07b1b9c2cbc2:ImplicitAs.Core.fabd868a8778e18e", scope: null, file: !106, line: 24, type: !107, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !109)
  302. // CHECK:STDOUT: !106 = !DIFile(filename: "{{.*}}/prelude/operators/as.carbon", directory: "")
  303. // CHECK:STDOUT: !107 = !DISubroutineType(types: !108)
  304. // CHECK:STDOUT: !108 = !{!22, !22}
  305. // CHECK:STDOUT: !109 = !{!110}
  306. // CHECK:STDOUT: !110 = !DILocalVariable(arg: 1, scope: !105, type: !22)
  307. // CHECK:STDOUT: !111 = !DILocation(line: 24, column: 38, scope: !105)