constructor.carbon 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  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/int.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/constructor.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/constructor.carbon
  12. // ============================================================================
  13. // Default constructor
  14. // ============================================================================
  15. // --- default.h
  16. class C {
  17. public:
  18. C() : x_(8), y_(9) {}
  19. private:
  20. int x_;
  21. int y_;
  22. };
  23. // --- import_default.carbon
  24. library "[[@TEST_NAME]]";
  25. import Cpp library "default.h";
  26. fn F() {
  27. let _: Cpp.C = Cpp.C.C();
  28. }
  29. // ============================================================================
  30. // Copy constructor
  31. // ============================================================================
  32. // --- copy.h
  33. class Copy {
  34. public:
  35. Copy();
  36. Copy(const Copy&);
  37. private:
  38. int n;
  39. };
  40. // --- call_copy.carbon
  41. library "[[@TEST_NAME]]";
  42. import Cpp library "copy.h";
  43. fn Copy(c: Cpp.Copy) -> Cpp.Copy {
  44. return c;
  45. }
  46. // ============================================================================
  47. // C1 constructor
  48. // ============================================================================
  49. // --- header.h
  50. struct Base { };
  51. struct Derived: virtual Base {
  52. };
  53. // --- call_c1_in_thunk.carbon
  54. library "[[@TEST_NAME]]";
  55. import Cpp library "header.h";
  56. fn F() {
  57. let _: Cpp.Derived = Cpp.Derived.Derived();
  58. }
  59. // CHECK:STDOUT: ; ModuleID = 'import_default.carbon'
  60. // CHECK:STDOUT: source_filename = "import_default.carbon"
  61. // 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"
  62. // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
  63. // CHECK:STDOUT:
  64. // CHECK:STDOUT: %class.C = type { i32, i32 }
  65. // CHECK:STDOUT:
  66. // CHECK:STDOUT: $_ZN1CC2Ev = comdat any
  67. // CHECK:STDOUT:
  68. // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
  69. // CHECK:STDOUT: define dso_local void @_ZN1CC1Ev.carbon_thunk(ptr noundef %return) #0 {
  70. // CHECK:STDOUT: entry:
  71. // CHECK:STDOUT: %return.addr = alloca ptr, align 8
  72. // CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !12
  73. // CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !12
  74. // CHECK:STDOUT: call void @_ZN1CC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %0)
  75. // CHECK:STDOUT: ret void
  76. // CHECK:STDOUT: }
  77. // CHECK:STDOUT:
  78. // CHECK:STDOUT: ; Function Attrs: mustprogress nounwind uwtable
  79. // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN1CC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %this) unnamed_addr #1 comdat align 2 {
  80. // CHECK:STDOUT: entry:
  81. // CHECK:STDOUT: %this.addr = alloca ptr, align 8
  82. // CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !12
  83. // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
  84. // CHECK:STDOUT: %x_ = getelementptr inbounds nuw %class.C, ptr %this1, i32 0, i32 0
  85. // CHECK:STDOUT: store i32 8, ptr %x_, align 4, !tbaa !15
  86. // CHECK:STDOUT: %y_ = getelementptr inbounds nuw %class.C, ptr %this1, i32 0, i32 1
  87. // CHECK:STDOUT: store i32 9, ptr %y_, align 4, !tbaa !17
  88. // CHECK:STDOUT: ret void
  89. // CHECK:STDOUT: }
  90. // CHECK:STDOUT:
  91. // CHECK:STDOUT: ; Function Attrs: nounwind
  92. // CHECK:STDOUT: define void @_CF.Main() #2 !dbg !18 {
  93. // CHECK:STDOUT: entry:
  94. // CHECK:STDOUT: %.loc7_26.1.temp = alloca [8 x i8], align 1, !dbg !21
  95. // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_26.1.temp), !dbg !21
  96. // CHECK:STDOUT: call void @_ZN1CC1Ev.carbon_thunk(ptr %.loc7_26.1.temp), !dbg !21
  97. // CHECK:STDOUT: ret void, !dbg !22
  98. // CHECK:STDOUT: }
  99. // CHECK:STDOUT:
  100. // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
  101. // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #3
  102. // CHECK:STDOUT:
  103. // CHECK:STDOUT: attributes #0 = { alwaysinline 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" }
  104. // CHECK:STDOUT: attributes #1 = { 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" }
  105. // CHECK:STDOUT: attributes #2 = { nounwind }
  106. // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
  107. // CHECK:STDOUT:
  108. // CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4, !5}
  109. // CHECK:STDOUT: !llvm.dbg.cu = !{!6}
  110. // CHECK:STDOUT: !llvm.errno.tbaa = !{!8}
  111. // CHECK:STDOUT:
  112. // CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
  113. // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
  114. // CHECK:STDOUT: !2 = !{i32 1, !"wchar_size", i32 4}
  115. // CHECK:STDOUT: !3 = !{i32 8, !"PIC Level", i32 2}
  116. // CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
  117. // CHECK:STDOUT: !5 = !{i32 7, !"uwtable", i32 2}
  118. // CHECK:STDOUT: !6 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !7, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
  119. // CHECK:STDOUT: !7 = !DIFile(filename: "import_default.carbon", directory: "")
  120. // CHECK:STDOUT: !8 = !{!9, !9, i64 0}
  121. // CHECK:STDOUT: !9 = !{!"int", !10, i64 0}
  122. // CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0}
  123. // CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"}
  124. // CHECK:STDOUT: !12 = !{!13, !13, i64 0}
  125. // CHECK:STDOUT: !13 = !{!"p1 _ZTS1C", !14, i64 0}
  126. // CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0}
  127. // CHECK:STDOUT: !15 = !{!16, !9, i64 0}
  128. // CHECK:STDOUT: !16 = !{!"_ZTS1C", !9, i64 0, !9, i64 4}
  129. // CHECK:STDOUT: !17 = !{!16, !9, i64 4}
  130. // CHECK:STDOUT: !18 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !7, line: 6, type: !19, spFlags: DISPFlagDefinition, unit: !6)
  131. // CHECK:STDOUT: !19 = !DISubroutineType(types: !20)
  132. // CHECK:STDOUT: !20 = !{null}
  133. // CHECK:STDOUT: !21 = !DILocation(line: 7, column: 18, scope: !18)
  134. // CHECK:STDOUT: !22 = !DILocation(line: 6, column: 1, scope: !18)
  135. // CHECK:STDOUT: ; ModuleID = 'call_copy.carbon'
  136. // CHECK:STDOUT: source_filename = "call_copy.carbon"
  137. // 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"
  138. // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
  139. // CHECK:STDOUT:
  140. // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress uwtable
  141. // CHECK:STDOUT: define dso_local void @_ZN4CopyC1ERKS_.carbon_thunk(ptr noundef %0, ptr noundef %return) #0 {
  142. // CHECK:STDOUT: entry:
  143. // CHECK:STDOUT: %.addr = alloca ptr, align 8
  144. // CHECK:STDOUT: %return.addr = alloca ptr, align 8
  145. // CHECK:STDOUT: store ptr %0, ptr %.addr, align 8, !tbaa !12
  146. // CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !12
  147. // CHECK:STDOUT: %1 = load ptr, ptr %return.addr, align 8, !tbaa !12
  148. // CHECK:STDOUT: %2 = load ptr, ptr %.addr, align 8, !tbaa !12
  149. // CHECK:STDOUT: call void @_ZN4CopyC1ERKS_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  150. // CHECK:STDOUT: ret void
  151. // CHECK:STDOUT: }
  152. // CHECK:STDOUT:
  153. // CHECK:STDOUT: declare void @_ZN4CopyC1ERKS_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #1
  154. // CHECK:STDOUT:
  155. // CHECK:STDOUT: ; Function Attrs: nounwind
  156. // CHECK:STDOUT: define void @_CCopy.Main(ptr sret([4 x i8]) %return, ptr %c) #2 !dbg !15 {
  157. // CHECK:STDOUT: entry:
  158. // CHECK:STDOUT: %.loc7_10.1.temp = alloca [4 x i8], align 1, !dbg !21
  159. // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_10.1.temp), !dbg !21
  160. // CHECK:STDOUT: call void @_ZN4CopyC1ERKS_.carbon_thunk(ptr %c, ptr %return), !dbg !21
  161. // CHECK:STDOUT: ret void, !dbg !22
  162. // CHECK:STDOUT: }
  163. // CHECK:STDOUT:
  164. // CHECK:STDOUT: ; Function Attrs: alwaysinline nounwind
  165. // CHECK:STDOUT: define void @"_COp:thunk.Copy.Cpp"(ptr sret([4 x i8]) %return, ptr %self) #3 !dbg !23 {
  166. // CHECK:STDOUT: entry:
  167. // CHECK:STDOUT: call void @_ZN4CopyC1ERKS_.carbon_thunk(ptr %self, ptr %return), !dbg !27
  168. // CHECK:STDOUT: ret void, !dbg !27
  169. // CHECK:STDOUT: }
  170. // CHECK:STDOUT:
  171. // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
  172. // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #4
  173. // CHECK:STDOUT:
  174. // CHECK:STDOUT: attributes #0 = { alwaysinline 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" }
  175. // CHECK:STDOUT: attributes #1 = { "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" }
  176. // CHECK:STDOUT: attributes #2 = { nounwind }
  177. // CHECK:STDOUT: attributes #3 = { alwaysinline nounwind }
  178. // CHECK:STDOUT: attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
  179. // CHECK:STDOUT:
  180. // CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4, !5}
  181. // CHECK:STDOUT: !llvm.dbg.cu = !{!6}
  182. // CHECK:STDOUT: !llvm.errno.tbaa = !{!8}
  183. // CHECK:STDOUT:
  184. // CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
  185. // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
  186. // CHECK:STDOUT: !2 = !{i32 1, !"wchar_size", i32 4}
  187. // CHECK:STDOUT: !3 = !{i32 8, !"PIC Level", i32 2}
  188. // CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
  189. // CHECK:STDOUT: !5 = !{i32 7, !"uwtable", i32 2}
  190. // CHECK:STDOUT: !6 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !7, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
  191. // CHECK:STDOUT: !7 = !DIFile(filename: "call_copy.carbon", directory: "")
  192. // CHECK:STDOUT: !8 = !{!9, !9, i64 0}
  193. // CHECK:STDOUT: !9 = !{!"int", !10, i64 0}
  194. // CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0}
  195. // CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"}
  196. // CHECK:STDOUT: !12 = !{!13, !13, i64 0}
  197. // CHECK:STDOUT: !13 = !{!"p1 _ZTS4Copy", !14, i64 0}
  198. // CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0}
  199. // CHECK:STDOUT: !15 = distinct !DISubprogram(name: "Copy", linkageName: "_CCopy.Main", scope: null, file: !7, line: 6, type: !16, spFlags: DISPFlagDefinition, unit: !6, retainedNodes: !19)
  200. // CHECK:STDOUT: !16 = !DISubroutineType(types: !17)
  201. // CHECK:STDOUT: !17 = !{!18, !18}
  202. // CHECK:STDOUT: !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 8)
  203. // CHECK:STDOUT: !19 = !{!20}
  204. // CHECK:STDOUT: !20 = !DILocalVariable(arg: 1, scope: !15, type: !18)
  205. // CHECK:STDOUT: !21 = !DILocation(line: 7, column: 10, scope: !15)
  206. // CHECK:STDOUT: !22 = !DILocation(line: 7, column: 3, scope: !15)
  207. // CHECK:STDOUT: !23 = distinct !DISubprogram(name: "Op", linkageName: "_COp:thunk.Copy.Cpp", scope: null, file: !24, line: 5, type: !16, spFlags: DISPFlagDefinition, unit: !6, retainedNodes: !25)
  208. // CHECK:STDOUT: !24 = !DIFile(filename: "./copy.h", directory: "")
  209. // CHECK:STDOUT: !25 = !{!26}
  210. // CHECK:STDOUT: !26 = !DILocalVariable(arg: 1, scope: !23, type: !18)
  211. // CHECK:STDOUT: !27 = !DILocation(line: 5, column: 3, scope: !23)
  212. // CHECK:STDOUT: ; ModuleID = 'call_c1_in_thunk.carbon'
  213. // CHECK:STDOUT: source_filename = "call_c1_in_thunk.carbon"
  214. // 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"
  215. // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
  216. // CHECK:STDOUT:
  217. // CHECK:STDOUT: $_ZN7DerivedC1Ev = comdat any
  218. // CHECK:STDOUT:
  219. // CHECK:STDOUT: $_ZTV7Derived = comdat any
  220. // CHECK:STDOUT:
  221. // CHECK:STDOUT: $_ZTT7Derived = comdat any
  222. // CHECK:STDOUT:
  223. // CHECK:STDOUT: $_ZTI7Derived = comdat any
  224. // CHECK:STDOUT:
  225. // CHECK:STDOUT: $_ZTS7Derived = comdat any
  226. // CHECK:STDOUT:
  227. // CHECK:STDOUT: $_ZTI4Base = comdat any
  228. // CHECK:STDOUT:
  229. // CHECK:STDOUT: $_ZTS4Base = comdat any
  230. // CHECK:STDOUT:
  231. // CHECK:STDOUT: @_ZTV7Derived = linkonce_odr dso_local unnamed_addr constant { [3 x ptr] } { [3 x ptr] [ptr null, ptr null, ptr @_ZTI7Derived] }, comdat, align 8
  232. // CHECK:STDOUT: @_ZTT7Derived = linkonce_odr dso_local unnamed_addr constant [1 x ptr] [ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr] }, ptr @_ZTV7Derived, i32 0, i32 0, i32 3)], comdat, align 8
  233. // CHECK:STDOUT: @_ZTI7Derived = linkonce_odr dso_local constant { ptr, ptr, i32, i32, ptr, i64 } { ptr getelementptr inbounds (ptr, ptr @_ZTVN10__cxxabiv121__vmi_class_type_infoE, i64 2), ptr @_ZTS7Derived, i32 0, i32 1, ptr @_ZTI4Base, i64 -6141 }, comdat, align 8
  234. // CHECK:STDOUT: @_ZTVN10__cxxabiv121__vmi_class_type_infoE = external global [0 x ptr]
  235. // CHECK:STDOUT: @_ZTS7Derived = linkonce_odr dso_local constant [9 x i8] c"7Derived\00", comdat, align 1
  236. // CHECK:STDOUT: @_ZTI4Base = linkonce_odr dso_local constant { ptr, ptr } { ptr getelementptr inbounds (ptr, ptr @_ZTVN10__cxxabiv117__class_type_infoE, i64 2), ptr @_ZTS4Base }, comdat, align 8
  237. // CHECK:STDOUT: @_ZTVN10__cxxabiv117__class_type_infoE = external global [0 x ptr]
  238. // CHECK:STDOUT: @_ZTS4Base = linkonce_odr dso_local constant [6 x i8] c"4Base\00", comdat, align 1
  239. // CHECK:STDOUT:
  240. // CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress nounwind uwtable
  241. // CHECK:STDOUT: define dso_local void @_ZN7DerivedC1Ev.carbon_thunk(ptr noundef %return) #0 {
  242. // CHECK:STDOUT: entry:
  243. // CHECK:STDOUT: %return.addr = alloca ptr, align 8
  244. // CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8, !tbaa !12
  245. // CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8, !tbaa !12
  246. // CHECK:STDOUT: call void @_ZN7DerivedC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #2
  247. // CHECK:STDOUT: ret void
  248. // CHECK:STDOUT: }
  249. // CHECK:STDOUT:
  250. // CHECK:STDOUT: ; Function Attrs: inlinehint mustprogress nounwind uwtable
  251. // CHECK:STDOUT: define linkonce_odr dso_local void @_ZN7DerivedC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %this) unnamed_addr #1 comdat align 2 {
  252. // CHECK:STDOUT: entry:
  253. // CHECK:STDOUT: %this.addr = alloca ptr, align 8
  254. // CHECK:STDOUT: store ptr %this, ptr %this.addr, align 8, !tbaa !12
  255. // CHECK:STDOUT: %this1 = load ptr, ptr %this.addr, align 8
  256. // CHECK:STDOUT: store ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr] }, ptr @_ZTV7Derived, i32 0, i32 0, i32 3), ptr %this1, align 8, !tbaa !15
  257. // CHECK:STDOUT: ret void
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT:
  260. // CHECK:STDOUT: ; Function Attrs: nounwind
  261. // CHECK:STDOUT: define void @_CF.Main() #2 !dbg !17 {
  262. // CHECK:STDOUT: entry:
  263. // CHECK:STDOUT: %.loc7_44.1.temp = alloca [8 x i8], align 1, !dbg !20
  264. // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_44.1.temp), !dbg !20
  265. // CHECK:STDOUT: call void @_ZN7DerivedC1Ev.carbon_thunk(ptr %.loc7_44.1.temp), !dbg !20
  266. // CHECK:STDOUT: ret void, !dbg !21
  267. // CHECK:STDOUT: }
  268. // CHECK:STDOUT:
  269. // CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
  270. // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #3
  271. // CHECK:STDOUT:
  272. // CHECK:STDOUT: ; uselistorder directives
  273. // CHECK:STDOUT: uselistorder ptr getelementptr inbounds inrange(-24, 0) ({ [3 x ptr] }, ptr @_ZTV7Derived, i32 0, i32 0, i32 3), { 1, 0 }
  274. // CHECK:STDOUT:
  275. // CHECK:STDOUT: attributes #0 = { 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" }
  276. // CHECK:STDOUT: attributes #1 = { inlinehint 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" }
  277. // CHECK:STDOUT: attributes #2 = { nounwind }
  278. // CHECK:STDOUT: attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
  279. // CHECK:STDOUT:
  280. // CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4, !5}
  281. // CHECK:STDOUT: !llvm.dbg.cu = !{!6}
  282. // CHECK:STDOUT: !llvm.errno.tbaa = !{!8}
  283. // CHECK:STDOUT:
  284. // CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
  285. // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
  286. // CHECK:STDOUT: !2 = !{i32 1, !"wchar_size", i32 4}
  287. // CHECK:STDOUT: !3 = !{i32 8, !"PIC Level", i32 2}
  288. // CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
  289. // CHECK:STDOUT: !5 = !{i32 7, !"uwtable", i32 2}
  290. // CHECK:STDOUT: !6 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !7, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
  291. // CHECK:STDOUT: !7 = !DIFile(filename: "call_c1_in_thunk.carbon", directory: "")
  292. // CHECK:STDOUT: !8 = !{!9, !9, i64 0}
  293. // CHECK:STDOUT: !9 = !{!"int", !10, i64 0}
  294. // CHECK:STDOUT: !10 = !{!"omnipotent char", !11, i64 0}
  295. // CHECK:STDOUT: !11 = !{!"Simple C++ TBAA"}
  296. // CHECK:STDOUT: !12 = !{!13, !13, i64 0}
  297. // CHECK:STDOUT: !13 = !{!"p1 _ZTS7Derived", !14, i64 0}
  298. // CHECK:STDOUT: !14 = !{!"any pointer", !10, i64 0}
  299. // CHECK:STDOUT: !15 = !{!16, !16, i64 0}
  300. // CHECK:STDOUT: !16 = !{!"vtable pointer", !11, i64 0}
  301. // CHECK:STDOUT: !17 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !7, line: 6, type: !18, spFlags: DISPFlagDefinition, unit: !6)
  302. // CHECK:STDOUT: !18 = !DISubroutineType(types: !19)
  303. // CHECK:STDOUT: !19 = !{null}
  304. // CHECK:STDOUT: !20 = !DILocation(line: 7, column: 24, scope: !17)
  305. // CHECK:STDOUT: !21 = !DILocation(line: 6, column: 1, scope: !17)