function.carbon 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  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/interop/cpp/reverse/function.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/reverse/function.carbon
  12. // --- other.carbon
  13. package Other;
  14. fn NoArgs() {}
  15. fn BoolArg(a: bool) {
  16. a;
  17. }
  18. fn IntArg(a: i32) {
  19. a;
  20. }
  21. fn FloatArg(a: f32) {
  22. a;
  23. }
  24. // --- function.carbon
  25. library "[[@TEST_NAME]]";
  26. import Other;
  27. import Cpp inline '''
  28. void G() {
  29. Carbon::Other::NoArgs();
  30. Carbon::Other::BoolArg(true);
  31. Carbon::Other::IntArg(123);
  32. Carbon::Other::FloatArg(1.5);
  33. }
  34. ''';
  35. // --- single_file.carbon
  36. library "[[@TEST_NAME]]";
  37. import Cpp;
  38. fn F() {}
  39. inline Cpp '''
  40. inline void G1() {
  41. Carbon::F();
  42. }
  43. // Call an inline function indirectly to ensure declarations are getting
  44. // properly registered with the CodeGen consumer.
  45. inline void G2() {
  46. G1();
  47. }
  48. ''';
  49. fn H() { Cpp.G2(); }
  50. // CHECK:STDOUT: ; ModuleID = 'other.carbon'
  51. // CHECK:STDOUT: source_filename = "other.carbon"
  52. // CHECK:STDOUT:
  53. // CHECK:STDOUT: ; Function Attrs: nounwind
  54. // CHECK:STDOUT: define void @_CNoArgs.Other() #0 !dbg !4 {
  55. // CHECK:STDOUT: entry:
  56. // CHECK:STDOUT: ret void, !dbg !7
  57. // CHECK:STDOUT: }
  58. // CHECK:STDOUT:
  59. // CHECK:STDOUT: ; Function Attrs: nounwind
  60. // CHECK:STDOUT: define void @_CBoolArg.Other(i1 %a) #0 !dbg !8 {
  61. // CHECK:STDOUT: entry:
  62. // CHECK:STDOUT: ret void, !dbg !14
  63. // CHECK:STDOUT: }
  64. // CHECK:STDOUT:
  65. // CHECK:STDOUT: ; Function Attrs: nounwind
  66. // CHECK:STDOUT: define void @_CIntArg.Other(i32 %a) #0 !dbg !15 {
  67. // CHECK:STDOUT: entry:
  68. // CHECK:STDOUT: ret void, !dbg !21
  69. // CHECK:STDOUT: }
  70. // CHECK:STDOUT:
  71. // CHECK:STDOUT: ; Function Attrs: nounwind
  72. // CHECK:STDOUT: define void @_CFloatArg.Other(float %a) #0 !dbg !22 {
  73. // CHECK:STDOUT: entry:
  74. // CHECK:STDOUT: ret void, !dbg !25
  75. // CHECK:STDOUT: }
  76. // CHECK:STDOUT:
  77. // CHECK:STDOUT: attributes #0 = { nounwind }
  78. // CHECK:STDOUT:
  79. // CHECK:STDOUT: !llvm.module.flags = !{!0, !1}
  80. // CHECK:STDOUT: !llvm.dbg.cu = !{!2}
  81. // CHECK:STDOUT:
  82. // CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
  83. // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
  84. // CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
  85. // CHECK:STDOUT: !3 = !DIFile(filename: "other.carbon", directory: "")
  86. // CHECK:STDOUT: !4 = distinct !DISubprogram(name: "NoArgs", linkageName: "_CNoArgs.Other", scope: null, file: !3, line: 2, type: !5, spFlags: DISPFlagDefinition, unit: !2)
  87. // CHECK:STDOUT: !5 = !DISubroutineType(types: !6)
  88. // CHECK:STDOUT: !6 = !{null}
  89. // CHECK:STDOUT: !7 = !DILocation(line: 2, column: 1, scope: !4)
  90. // CHECK:STDOUT: !8 = distinct !DISubprogram(name: "BoolArg", linkageName: "_CBoolArg.Other", scope: null, file: !3, line: 3, type: !9, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !12)
  91. // CHECK:STDOUT: !9 = !DISubroutineType(types: !10)
  92. // CHECK:STDOUT: !10 = !{null, !11}
  93. // CHECK:STDOUT: !11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
  94. // CHECK:STDOUT: !12 = !{!13}
  95. // CHECK:STDOUT: !13 = !DILocalVariable(arg: 1, scope: !8, type: !11)
  96. // CHECK:STDOUT: !14 = !DILocation(line: 3, column: 1, scope: !8)
  97. // CHECK:STDOUT: !15 = distinct !DISubprogram(name: "IntArg", linkageName: "_CIntArg.Other", scope: null, file: !3, line: 6, type: !16, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !19)
  98. // CHECK:STDOUT: !16 = !DISubroutineType(types: !17)
  99. // CHECK:STDOUT: !17 = !{null, !18}
  100. // CHECK:STDOUT: !18 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
  101. // CHECK:STDOUT: !19 = !{!20}
  102. // CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !15, type: !18)
  103. // CHECK:STDOUT: !21 = !DILocation(line: 6, column: 1, scope: !15)
  104. // CHECK:STDOUT: !22 = distinct !DISubprogram(name: "FloatArg", linkageName: "_CFloatArg.Other", scope: null, file: !3, line: 9, type: !9, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !23)
  105. // CHECK:STDOUT: !23 = !{!24}
  106. // CHECK:STDOUT: !24 = !DILocalVariable(arg: 1, scope: !22, type: !11)
  107. // CHECK:STDOUT: !25 = !DILocation(line: 9, column: 1, scope: !22)
  108. // CHECK:STDOUT: ; ModuleID = 'function.carbon'
  109. // CHECK:STDOUT: source_filename = "function.carbon"
  110. // CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
  111. // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
  112. // CHECK:STDOUT:
  113. // CHECK:STDOUT: ; Function Attrs: mustprogress uwtable
  114. // CHECK:STDOUT: define dso_local void @_Z1Gv() #0 {
  115. // CHECK:STDOUT: entry:
  116. // CHECK:STDOUT: call void @_ZL17NoArgs__cpp_thunkv()
  117. // CHECK:STDOUT: call void @_ZL18BoolArg__cpp_thunkb(i1 noundef zeroext true)
  118. // CHECK:STDOUT: call void @_ZL17IntArg__cpp_thunki(i32 noundef 123)
  119. // CHECK:STDOUT: call void @_ZL19FloatArg__cpp_thunkf(float noundef 1.500000e+00)
  120. // CHECK:STDOUT: ret void
  121. // CHECK:STDOUT: }
  122. // CHECK:STDOUT:
  123. // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
  124. // CHECK:STDOUT: define internal void @_ZL17NoArgs__cpp_thunkv() #1 {
  125. // CHECK:STDOUT: entry:
  126. // CHECK:STDOUT: call void @_CNoArgs__carbon_thunk.Other()
  127. // CHECK:STDOUT: ret void
  128. // CHECK:STDOUT: }
  129. // CHECK:STDOUT:
  130. // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
  131. // CHECK:STDOUT: define internal void @_ZL18BoolArg__cpp_thunkb(i1 noundef zeroext %0) #1 {
  132. // CHECK:STDOUT: entry:
  133. // CHECK:STDOUT: %.addr = alloca i8, align 1
  134. // CHECK:STDOUT: %storedv = zext i1 %0 to i8
  135. // CHECK:STDOUT: store i8 %storedv, ptr %.addr, align 1, !tbaa !11
  136. // CHECK:STDOUT: call void @_CBoolArg__carbon_thunk.Other(ptr noundef nonnull align 1 dereferenceable(1) %.addr)
  137. // CHECK:STDOUT: ret void
  138. // CHECK:STDOUT: }
  139. // CHECK:STDOUT:
  140. // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
  141. // CHECK:STDOUT: define internal void @_ZL17IntArg__cpp_thunki(i32 noundef %0) #1 {
  142. // CHECK:STDOUT: entry:
  143. // CHECK:STDOUT: %.addr = alloca i32, align 4
  144. // CHECK:STDOUT: store i32 %0, ptr %.addr, align 4, !tbaa !7
  145. // CHECK:STDOUT: call void @_CIntArg__carbon_thunk.Other(ptr noundef nonnull align 4 dereferenceable(4) %.addr)
  146. // CHECK:STDOUT: ret void
  147. // CHECK:STDOUT: }
  148. // CHECK:STDOUT:
  149. // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
  150. // CHECK:STDOUT: define internal void @_ZL19FloatArg__cpp_thunkf(float noundef %0) #1 {
  151. // CHECK:STDOUT: entry:
  152. // CHECK:STDOUT: %.addr = alloca float, align 4
  153. // CHECK:STDOUT: store float %0, ptr %.addr, align 4, !tbaa !13
  154. // CHECK:STDOUT: call void @_CFloatArg__carbon_thunk.Other(ptr noundef nonnull align 4 dereferenceable(4) %.addr)
  155. // CHECK:STDOUT: ret void
  156. // CHECK:STDOUT: }
  157. // CHECK:STDOUT:
  158. // CHECK:STDOUT: declare void @_CNoArgs.Other()
  159. // CHECK:STDOUT:
  160. // CHECK:STDOUT: ; Function Attrs: nounwind
  161. // CHECK:STDOUT: define void @_CNoArgs__carbon_thunk.Other() #2 !dbg !15 {
  162. // CHECK:STDOUT: entry:
  163. // CHECK:STDOUT: call void @_CNoArgs.Other(), !dbg !19
  164. // CHECK:STDOUT: ret void, !dbg !19
  165. // CHECK:STDOUT: }
  166. // CHECK:STDOUT:
  167. // CHECK:STDOUT: declare void @_CBoolArg.Other(i1)
  168. // CHECK:STDOUT:
  169. // CHECK:STDOUT: ; Function Attrs: nounwind
  170. // CHECK:STDOUT: define void @_CBoolArg__carbon_thunk.Other(ptr %_) #2 !dbg !20 {
  171. // CHECK:STDOUT: entry:
  172. // CHECK:STDOUT: %.1 = load i8, ptr %_, align 1, !dbg !26
  173. // CHECK:STDOUT: %.11 = trunc i8 %.1 to i1, !dbg !26
  174. // CHECK:STDOUT: call void @_CBoolArg.Other(i1 %.11), !dbg !26
  175. // CHECK:STDOUT: ret void, !dbg !26
  176. // CHECK:STDOUT: }
  177. // CHECK:STDOUT:
  178. // CHECK:STDOUT: declare void @_CIntArg.Other(i32)
  179. // CHECK:STDOUT:
  180. // CHECK:STDOUT: ; Function Attrs: nounwind
  181. // CHECK:STDOUT: define void @_CIntArg__carbon_thunk.Other(ptr %_) #2 !dbg !27 {
  182. // CHECK:STDOUT: entry:
  183. // CHECK:STDOUT: %.1 = load i32, ptr %_, align 4, !dbg !33
  184. // CHECK:STDOUT: call void @_CIntArg.Other(i32 %.1), !dbg !33
  185. // CHECK:STDOUT: ret void, !dbg !33
  186. // CHECK:STDOUT: }
  187. // CHECK:STDOUT:
  188. // CHECK:STDOUT: declare void @_CFloatArg.Other(float)
  189. // CHECK:STDOUT:
  190. // CHECK:STDOUT: ; Function Attrs: nounwind
  191. // CHECK:STDOUT: define void @_CFloatArg__carbon_thunk.Other(ptr %_) #2 !dbg !34 {
  192. // CHECK:STDOUT: entry:
  193. // CHECK:STDOUT: %.1 = load float, ptr %_, align 4, !dbg !37
  194. // CHECK:STDOUT: call void @_CFloatArg.Other(float %.1), !dbg !37
  195. // CHECK:STDOUT: ret void, !dbg !37
  196. // CHECK:STDOUT: }
  197. // CHECK:STDOUT:
  198. // CHECK:STDOUT: attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
  199. // CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
  200. // CHECK:STDOUT: attributes #2 = { nounwind }
  201. // CHECK:STDOUT:
  202. // CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
  203. // CHECK:STDOUT: !llvm.dbg.cu = !{!5}
  204. // CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
  205. // CHECK:STDOUT:
  206. // CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
  207. // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
  208. // CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
  209. // CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
  210. // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
  211. // CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
  212. // CHECK:STDOUT: !6 = !DIFile(filename: "function.carbon", directory: "")
  213. // CHECK:STDOUT: !7 = !{!8, !8, i64 0}
  214. // CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
  215. // CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
  216. // CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
  217. // CHECK:STDOUT: !11 = !{!12, !12, i64 0}
  218. // CHECK:STDOUT: !12 = !{!"bool", !9, i64 0}
  219. // CHECK:STDOUT: !13 = !{!14, !14, i64 0}
  220. // CHECK:STDOUT: !14 = !{!"float", !9, i64 0}
  221. // CHECK:STDOUT: !15 = distinct !DISubprogram(name: "NoArgs__carbon_thunk", linkageName: "_CNoArgs__carbon_thunk.Other", scope: null, file: !16, line: 2, type: !17, spFlags: DISPFlagDefinition, unit: !5)
  222. // CHECK:STDOUT: !16 = !DIFile(filename: "other.carbon", directory: "")
  223. // CHECK:STDOUT: !17 = !DISubroutineType(types: !18)
  224. // CHECK:STDOUT: !18 = !{null}
  225. // CHECK:STDOUT: !19 = !DILocation(line: 2, column: 1, scope: !15)
  226. // CHECK:STDOUT: !20 = distinct !DISubprogram(name: "BoolArg__carbon_thunk", linkageName: "_CBoolArg__carbon_thunk.Other", scope: null, file: !16, line: 3, type: !21, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !24)
  227. // CHECK:STDOUT: !21 = !DISubroutineType(types: !22)
  228. // CHECK:STDOUT: !22 = !{null, !23}
  229. // CHECK:STDOUT: !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
  230. // CHECK:STDOUT: !24 = !{!25}
  231. // CHECK:STDOUT: !25 = !DILocalVariable(arg: 1, scope: !20, type: !23)
  232. // CHECK:STDOUT: !26 = !DILocation(line: 3, column: 1, scope: !20)
  233. // CHECK:STDOUT: !27 = distinct !DISubprogram(name: "IntArg__carbon_thunk", linkageName: "_CIntArg__carbon_thunk.Other", scope: null, file: !16, line: 6, type: !28, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !31)
  234. // CHECK:STDOUT: !28 = !DISubroutineType(types: !29)
  235. // CHECK:STDOUT: !29 = !{null, !30}
  236. // CHECK:STDOUT: !30 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
  237. // CHECK:STDOUT: !31 = !{!32}
  238. // CHECK:STDOUT: !32 = !DILocalVariable(arg: 1, scope: !27, type: !30)
  239. // CHECK:STDOUT: !33 = !DILocation(line: 6, column: 1, scope: !27)
  240. // CHECK:STDOUT: !34 = distinct !DISubprogram(name: "FloatArg__carbon_thunk", linkageName: "_CFloatArg__carbon_thunk.Other", scope: null, file: !16, line: 9, type: !21, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !35)
  241. // CHECK:STDOUT: !35 = !{!36}
  242. // CHECK:STDOUT: !36 = !DILocalVariable(arg: 1, scope: !34, type: !23)
  243. // CHECK:STDOUT: !37 = !DILocation(line: 9, column: 1, scope: !34)
  244. // CHECK:STDOUT: ; ModuleID = 'single_file.carbon'
  245. // CHECK:STDOUT: source_filename = "single_file.carbon"
  246. // CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
  247. // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
  248. // CHECK:STDOUT:
  249. // CHECK:STDOUT: $_Z2G2v = comdat any
  250. // CHECK:STDOUT:
  251. // CHECK:STDOUT: $_Z2G1v = comdat any
  252. // CHECK:STDOUT:
  253. // CHECK:STDOUT: ; Function Attrs: nounwind
  254. // CHECK:STDOUT: define void @_CF.Main() #0 !dbg !11 {
  255. // CHECK:STDOUT: entry:
  256. // CHECK:STDOUT: ret void, !dbg !14
  257. // CHECK:STDOUT: }
  258. // CHECK:STDOUT:
  259. // CHECK:STDOUT: ; Function Attrs: nounwind
  260. // CHECK:STDOUT: define void @_CF__carbon_thunk.Main() #0 !dbg !15 {
  261. // CHECK:STDOUT: entry:
  262. // CHECK:STDOUT: call void @_CF.Main(), !dbg !16
  263. // CHECK:STDOUT: ret void, !dbg !16
  264. // CHECK:STDOUT: }
  265. // CHECK:STDOUT:
  266. // CHECK:STDOUT: ; Function Attrs: nounwind
  267. // CHECK:STDOUT: define void @_CH.Main() #0 !dbg !17 {
  268. // CHECK:STDOUT: entry:
  269. // CHECK:STDOUT: call void @_Z2G2v(), !dbg !18
  270. // CHECK:STDOUT: ret void, !dbg !19
  271. // CHECK:STDOUT: }
  272. // CHECK:STDOUT:
  273. // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress uwtable
  274. // CHECK:STDOUT: define linkonce_odr dso_local void @_Z2G2v() #1 comdat {
  275. // CHECK:STDOUT: entry:
  276. // CHECK:STDOUT: call void @_Z2G1v()
  277. // CHECK:STDOUT: ret void
  278. // CHECK:STDOUT: }
  279. // CHECK:STDOUT:
  280. // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress uwtable
  281. // CHECK:STDOUT: define linkonce_odr dso_local void @_Z2G1v() #1 comdat {
  282. // CHECK:STDOUT: entry:
  283. // CHECK:STDOUT: call void @_ZL12F__cpp_thunkv()
  284. // CHECK:STDOUT: ret void
  285. // CHECK:STDOUT: }
  286. // CHECK:STDOUT:
  287. // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
  288. // CHECK:STDOUT: define internal void @_ZL12F__cpp_thunkv() #2 {
  289. // CHECK:STDOUT: entry:
  290. // CHECK:STDOUT: call void @_CF__carbon_thunk.Main()
  291. // CHECK:STDOUT: ret void
  292. // CHECK:STDOUT: }
  293. // CHECK:STDOUT:
  294. // CHECK:STDOUT: attributes #0 = { nounwind }
  295. // CHECK:STDOUT: attributes #1 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
  296. // CHECK:STDOUT: attributes #2 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
  297. // CHECK:STDOUT:
  298. // CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
  299. // CHECK:STDOUT: !llvm.dbg.cu = !{!5}
  300. // CHECK:STDOUT: !llvm.errno.tbaa = !{!7}
  301. // CHECK:STDOUT:
  302. // CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
  303. // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
  304. // CHECK:STDOUT: !2 = !{i32 8, !"PIC Level", i32 2}
  305. // CHECK:STDOUT: !3 = !{i32 7, !"PIE Level", i32 2}
  306. // CHECK:STDOUT: !4 = !{i32 7, !"uwtable", i32 2}
  307. // CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
  308. // CHECK:STDOUT: !6 = !DIFile(filename: "single_file.carbon", directory: "")
  309. // CHECK:STDOUT: !7 = !{!8, !8, i64 0}
  310. // CHECK:STDOUT: !8 = !{!"int", !9, i64 0}
  311. // CHECK:STDOUT: !9 = !{!"omnipotent char", !10, i64 0}
  312. // CHECK:STDOUT: !10 = !{!"Simple C++ TBAA"}
  313. // CHECK:STDOUT: !11 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !6, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !5)
  314. // CHECK:STDOUT: !12 = !DISubroutineType(types: !13)
  315. // CHECK:STDOUT: !13 = !{null}
  316. // CHECK:STDOUT: !14 = !DILocation(line: 6, column: 1, scope: !11)
  317. // CHECK:STDOUT: !15 = distinct !DISubprogram(name: "F__carbon_thunk", linkageName: "_CF__carbon_thunk.Main", scope: null, file: !6, line: 6, type: !12, spFlags: DISPFlagDefinition, unit: !5)
  318. // CHECK:STDOUT: !16 = !DILocation(line: 6, column: 1, scope: !15)
  319. // CHECK:STDOUT: !17 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main", scope: null, file: !6, line: 20, type: !12, spFlags: DISPFlagDefinition, unit: !5)
  320. // CHECK:STDOUT: !18 = !DILocation(line: 20, column: 10, scope: !17)
  321. // CHECK:STDOUT: !19 = !DILocation(line: 20, column: 1, scope: !17)