constructor.carbon 86 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096
  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/check/testdata/interop/cpp/class/constructor.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/class/constructor.carbon
  12. // ============================================================================
  13. // Default constructor
  14. // ============================================================================
  15. // --- default.h
  16. class C {
  17. public:
  18. C();
  19. };
  20. // --- import_default.carbon
  21. library "[[@TEST_NAME]]";
  22. import Cpp library "default.h";
  23. fn F() {
  24. //@dump-sem-ir-begin
  25. let unused c: Cpp.C = Cpp.C.C();
  26. //@dump-sem-ir-end
  27. }
  28. // ============================================================================
  29. // Non default constructor
  30. // ============================================================================
  31. // --- non_default.h
  32. class C {
  33. public:
  34. C(int x, int y);
  35. };
  36. // --- import_non_default.carbon
  37. library "[[@TEST_NAME]]";
  38. import Cpp library "non_default.h";
  39. fn F() {
  40. //@dump-sem-ir-begin
  41. let unused c: Cpp.C = Cpp.C.C(123, 456);
  42. //@dump-sem-ir-end
  43. }
  44. // ============================================================================
  45. // Multiple constructors
  46. // ============================================================================
  47. // --- multiple.h
  48. class C {
  49. public:
  50. C();
  51. C(int x, int y);
  52. };
  53. // --- import_multiple.carbon
  54. library "[[@TEST_NAME]]";
  55. import Cpp library "multiple.h";
  56. fn F() {
  57. //@dump-sem-ir-begin
  58. let unused c1: Cpp.C = Cpp.C.C();
  59. let unused c2: Cpp.C = Cpp.C.C(123, 456);
  60. //@dump-sem-ir-end
  61. }
  62. // ============================================================================
  63. // Constructor with default arguments
  64. // ============================================================================
  65. // --- default_arguments.h
  66. class C {
  67. public:
  68. C(int x, int y = 8);
  69. };
  70. // --- import_default_arguments.carbon
  71. library "[[@TEST_NAME]]";
  72. import Cpp library "default_arguments.h";
  73. fn F() {
  74. //@dump-sem-ir-begin
  75. let unused c1: Cpp.C = Cpp.C.C(8, 9);
  76. let unused c2: Cpp.C = Cpp.C.C(8);
  77. //@dump-sem-ir-end
  78. }
  79. // ============================================================================
  80. // Constructor templates
  81. // ============================================================================
  82. // --- template.h
  83. class C {
  84. public:
  85. C(int);
  86. template<typename T> C(T);
  87. };
  88. // --- import_template.carbon
  89. library "[[@TEST_NAME]]";
  90. import Cpp library "template.h";
  91. fn F() {
  92. //@dump-sem-ir-begin
  93. var c1: Cpp.C = Cpp.C.C(123);
  94. var unused c2: Cpp.C = Cpp.C.C(true);
  95. var unused c3: Cpp.C = Cpp.C.C(&c1);
  96. //@dump-sem-ir-end
  97. }
  98. // ============================================================================
  99. // Deleted constructor
  100. // ============================================================================
  101. // --- deleted.h
  102. class C {
  103. public:
  104. C() = delete;
  105. };
  106. class D {
  107. public:
  108. D(int) = delete;
  109. D(short);
  110. };
  111. // --- fail_import_deleted.carbon
  112. library "[[@TEST_NAME]]";
  113. import Cpp library "deleted.h";
  114. fn F() {
  115. // CHECK:STDERR: fail_import_deleted.carbon:[[@LINE+8]]:33: error: call to deleted function 'C' [CppInteropParseError]
  116. // CHECK:STDERR: 15 | let unused c: Cpp.C = Cpp.C.C();
  117. // CHECK:STDERR: | ^
  118. // CHECK:STDERR: fail_import_deleted.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
  119. // CHECK:STDERR: ./deleted.h:4:3: note: candidate constructor has been explicitly deleted [CppInteropParseNote]
  120. // CHECK:STDERR: 4 | C() = delete;
  121. // CHECK:STDERR: | ^
  122. // CHECK:STDERR:
  123. let unused c: Cpp.C = Cpp.C.C();
  124. // CHECK:STDERR: fail_import_deleted.carbon:[[@LINE+12]]:34: error: call to deleted function 'D' [CppInteropParseError]
  125. // CHECK:STDERR: 29 | let unused d: Cpp.D = Cpp.D.D(0);
  126. // CHECK:STDERR: | ^
  127. // CHECK:STDERR: fail_import_deleted.carbon:[[@LINE-16]]:10: in file included here [InCppInclude]
  128. // CHECK:STDERR: ./deleted.h:9:3: note: candidate constructor has been explicitly deleted [CppInteropParseNote]
  129. // CHECK:STDERR: 9 | D(int) = delete;
  130. // CHECK:STDERR: | ^
  131. // CHECK:STDERR: fail_import_deleted.carbon:[[@LINE-20]]:10: in file included here [InCppInclude]
  132. // CHECK:STDERR: ./deleted.h:10:3: note: candidate constructor [CppInteropParseNote]
  133. // CHECK:STDERR: 10 | D(short);
  134. // CHECK:STDERR: | ^
  135. // CHECK:STDERR:
  136. let unused d: Cpp.D = Cpp.D.D(0);
  137. }
  138. // ============================================================================
  139. // Implicit single argument constructor
  140. // ============================================================================
  141. // --- implicit_single_argument.h
  142. class C {
  143. public:
  144. C(int x);
  145. };
  146. // --- import_implicit_single_argument.carbon
  147. library "[[@TEST_NAME]]";
  148. import Cpp library "implicit_single_argument.h";
  149. fn F() {
  150. //@dump-sem-ir-begin
  151. let unused c1: Cpp.C = Cpp.C.C(8);
  152. let unused c2: Cpp.C = 8 as i32;
  153. //@dump-sem-ir-end
  154. }
  155. // ============================================================================
  156. // Implicit multi arguments constructor
  157. // ============================================================================
  158. // --- implicit_multi_arguments.h
  159. class C {
  160. public:
  161. C(int x, int y = 8);
  162. };
  163. // --- import_implicit_multi_arguments.carbon
  164. library "[[@TEST_NAME]]";
  165. import Cpp library "implicit_multi_arguments.h";
  166. fn F() {
  167. //@dump-sem-ir-begin
  168. let unused c1: Cpp.C = Cpp.C.C(8, 9);
  169. let unused c2: Cpp.C = Cpp.C.C(8);
  170. let unused c3: Cpp.C = 8 as i32;
  171. //@dump-sem-ir-end
  172. }
  173. // ============================================================================
  174. // Trying to call a constructor of an incomplete class
  175. // ============================================================================
  176. // --- incomplete.h
  177. class C;
  178. // --- fail_import_incomplete.carbon
  179. library "[[@TEST_NAME]]";
  180. import Cpp library "incomplete.h";
  181. fn F() {
  182. // CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE+8]]:4: error: member access into incomplete class `Cpp.C` [QualifiedExprInIncompleteClassScope]
  183. // CHECK:STDERR: Cpp.C.C();
  184. // CHECK:STDERR: ^~~~~~~
  185. // CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
  186. // CHECK:STDERR: ./incomplete.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
  187. // CHECK:STDERR: class C;
  188. // CHECK:STDERR: ^
  189. // CHECK:STDERR:
  190. Cpp.C.C();
  191. }
  192. // CHECK:STDOUT: --- import_default.carbon
  193. // CHECK:STDOUT:
  194. // CHECK:STDOUT: constants {
  195. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  196. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  197. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  198. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  199. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  200. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  201. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  202. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  203. // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete]
  204. // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete]
  205. // CHECK:STDOUT: }
  206. // CHECK:STDOUT:
  207. // CHECK:STDOUT: imports {
  208. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  209. // CHECK:STDOUT: .C = %C.decl
  210. // CHECK:STDOUT: import Cpp//...
  211. // CHECK:STDOUT: }
  212. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  213. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete = constants.%C.C.cpp_overload_set.value]
  214. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  215. // CHECK:STDOUT: <elided>
  216. // CHECK:STDOUT: } {
  217. // CHECK:STDOUT: <elided>
  218. // CHECK:STDOUT: }
  219. // CHECK:STDOUT: }
  220. // CHECK:STDOUT:
  221. // CHECK:STDOUT: fn @F() {
  222. // CHECK:STDOUT: !entry:
  223. // CHECK:STDOUT: name_binding_decl {
  224. // CHECK:STDOUT: %c.patt: %pattern_type.217 = value_binding_pattern c [concrete]
  225. // CHECK:STDOUT: }
  226. // CHECK:STDOUT: %Cpp.ref.loc8_25: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  227. // CHECK:STDOUT: %C.ref.loc8_28: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  228. // CHECK:STDOUT: %C.ref.loc8_30: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  229. // CHECK:STDOUT: %.loc8_33.1: ref %C = temporary_storage
  230. // CHECK:STDOUT: %addr: %ptr.d9e = addr_of %.loc8_33.1
  231. // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr)
  232. // CHECK:STDOUT: %.loc8_33.2: init %C to %.loc8_33.1 = mark_in_place_init %C__carbon_thunk.call
  233. // CHECK:STDOUT: %.loc8_20: type = splice_block %C.ref.loc8_20 [concrete = constants.%C] {
  234. // CHECK:STDOUT: %Cpp.ref.loc8_17: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  235. // CHECK:STDOUT: %C.ref.loc8_20: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  236. // CHECK:STDOUT: }
  237. // CHECK:STDOUT: %.loc8_33.3: ref %C = temporary %.loc8_33.1, %.loc8_33.2
  238. // CHECK:STDOUT: %.loc8_33.4: %C = acquire_value %.loc8_33.3
  239. // CHECK:STDOUT: %c: %C = value_binding c, %.loc8_33.4
  240. // CHECK:STDOUT: %C.cpp_destructor.bound: <bound method> = bound_method %.loc8_33.3, constants.%C.cpp_destructor
  241. // CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call %C.cpp_destructor.bound(%.loc8_33.3)
  242. // CHECK:STDOUT: <elided>
  243. // CHECK:STDOUT: }
  244. // CHECK:STDOUT:
  245. // CHECK:STDOUT: --- import_non_default.carbon
  246. // CHECK:STDOUT:
  247. // CHECK:STDOUT: constants {
  248. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  249. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  250. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  251. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  252. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  253. // CHECK:STDOUT: %int_123.fff: Core.IntLiteral = int_value 123 [concrete]
  254. // CHECK:STDOUT: %int_456.010: Core.IntLiteral = int_value 456 [concrete]
  255. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  256. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  257. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  258. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  259. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  260. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  261. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  262. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  263. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  264. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  265. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  266. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  267. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  268. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs(%i32, %ImplicitAs.facet) [concrete]
  269. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet [concrete]
  270. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f5c: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  271. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  272. // CHECK:STDOUT: %bound_method.db6: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  273. // CHECK:STDOUT: %int_123.f7f: %i32 = int_value 123 [concrete]
  274. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.266: <bound method> = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  275. // CHECK:STDOUT: %bound_method.f41: <bound method> = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  276. // CHECK:STDOUT: %int_456.d17: %i32 = int_value 456 [concrete]
  277. // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete]
  278. // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete]
  279. // CHECK:STDOUT: }
  280. // CHECK:STDOUT:
  281. // CHECK:STDOUT: imports {
  282. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  283. // CHECK:STDOUT: .C = %C.decl
  284. // CHECK:STDOUT: import Cpp//...
  285. // CHECK:STDOUT: }
  286. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  287. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete = constants.%C.C.cpp_overload_set.value]
  288. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  289. // CHECK:STDOUT: <elided>
  290. // CHECK:STDOUT: } {
  291. // CHECK:STDOUT: <elided>
  292. // CHECK:STDOUT: }
  293. // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
  294. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  295. // CHECK:STDOUT: }
  296. // CHECK:STDOUT:
  297. // CHECK:STDOUT: fn @F() {
  298. // CHECK:STDOUT: !entry:
  299. // CHECK:STDOUT: name_binding_decl {
  300. // CHECK:STDOUT: %c.patt: %pattern_type.217 = value_binding_pattern c [concrete]
  301. // CHECK:STDOUT: }
  302. // CHECK:STDOUT: %Cpp.ref.loc8_25: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  303. // CHECK:STDOUT: %C.ref.loc8_28: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  304. // CHECK:STDOUT: %C.ref.loc8_30: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  305. // CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [concrete = constants.%int_123.fff]
  306. // CHECK:STDOUT: %int_456: Core.IntLiteral = int_value 456 [concrete = constants.%int_456.010]
  307. // CHECK:STDOUT: %.loc8_41.1: ref %C = temporary_storage
  308. // CHECK:STDOUT: %impl.elem0.loc8_33: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  309. // CHECK:STDOUT: %bound_method.loc8_33.1: <bound method> = bound_method %int_123, %impl.elem0.loc8_33 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f5c]
  310. // CHECK:STDOUT: %specific_fn.loc8_33: <specific function> = specific_function %impl.elem0.loc8_33, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  311. // CHECK:STDOUT: %bound_method.loc8_33.2: <bound method> = bound_method %int_123, %specific_fn.loc8_33 [concrete = constants.%bound_method.db6]
  312. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_33: init %i32 = call %bound_method.loc8_33.2(%int_123) [concrete = constants.%int_123.f7f]
  313. // CHECK:STDOUT: %.loc8_33.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_33 [concrete = constants.%int_123.f7f]
  314. // CHECK:STDOUT: %.loc8_33.2: %i32 = converted %int_123, %.loc8_33.1 [concrete = constants.%int_123.f7f]
  315. // CHECK:STDOUT: %impl.elem0.loc8_38: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  316. // CHECK:STDOUT: %bound_method.loc8_38.1: <bound method> = bound_method %int_456, %impl.elem0.loc8_38 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.266]
  317. // CHECK:STDOUT: %specific_fn.loc8_38: <specific function> = specific_function %impl.elem0.loc8_38, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  318. // CHECK:STDOUT: %bound_method.loc8_38.2: <bound method> = bound_method %int_456, %specific_fn.loc8_38 [concrete = constants.%bound_method.f41]
  319. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_38: init %i32 = call %bound_method.loc8_38.2(%int_456) [concrete = constants.%int_456.d17]
  320. // CHECK:STDOUT: %.loc8_38.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_38 [concrete = constants.%int_456.d17]
  321. // CHECK:STDOUT: %.loc8_38.2: %i32 = converted %int_456, %.loc8_38.1 [concrete = constants.%int_456.d17]
  322. // CHECK:STDOUT: %addr: %ptr.d9e = addr_of %.loc8_41.1
  323. // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc8_33.2, %.loc8_38.2, %addr)
  324. // CHECK:STDOUT: %.loc8_41.2: init %C to %.loc8_41.1 = mark_in_place_init %C__carbon_thunk.call
  325. // CHECK:STDOUT: %.loc8_20: type = splice_block %C.ref.loc8_20 [concrete = constants.%C] {
  326. // CHECK:STDOUT: %Cpp.ref.loc8_17: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  327. // CHECK:STDOUT: %C.ref.loc8_20: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  328. // CHECK:STDOUT: }
  329. // CHECK:STDOUT: %.loc8_41.3: ref %C = temporary %.loc8_41.1, %.loc8_41.2
  330. // CHECK:STDOUT: %.loc8_41.4: %C = acquire_value %.loc8_41.3
  331. // CHECK:STDOUT: %c: %C = value_binding c, %.loc8_41.4
  332. // CHECK:STDOUT: %C.cpp_destructor.bound: <bound method> = bound_method %.loc8_41.3, constants.%C.cpp_destructor
  333. // CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call %C.cpp_destructor.bound(%.loc8_41.3)
  334. // CHECK:STDOUT: <elided>
  335. // CHECK:STDOUT: }
  336. // CHECK:STDOUT:
  337. // CHECK:STDOUT: --- import_multiple.carbon
  338. // CHECK:STDOUT:
  339. // CHECK:STDOUT: constants {
  340. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  341. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  342. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  343. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  344. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  345. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  346. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.1: type = fn_type @C__carbon_thunk.1 [concrete]
  347. // CHECK:STDOUT: %C__carbon_thunk.d98342.1: %C__carbon_thunk.type.65f120.1 = struct_value () [concrete]
  348. // CHECK:STDOUT: %int_123.fff: Core.IntLiteral = int_value 123 [concrete]
  349. // CHECK:STDOUT: %int_456.010: Core.IntLiteral = int_value 456 [concrete]
  350. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  351. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  352. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.2: type = fn_type @C__carbon_thunk.2 [concrete]
  353. // CHECK:STDOUT: %C__carbon_thunk.d98342.2: %C__carbon_thunk.type.65f120.2 = struct_value () [concrete]
  354. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  355. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  356. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  357. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  358. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  359. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  360. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  361. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  362. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs(%i32, %ImplicitAs.facet) [concrete]
  363. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet [concrete]
  364. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f5c: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  365. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  366. // CHECK:STDOUT: %bound_method.db6: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  367. // CHECK:STDOUT: %int_123.f7f: %i32 = int_value 123 [concrete]
  368. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.266: <bound method> = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  369. // CHECK:STDOUT: %bound_method.f41: <bound method> = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  370. // CHECK:STDOUT: %int_456.d17: %i32 = int_value 456 [concrete]
  371. // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete]
  372. // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete]
  373. // CHECK:STDOUT: }
  374. // CHECK:STDOUT:
  375. // CHECK:STDOUT: imports {
  376. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  377. // CHECK:STDOUT: .C = %C.decl
  378. // CHECK:STDOUT: import Cpp//...
  379. // CHECK:STDOUT: }
  380. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  381. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete = constants.%C.C.cpp_overload_set.value]
  382. // CHECK:STDOUT: %C__carbon_thunk.decl.8acdfe.1: %C__carbon_thunk.type.65f120.1 = fn_decl @C__carbon_thunk.1 [concrete = constants.%C__carbon_thunk.d98342.1] {
  383. // CHECK:STDOUT: <elided>
  384. // CHECK:STDOUT: } {
  385. // CHECK:STDOUT: <elided>
  386. // CHECK:STDOUT: }
  387. // CHECK:STDOUT: %C__carbon_thunk.decl.8acdfe.2: %C__carbon_thunk.type.65f120.2 = fn_decl @C__carbon_thunk.2 [concrete = constants.%C__carbon_thunk.d98342.2] {
  388. // CHECK:STDOUT: <elided>
  389. // CHECK:STDOUT: } {
  390. // CHECK:STDOUT: <elided>
  391. // CHECK:STDOUT: }
  392. // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
  393. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  394. // CHECK:STDOUT: }
  395. // CHECK:STDOUT:
  396. // CHECK:STDOUT: fn @F() {
  397. // CHECK:STDOUT: !entry:
  398. // CHECK:STDOUT: name_binding_decl {
  399. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = value_binding_pattern c1 [concrete]
  400. // CHECK:STDOUT: }
  401. // CHECK:STDOUT: %Cpp.ref.loc8_26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  402. // CHECK:STDOUT: %C.ref.loc8_29: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  403. // CHECK:STDOUT: %C.ref.loc8_31: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  404. // CHECK:STDOUT: %.loc8_34.1: ref %C = temporary_storage
  405. // CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_34.1
  406. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%addr.loc8)
  407. // CHECK:STDOUT: %.loc8_34.2: init %C to %.loc8_34.1 = mark_in_place_init %C__carbon_thunk.call.loc8
  408. // CHECK:STDOUT: %.loc8_21: type = splice_block %C.ref.loc8_21 [concrete = constants.%C] {
  409. // CHECK:STDOUT: %Cpp.ref.loc8_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  410. // CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  411. // CHECK:STDOUT: }
  412. // CHECK:STDOUT: %.loc8_34.3: ref %C = temporary %.loc8_34.1, %.loc8_34.2
  413. // CHECK:STDOUT: %.loc8_34.4: %C = acquire_value %.loc8_34.3
  414. // CHECK:STDOUT: %c1: %C = value_binding c1, %.loc8_34.4
  415. // CHECK:STDOUT: name_binding_decl {
  416. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = value_binding_pattern c2 [concrete]
  417. // CHECK:STDOUT: }
  418. // CHECK:STDOUT: %Cpp.ref.loc9_26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  419. // CHECK:STDOUT: %C.ref.loc9_29: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  420. // CHECK:STDOUT: %C.ref.loc9_31: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  421. // CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [concrete = constants.%int_123.fff]
  422. // CHECK:STDOUT: %int_456: Core.IntLiteral = int_value 456 [concrete = constants.%int_456.010]
  423. // CHECK:STDOUT: %.loc9_42.1: ref %C = temporary_storage
  424. // CHECK:STDOUT: %impl.elem0.loc9_34: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  425. // CHECK:STDOUT: %bound_method.loc9_34.1: <bound method> = bound_method %int_123, %impl.elem0.loc9_34 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f5c]
  426. // CHECK:STDOUT: %specific_fn.loc9_34: <specific function> = specific_function %impl.elem0.loc9_34, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  427. // CHECK:STDOUT: %bound_method.loc9_34.2: <bound method> = bound_method %int_123, %specific_fn.loc9_34 [concrete = constants.%bound_method.db6]
  428. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_34: init %i32 = call %bound_method.loc9_34.2(%int_123) [concrete = constants.%int_123.f7f]
  429. // CHECK:STDOUT: %.loc9_34.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_34 [concrete = constants.%int_123.f7f]
  430. // CHECK:STDOUT: %.loc9_34.2: %i32 = converted %int_123, %.loc9_34.1 [concrete = constants.%int_123.f7f]
  431. // CHECK:STDOUT: %impl.elem0.loc9_39: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  432. // CHECK:STDOUT: %bound_method.loc9_39.1: <bound method> = bound_method %int_456, %impl.elem0.loc9_39 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.266]
  433. // CHECK:STDOUT: %specific_fn.loc9_39: <specific function> = specific_function %impl.elem0.loc9_39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  434. // CHECK:STDOUT: %bound_method.loc9_39.2: <bound method> = bound_method %int_456, %specific_fn.loc9_39 [concrete = constants.%bound_method.f41]
  435. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_39: init %i32 = call %bound_method.loc9_39.2(%int_456) [concrete = constants.%int_456.d17]
  436. // CHECK:STDOUT: %.loc9_39.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_39 [concrete = constants.%int_456.d17]
  437. // CHECK:STDOUT: %.loc9_39.2: %i32 = converted %int_456, %.loc9_39.1 [concrete = constants.%int_456.d17]
  438. // CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_42.1
  439. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc9_34.2, %.loc9_39.2, %addr.loc9)
  440. // CHECK:STDOUT: %.loc9_42.2: init %C to %.loc9_42.1 = mark_in_place_init %C__carbon_thunk.call.loc9
  441. // CHECK:STDOUT: %.loc9_21: type = splice_block %C.ref.loc9_21 [concrete = constants.%C] {
  442. // CHECK:STDOUT: %Cpp.ref.loc9_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  443. // CHECK:STDOUT: %C.ref.loc9_21: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  444. // CHECK:STDOUT: }
  445. // CHECK:STDOUT: %.loc9_42.3: ref %C = temporary %.loc9_42.1, %.loc9_42.2
  446. // CHECK:STDOUT: %.loc9_42.4: %C = acquire_value %.loc9_42.3
  447. // CHECK:STDOUT: %c2: %C = value_binding c2, %.loc9_42.4
  448. // CHECK:STDOUT: %C.cpp_destructor.bound.loc9: <bound method> = bound_method %.loc9_42.3, constants.%C.cpp_destructor
  449. // CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_42.3)
  450. // CHECK:STDOUT: %C.cpp_destructor.bound.loc8: <bound method> = bound_method %.loc8_34.3, constants.%C.cpp_destructor
  451. // CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_34.3)
  452. // CHECK:STDOUT: <elided>
  453. // CHECK:STDOUT: }
  454. // CHECK:STDOUT:
  455. // CHECK:STDOUT: --- import_default_arguments.carbon
  456. // CHECK:STDOUT:
  457. // CHECK:STDOUT: constants {
  458. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  459. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  460. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  461. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  462. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  463. // CHECK:STDOUT: %int_8.b85: Core.IntLiteral = int_value 8 [concrete]
  464. // CHECK:STDOUT: %int_9.988: Core.IntLiteral = int_value 9 [concrete]
  465. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  466. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  467. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  468. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.1: type = fn_type @C__carbon_thunk.1 [concrete]
  469. // CHECK:STDOUT: %C__carbon_thunk.d98342.1: %C__carbon_thunk.type.65f120.1 = struct_value () [concrete]
  470. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  471. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  472. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  473. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  474. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  475. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  476. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  477. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  478. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs(%i32, %ImplicitAs.facet) [concrete]
  479. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet [concrete]
  480. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.62f: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  481. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  482. // CHECK:STDOUT: %bound_method.e07: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  483. // CHECK:STDOUT: %int_8.98c: %i32 = int_value 8 [concrete]
  484. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.87d: <bound method> = bound_method %int_9.988, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  485. // CHECK:STDOUT: %bound_method.661: <bound method> = bound_method %int_9.988, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  486. // CHECK:STDOUT: %int_9.f88: %i32 = int_value 9 [concrete]
  487. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.2: type = fn_type @C__carbon_thunk.2 [concrete]
  488. // CHECK:STDOUT: %C__carbon_thunk.d98342.2: %C__carbon_thunk.type.65f120.2 = struct_value () [concrete]
  489. // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete]
  490. // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete]
  491. // CHECK:STDOUT: }
  492. // CHECK:STDOUT:
  493. // CHECK:STDOUT: imports {
  494. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  495. // CHECK:STDOUT: .C = %C.decl
  496. // CHECK:STDOUT: import Cpp//...
  497. // CHECK:STDOUT: }
  498. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  499. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete = constants.%C.C.cpp_overload_set.value]
  500. // CHECK:STDOUT: %C__carbon_thunk.decl.8acdfe.1: %C__carbon_thunk.type.65f120.1 = fn_decl @C__carbon_thunk.1 [concrete = constants.%C__carbon_thunk.d98342.1] {
  501. // CHECK:STDOUT: <elided>
  502. // CHECK:STDOUT: } {
  503. // CHECK:STDOUT: <elided>
  504. // CHECK:STDOUT: }
  505. // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
  506. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  507. // CHECK:STDOUT: %C__carbon_thunk.decl.8acdfe.2: %C__carbon_thunk.type.65f120.2 = fn_decl @C__carbon_thunk.2 [concrete = constants.%C__carbon_thunk.d98342.2] {
  508. // CHECK:STDOUT: <elided>
  509. // CHECK:STDOUT: } {
  510. // CHECK:STDOUT: <elided>
  511. // CHECK:STDOUT: }
  512. // CHECK:STDOUT: }
  513. // CHECK:STDOUT:
  514. // CHECK:STDOUT: fn @F() {
  515. // CHECK:STDOUT: !entry:
  516. // CHECK:STDOUT: name_binding_decl {
  517. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = value_binding_pattern c1 [concrete]
  518. // CHECK:STDOUT: }
  519. // CHECK:STDOUT: %Cpp.ref.loc8_26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  520. // CHECK:STDOUT: %C.ref.loc8_29: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  521. // CHECK:STDOUT: %C.ref.loc8_31: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  522. // CHECK:STDOUT: %int_8.loc8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  523. // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [concrete = constants.%int_9.988]
  524. // CHECK:STDOUT: %.loc8_38.1: ref %C = temporary_storage
  525. // CHECK:STDOUT: %impl.elem0.loc8_34: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  526. // CHECK:STDOUT: %bound_method.loc8_34.1: <bound method> = bound_method %int_8.loc8, %impl.elem0.loc8_34 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.62f]
  527. // CHECK:STDOUT: %specific_fn.loc8_34: <specific function> = specific_function %impl.elem0.loc8_34, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  528. // CHECK:STDOUT: %bound_method.loc8_34.2: <bound method> = bound_method %int_8.loc8, %specific_fn.loc8_34 [concrete = constants.%bound_method.e07]
  529. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_34: init %i32 = call %bound_method.loc8_34.2(%int_8.loc8) [concrete = constants.%int_8.98c]
  530. // CHECK:STDOUT: %.loc8_34.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_34 [concrete = constants.%int_8.98c]
  531. // CHECK:STDOUT: %.loc8_34.2: %i32 = converted %int_8.loc8, %.loc8_34.1 [concrete = constants.%int_8.98c]
  532. // CHECK:STDOUT: %impl.elem0.loc8_37: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  533. // CHECK:STDOUT: %bound_method.loc8_37.1: <bound method> = bound_method %int_9, %impl.elem0.loc8_37 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.87d]
  534. // CHECK:STDOUT: %specific_fn.loc8_37: <specific function> = specific_function %impl.elem0.loc8_37, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  535. // CHECK:STDOUT: %bound_method.loc8_37.2: <bound method> = bound_method %int_9, %specific_fn.loc8_37 [concrete = constants.%bound_method.661]
  536. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_37: init %i32 = call %bound_method.loc8_37.2(%int_9) [concrete = constants.%int_9.f88]
  537. // CHECK:STDOUT: %.loc8_37.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_37 [concrete = constants.%int_9.f88]
  538. // CHECK:STDOUT: %.loc8_37.2: %i32 = converted %int_9, %.loc8_37.1 [concrete = constants.%int_9.f88]
  539. // CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_38.1
  540. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%.loc8_34.2, %.loc8_37.2, %addr.loc8)
  541. // CHECK:STDOUT: %.loc8_38.2: init %C to %.loc8_38.1 = mark_in_place_init %C__carbon_thunk.call.loc8
  542. // CHECK:STDOUT: %.loc8_21: type = splice_block %C.ref.loc8_21 [concrete = constants.%C] {
  543. // CHECK:STDOUT: %Cpp.ref.loc8_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  544. // CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  545. // CHECK:STDOUT: }
  546. // CHECK:STDOUT: %.loc8_38.3: ref %C = temporary %.loc8_38.1, %.loc8_38.2
  547. // CHECK:STDOUT: %.loc8_38.4: %C = acquire_value %.loc8_38.3
  548. // CHECK:STDOUT: %c1: %C = value_binding c1, %.loc8_38.4
  549. // CHECK:STDOUT: name_binding_decl {
  550. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = value_binding_pattern c2 [concrete]
  551. // CHECK:STDOUT: }
  552. // CHECK:STDOUT: %Cpp.ref.loc9_26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  553. // CHECK:STDOUT: %C.ref.loc9_29: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  554. // CHECK:STDOUT: %C.ref.loc9_31: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  555. // CHECK:STDOUT: %int_8.loc9: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  556. // CHECK:STDOUT: %.loc9_35.1: ref %C = temporary_storage
  557. // CHECK:STDOUT: %impl.elem0.loc9: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  558. // CHECK:STDOUT: %bound_method.loc9_34.1: <bound method> = bound_method %int_8.loc9, %impl.elem0.loc9 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.62f]
  559. // CHECK:STDOUT: %specific_fn.loc9: <specific function> = specific_function %impl.elem0.loc9, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  560. // CHECK:STDOUT: %bound_method.loc9_34.2: <bound method> = bound_method %int_8.loc9, %specific_fn.loc9 [concrete = constants.%bound_method.e07]
  561. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9: init %i32 = call %bound_method.loc9_34.2(%int_8.loc9) [concrete = constants.%int_8.98c]
  562. // CHECK:STDOUT: %.loc9_34.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9 [concrete = constants.%int_8.98c]
  563. // CHECK:STDOUT: %.loc9_34.2: %i32 = converted %int_8.loc9, %.loc9_34.1 [concrete = constants.%int_8.98c]
  564. // CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_35.1
  565. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc9_34.2, %addr.loc9)
  566. // CHECK:STDOUT: %.loc9_35.2: init %C to %.loc9_35.1 = mark_in_place_init %C__carbon_thunk.call.loc9
  567. // CHECK:STDOUT: %.loc9_21: type = splice_block %C.ref.loc9_21 [concrete = constants.%C] {
  568. // CHECK:STDOUT: %Cpp.ref.loc9_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  569. // CHECK:STDOUT: %C.ref.loc9_21: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  570. // CHECK:STDOUT: }
  571. // CHECK:STDOUT: %.loc9_35.3: ref %C = temporary %.loc9_35.1, %.loc9_35.2
  572. // CHECK:STDOUT: %.loc9_35.4: %C = acquire_value %.loc9_35.3
  573. // CHECK:STDOUT: %c2: %C = value_binding c2, %.loc9_35.4
  574. // CHECK:STDOUT: %C.cpp_destructor.bound.loc9: <bound method> = bound_method %.loc9_35.3, constants.%C.cpp_destructor
  575. // CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_35.3)
  576. // CHECK:STDOUT: %C.cpp_destructor.bound.loc8: <bound method> = bound_method %.loc8_38.3, constants.%C.cpp_destructor
  577. // CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_38.3)
  578. // CHECK:STDOUT: <elided>
  579. // CHECK:STDOUT: }
  580. // CHECK:STDOUT:
  581. // CHECK:STDOUT: --- import_template.carbon
  582. // CHECK:STDOUT:
  583. // CHECK:STDOUT: constants {
  584. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  585. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  586. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  587. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  588. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  589. // CHECK:STDOUT: %int_123.fff: Core.IntLiteral = int_value 123 [concrete]
  590. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  591. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  592. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  593. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.1: type = fn_type @C__carbon_thunk.1 [concrete]
  594. // CHECK:STDOUT: %C__carbon_thunk.d98342.1: %C__carbon_thunk.type.65f120.1 = struct_value () [concrete]
  595. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  596. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  597. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  598. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  599. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  600. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  601. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  602. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  603. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs(%i32, %ImplicitAs.facet) [concrete]
  604. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet [concrete]
  605. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  606. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  607. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  608. // CHECK:STDOUT: %int_123.f7f: %i32 = int_value 123 [concrete]
  609. // CHECK:STDOUT: %true: bool = bool_literal true [concrete]
  610. // CHECK:STDOUT: %ptr.bb2: type = ptr_type bool [concrete]
  611. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.2: type = fn_type @C__carbon_thunk.2 [concrete]
  612. // CHECK:STDOUT: %C__carbon_thunk.d98342.2: %C__carbon_thunk.type.65f120.2 = struct_value () [concrete]
  613. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  614. // CHECK:STDOUT: %Copy.impl_witness.348: <witness> = impl_witness imports.%Copy.impl_witness_table.3cc [concrete]
  615. // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value bool, (%Copy.impl_witness.348) [concrete]
  616. // CHECK:STDOUT: %Copy.WithSelf.Op.type.6dd: type = fn_type @Copy.WithSelf.Op, @Copy(%Copy.facet) [concrete]
  617. // CHECK:STDOUT: %.86d: type = fn_type_with_self_type %Copy.WithSelf.Op.type.6dd, %Copy.facet [concrete]
  618. // CHECK:STDOUT: %bool.as.Copy.impl.Op.type: type = fn_type @bool.as.Copy.impl.Op [concrete]
  619. // CHECK:STDOUT: %bool.as.Copy.impl.Op: %bool.as.Copy.impl.Op.type = struct_value () [concrete]
  620. // CHECK:STDOUT: %bool.as.Copy.impl.Op.bound: <bound method> = bound_method %true, %bool.as.Copy.impl.Op [concrete]
  621. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.3: type = fn_type @C__carbon_thunk.3 [concrete]
  622. // CHECK:STDOUT: %C__carbon_thunk.d98342.3: %C__carbon_thunk.type.65f120.3 = struct_value () [concrete]
  623. // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete]
  624. // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete]
  625. // CHECK:STDOUT: %DestroyOp.type: type = fn_type @DestroyOp [concrete]
  626. // CHECK:STDOUT: %DestroyOp: %DestroyOp.type = struct_value () [concrete]
  627. // CHECK:STDOUT: }
  628. // CHECK:STDOUT:
  629. // CHECK:STDOUT: imports {
  630. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  631. // CHECK:STDOUT: .C = %C.decl
  632. // CHECK:STDOUT: import Cpp//...
  633. // CHECK:STDOUT: }
  634. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  635. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete = constants.%C.C.cpp_overload_set.value]
  636. // CHECK:STDOUT: %C__carbon_thunk.decl.8acdfe.1: %C__carbon_thunk.type.65f120.1 = fn_decl @C__carbon_thunk.1 [concrete = constants.%C__carbon_thunk.d98342.1] {
  637. // CHECK:STDOUT: <elided>
  638. // CHECK:STDOUT: } {
  639. // CHECK:STDOUT: <elided>
  640. // CHECK:STDOUT: }
  641. // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
  642. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  643. // CHECK:STDOUT: %C__carbon_thunk.decl.8acdfe.2: %C__carbon_thunk.type.65f120.2 = fn_decl @C__carbon_thunk.2 [concrete = constants.%C__carbon_thunk.d98342.2] {
  644. // CHECK:STDOUT: <elided>
  645. // CHECK:STDOUT: } {
  646. // CHECK:STDOUT: <elided>
  647. // CHECK:STDOUT: }
  648. // CHECK:STDOUT: %Core.import_ref.595: %bool.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, loaded [concrete = constants.%bool.as.Copy.impl.Op]
  649. // CHECK:STDOUT: %Copy.impl_witness_table.3cc = impl_witness_table (%Core.import_ref.595), @bool.as.Copy.impl [concrete]
  650. // CHECK:STDOUT: %C__carbon_thunk.decl.8acdfe.3: %C__carbon_thunk.type.65f120.3 = fn_decl @C__carbon_thunk.3 [concrete = constants.%C__carbon_thunk.d98342.3] {
  651. // CHECK:STDOUT: <elided>
  652. // CHECK:STDOUT: } {
  653. // CHECK:STDOUT: <elided>
  654. // CHECK:STDOUT: }
  655. // CHECK:STDOUT: }
  656. // CHECK:STDOUT:
  657. // CHECK:STDOUT: fn @F() {
  658. // CHECK:STDOUT: !entry:
  659. // CHECK:STDOUT: name_binding_decl {
  660. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = ref_binding_pattern c1 [concrete]
  661. // CHECK:STDOUT: %c1.var_patt: %pattern_type.217 = var_pattern %c1.patt [concrete]
  662. // CHECK:STDOUT: }
  663. // CHECK:STDOUT: %c1.var: ref %C = var %c1.var_patt
  664. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  665. // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  666. // CHECK:STDOUT: %C.ref.loc8_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  667. // CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [concrete = constants.%int_123.fff]
  668. // CHECK:STDOUT: %.loc8_3: ref %C = splice_block %c1.var {}
  669. // CHECK:STDOUT: %impl.elem0.loc8: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  670. // CHECK:STDOUT: %bound_method.loc8_27.1: <bound method> = bound_method %int_123, %impl.elem0.loc8 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  671. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0.loc8, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  672. // CHECK:STDOUT: %bound_method.loc8_27.2: <bound method> = bound_method %int_123, %specific_fn [concrete = constants.%bound_method]
  673. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc8_27.2(%int_123) [concrete = constants.%int_123.f7f]
  674. // CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_123.f7f]
  675. // CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_123, %.loc8_27.1 [concrete = constants.%int_123.f7f]
  676. // CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_3
  677. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%.loc8_27.2, %addr.loc8)
  678. // CHECK:STDOUT: %.loc8_30: init %C to %.loc8_3 = mark_in_place_init %C__carbon_thunk.call.loc8
  679. // CHECK:STDOUT: assign %c1.var, %.loc8_30
  680. // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] {
  681. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  682. // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  683. // CHECK:STDOUT: }
  684. // CHECK:STDOUT: %c1: ref %C = ref_binding c1, %c1.var
  685. // CHECK:STDOUT: name_binding_decl {
  686. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = ref_binding_pattern c2 [concrete]
  687. // CHECK:STDOUT: %c2.var_patt: %pattern_type.217 = var_pattern %c2.patt [concrete]
  688. // CHECK:STDOUT: }
  689. // CHECK:STDOUT: %c2.var: ref %C = var %c2.var_patt
  690. // CHECK:STDOUT: %Cpp.ref.loc9_26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  691. // CHECK:STDOUT: %C.ref.loc9_29: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  692. // CHECK:STDOUT: %C.ref.loc9_31: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  693. // CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
  694. // CHECK:STDOUT: %.loc9_3: ref %C = splice_block %c2.var {}
  695. // CHECK:STDOUT: %.loc9_34.1: ref bool = temporary_storage
  696. // CHECK:STDOUT: %impl.elem0.loc9: %.86d = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op]
  697. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %true, %impl.elem0.loc9 [concrete = constants.%bool.as.Copy.impl.Op.bound]
  698. // CHECK:STDOUT: %bool.as.Copy.impl.Op.call: init bool = call %bound_method.loc9(%true) [concrete = constants.%true]
  699. // CHECK:STDOUT: %.loc9_34.2: ref bool = temporary %.loc9_34.1, %bool.as.Copy.impl.Op.call
  700. // CHECK:STDOUT: %addr.loc9_38.1: %ptr.bb2 = addr_of %.loc9_34.2
  701. // CHECK:STDOUT: %addr.loc9_38.2: %ptr.d9e = addr_of %.loc9_3
  702. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%addr.loc9_38.1, %addr.loc9_38.2)
  703. // CHECK:STDOUT: %.loc9_38: init %C to %.loc9_3 = mark_in_place_init %C__carbon_thunk.call.loc9
  704. // CHECK:STDOUT: assign %c2.var, %.loc9_38
  705. // CHECK:STDOUT: %.loc9_21: type = splice_block %C.ref.loc9_21 [concrete = constants.%C] {
  706. // CHECK:STDOUT: %Cpp.ref.loc9_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  707. // CHECK:STDOUT: %C.ref.loc9_21: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  708. // CHECK:STDOUT: }
  709. // CHECK:STDOUT: %c2: ref %C = ref_binding c2, %c2.var
  710. // CHECK:STDOUT: name_binding_decl {
  711. // CHECK:STDOUT: %c3.patt: %pattern_type.217 = ref_binding_pattern c3 [concrete]
  712. // CHECK:STDOUT: %c3.var_patt: %pattern_type.217 = var_pattern %c3.patt [concrete]
  713. // CHECK:STDOUT: }
  714. // CHECK:STDOUT: %c3.var: ref %C = var %c3.var_patt
  715. // CHECK:STDOUT: %Cpp.ref.loc10_26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  716. // CHECK:STDOUT: %C.ref.loc10_29: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  717. // CHECK:STDOUT: %C.ref.loc10_31: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  718. // CHECK:STDOUT: %c1.ref: ref %C = name_ref c1, %c1
  719. // CHECK:STDOUT: %addr.loc10_34: %ptr.d9e = addr_of %c1.ref
  720. // CHECK:STDOUT: %.loc10_3: ref %C = splice_block %c3.var {}
  721. // CHECK:STDOUT: %addr.loc10_37: %ptr.d9e = addr_of %.loc10_3
  722. // CHECK:STDOUT: %C__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.3(%addr.loc10_34, %addr.loc10_37)
  723. // CHECK:STDOUT: %.loc10_37: init %C to %.loc10_3 = mark_in_place_init %C__carbon_thunk.call.loc10
  724. // CHECK:STDOUT: assign %c3.var, %.loc10_37
  725. // CHECK:STDOUT: %.loc10_21: type = splice_block %C.ref.loc10_21 [concrete = constants.%C] {
  726. // CHECK:STDOUT: %Cpp.ref.loc10_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  727. // CHECK:STDOUT: %C.ref.loc10_21: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  728. // CHECK:STDOUT: }
  729. // CHECK:STDOUT: %c3: ref %C = ref_binding c3, %c3.var
  730. // CHECK:STDOUT: %C.cpp_destructor.bound.loc10: <bound method> = bound_method %c3.var, constants.%C.cpp_destructor
  731. // CHECK:STDOUT: %C.cpp_destructor.call.loc10: init %empty_tuple.type = call %C.cpp_destructor.bound.loc10(%c3.var)
  732. // CHECK:STDOUT: %DestroyOp.bound: <bound method> = bound_method %.loc9_34.2, constants.%DestroyOp
  733. // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc9_34.2)
  734. // CHECK:STDOUT: %C.cpp_destructor.bound.loc9: <bound method> = bound_method %c2.var, constants.%C.cpp_destructor
  735. // CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%c2.var)
  736. // CHECK:STDOUT: %C.cpp_destructor.bound.loc8: <bound method> = bound_method %c1.var, constants.%C.cpp_destructor
  737. // CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%c1.var)
  738. // CHECK:STDOUT: <elided>
  739. // CHECK:STDOUT: }
  740. // CHECK:STDOUT:
  741. // CHECK:STDOUT: fn @DestroyOp(%self.param: ref bool) = "no_op";
  742. // CHECK:STDOUT:
  743. // CHECK:STDOUT: --- import_implicit_single_argument.carbon
  744. // CHECK:STDOUT:
  745. // CHECK:STDOUT: constants {
  746. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  747. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  748. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  749. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  750. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  751. // CHECK:STDOUT: %int_8.b85: Core.IntLiteral = int_value 8 [concrete]
  752. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  753. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  754. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  755. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  756. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  757. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  758. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  759. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  760. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  761. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  762. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  763. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  764. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  765. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs(%i32, %ImplicitAs.facet) [concrete]
  766. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet [concrete]
  767. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  768. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  769. // CHECK:STDOUT: %bound_method.e07: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  770. // CHECK:STDOUT: %int_8.98c: %i32 = int_value 8 [concrete]
  771. // CHECK:STDOUT: %As.type.047: type = facet_type <@As, @As(%i32)> [concrete]
  772. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.09e: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To) [symbolic]
  773. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.dbe: %Core.IntLiteral.as.As.impl.Convert.type.09e = struct_value () [symbolic]
  774. // CHECK:STDOUT: %As.impl_witness.ab6: <witness> = impl_witness imports.%As.impl_witness_table.9fc, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  775. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.8ec: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  776. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.29b: %Core.IntLiteral.as.As.impl.Convert.type.8ec = struct_value () [concrete]
  777. // CHECK:STDOUT: %As.facet: %As.type.047 = facet_value Core.IntLiteral, (%As.impl_witness.ab6) [concrete]
  778. // CHECK:STDOUT: %As.WithSelf.Convert.type.e5b: type = fn_type @As.WithSelf.Convert, @As(%i32, %As.facet) [concrete]
  779. // CHECK:STDOUT: %.9ed: type = fn_type_with_self_type %As.WithSelf.Convert.type.e5b, %As.facet [concrete]
  780. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.29b [concrete]
  781. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.29b, @Core.IntLiteral.as.As.impl.Convert(%int_32) [concrete]
  782. // CHECK:STDOUT: %bound_method.530: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
  783. // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete]
  784. // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete]
  785. // CHECK:STDOUT: }
  786. // CHECK:STDOUT:
  787. // CHECK:STDOUT: imports {
  788. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  789. // CHECK:STDOUT: .C = %C.decl
  790. // CHECK:STDOUT: import Cpp//...
  791. // CHECK:STDOUT: }
  792. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  793. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete = constants.%C.C.cpp_overload_set.value]
  794. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  795. // CHECK:STDOUT: <elided>
  796. // CHECK:STDOUT: } {
  797. // CHECK:STDOUT: <elided>
  798. // CHECK:STDOUT: }
  799. // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
  800. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  801. // CHECK:STDOUT: %Core.import_ref.ca0: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.09e) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.dbe)]
  802. // CHECK:STDOUT: %As.impl_witness_table.9fc = impl_witness_table (%Core.import_ref.ca0), @Core.IntLiteral.as.As.impl [concrete]
  803. // CHECK:STDOUT: }
  804. // CHECK:STDOUT:
  805. // CHECK:STDOUT: fn @F() {
  806. // CHECK:STDOUT: !entry:
  807. // CHECK:STDOUT: name_binding_decl {
  808. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = value_binding_pattern c1 [concrete]
  809. // CHECK:STDOUT: }
  810. // CHECK:STDOUT: %Cpp.ref.loc8_26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  811. // CHECK:STDOUT: %C.ref.loc8_29: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  812. // CHECK:STDOUT: %C.ref.loc8_31: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  813. // CHECK:STDOUT: %int_8.loc8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  814. // CHECK:STDOUT: %.loc8_35.1: ref %C = temporary_storage
  815. // CHECK:STDOUT: %impl.elem0.loc8: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  816. // CHECK:STDOUT: %bound_method.loc8_34.1: <bound method> = bound_method %int_8.loc8, %impl.elem0.loc8 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  817. // CHECK:STDOUT: %specific_fn.loc8: <specific function> = specific_function %impl.elem0.loc8, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  818. // CHECK:STDOUT: %bound_method.loc8_34.2: <bound method> = bound_method %int_8.loc8, %specific_fn.loc8 [concrete = constants.%bound_method.e07]
  819. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc8_34.2(%int_8.loc8) [concrete = constants.%int_8.98c]
  820. // CHECK:STDOUT: %.loc8_34.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_8.98c]
  821. // CHECK:STDOUT: %.loc8_34.2: %i32 = converted %int_8.loc8, %.loc8_34.1 [concrete = constants.%int_8.98c]
  822. // CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_35.1
  823. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc8_34.2, %addr.loc8)
  824. // CHECK:STDOUT: %.loc8_35.2: init %C to %.loc8_35.1 = mark_in_place_init %C__carbon_thunk.call.loc8
  825. // CHECK:STDOUT: %.loc8_21: type = splice_block %C.ref.loc8_21 [concrete = constants.%C] {
  826. // CHECK:STDOUT: %Cpp.ref.loc8_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  827. // CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  828. // CHECK:STDOUT: }
  829. // CHECK:STDOUT: %.loc8_35.3: ref %C = temporary %.loc8_35.1, %.loc8_35.2
  830. // CHECK:STDOUT: %.loc8_35.4: %C = acquire_value %.loc8_35.3
  831. // CHECK:STDOUT: %c1: %C = value_binding c1, %.loc8_35.4
  832. // CHECK:STDOUT: name_binding_decl {
  833. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = value_binding_pattern c2 [concrete]
  834. // CHECK:STDOUT: }
  835. // CHECK:STDOUT: %int_8.loc9: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  836. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  837. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  838. // CHECK:STDOUT: %impl.elem0.loc9: %.9ed = impl_witness_access constants.%As.impl_witness.ab6, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.29b]
  839. // CHECK:STDOUT: %bound_method.loc9_28.1: <bound method> = bound_method %int_8.loc9, %impl.elem0.loc9 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
  840. // CHECK:STDOUT: %specific_fn.loc9: <specific function> = specific_function %impl.elem0.loc9, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
  841. // CHECK:STDOUT: %bound_method.loc9_28.2: <bound method> = bound_method %int_8.loc9, %specific_fn.loc9 [concrete = constants.%bound_method.530]
  842. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc9_28.2(%int_8.loc9) [concrete = constants.%int_8.98c]
  843. // CHECK:STDOUT: %.loc9_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_8.98c]
  844. // CHECK:STDOUT: %.loc9_28.2: %i32 = converted %int_8.loc9, %.loc9_28.1 [concrete = constants.%int_8.98c]
  845. // CHECK:STDOUT: %.loc9_21: type = splice_block %C.ref.loc9 [concrete = constants.%C] {
  846. // CHECK:STDOUT: %Cpp.ref.loc9: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  847. // CHECK:STDOUT: %C.ref.loc9: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  848. // CHECK:STDOUT: }
  849. // CHECK:STDOUT: %.loc9_28.3: ref %C = temporary_storage
  850. // CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_28.3
  851. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc9_28.2, %addr.loc9)
  852. // CHECK:STDOUT: %.loc9_28.4: init %C to %.loc9_28.3 = mark_in_place_init %C__carbon_thunk.call.loc9
  853. // CHECK:STDOUT: %.loc9_28.5: init %C = converted %.loc9_28.2, %.loc9_28.4
  854. // CHECK:STDOUT: %.loc9_28.6: ref %C = temporary %.loc9_28.3, %.loc9_28.5
  855. // CHECK:STDOUT: %.loc9_28.7: %C = acquire_value %.loc9_28.6
  856. // CHECK:STDOUT: %c2: %C = value_binding c2, %.loc9_28.7
  857. // CHECK:STDOUT: %C.cpp_destructor.bound.loc9: <bound method> = bound_method %.loc9_28.6, constants.%C.cpp_destructor
  858. // CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_28.6)
  859. // CHECK:STDOUT: %C.cpp_destructor.bound.loc8: <bound method> = bound_method %.loc8_35.3, constants.%C.cpp_destructor
  860. // CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_35.3)
  861. // CHECK:STDOUT: <elided>
  862. // CHECK:STDOUT: }
  863. // CHECK:STDOUT:
  864. // CHECK:STDOUT: --- import_implicit_multi_arguments.carbon
  865. // CHECK:STDOUT:
  866. // CHECK:STDOUT: constants {
  867. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  868. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  869. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  870. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  871. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  872. // CHECK:STDOUT: %int_8.b85: Core.IntLiteral = int_value 8 [concrete]
  873. // CHECK:STDOUT: %int_9.988: Core.IntLiteral = int_value 9 [concrete]
  874. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  875. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  876. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  877. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.1: type = fn_type @C__carbon_thunk.1 [concrete]
  878. // CHECK:STDOUT: %C__carbon_thunk.d98342.1: %C__carbon_thunk.type.65f120.1 = struct_value () [concrete]
  879. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  880. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  881. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  882. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  883. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  884. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  885. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  886. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  887. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs(%i32, %ImplicitAs.facet) [concrete]
  888. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet [concrete]
  889. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.62f: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  890. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  891. // CHECK:STDOUT: %bound_method.e07: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  892. // CHECK:STDOUT: %int_8.98c: %i32 = int_value 8 [concrete]
  893. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.87d: <bound method> = bound_method %int_9.988, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  894. // CHECK:STDOUT: %bound_method.661: <bound method> = bound_method %int_9.988, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  895. // CHECK:STDOUT: %int_9.f88: %i32 = int_value 9 [concrete]
  896. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.2: type = fn_type @C__carbon_thunk.2 [concrete]
  897. // CHECK:STDOUT: %C__carbon_thunk.d98342.2: %C__carbon_thunk.type.65f120.2 = struct_value () [concrete]
  898. // CHECK:STDOUT: %As.type.047: type = facet_type <@As, @As(%i32)> [concrete]
  899. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.09e: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To) [symbolic]
  900. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.dbe: %Core.IntLiteral.as.As.impl.Convert.type.09e = struct_value () [symbolic]
  901. // CHECK:STDOUT: %As.impl_witness.ab6: <witness> = impl_witness imports.%As.impl_witness_table.9fc, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  902. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.8ec: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  903. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.29b: %Core.IntLiteral.as.As.impl.Convert.type.8ec = struct_value () [concrete]
  904. // CHECK:STDOUT: %As.facet: %As.type.047 = facet_value Core.IntLiteral, (%As.impl_witness.ab6) [concrete]
  905. // CHECK:STDOUT: %As.WithSelf.Convert.type.e5b: type = fn_type @As.WithSelf.Convert, @As(%i32, %As.facet) [concrete]
  906. // CHECK:STDOUT: %.9ed: type = fn_type_with_self_type %As.WithSelf.Convert.type.e5b, %As.facet [concrete]
  907. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.29b [concrete]
  908. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.29b, @Core.IntLiteral.as.As.impl.Convert(%int_32) [concrete]
  909. // CHECK:STDOUT: %bound_method.530: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
  910. // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete]
  911. // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete]
  912. // CHECK:STDOUT: }
  913. // CHECK:STDOUT:
  914. // CHECK:STDOUT: imports {
  915. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  916. // CHECK:STDOUT: .C = %C.decl
  917. // CHECK:STDOUT: import Cpp//...
  918. // CHECK:STDOUT: }
  919. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  920. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete = constants.%C.C.cpp_overload_set.value]
  921. // CHECK:STDOUT: %C__carbon_thunk.decl.8acdfe.1: %C__carbon_thunk.type.65f120.1 = fn_decl @C__carbon_thunk.1 [concrete = constants.%C__carbon_thunk.d98342.1] {
  922. // CHECK:STDOUT: <elided>
  923. // CHECK:STDOUT: } {
  924. // CHECK:STDOUT: <elided>
  925. // CHECK:STDOUT: }
  926. // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
  927. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  928. // CHECK:STDOUT: %C__carbon_thunk.decl.8acdfe.2: %C__carbon_thunk.type.65f120.2 = fn_decl @C__carbon_thunk.2 [concrete = constants.%C__carbon_thunk.d98342.2] {
  929. // CHECK:STDOUT: <elided>
  930. // CHECK:STDOUT: } {
  931. // CHECK:STDOUT: <elided>
  932. // CHECK:STDOUT: }
  933. // CHECK:STDOUT: %Core.import_ref.ca0: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.09e) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.dbe)]
  934. // CHECK:STDOUT: %As.impl_witness_table.9fc = impl_witness_table (%Core.import_ref.ca0), @Core.IntLiteral.as.As.impl [concrete]
  935. // CHECK:STDOUT: }
  936. // CHECK:STDOUT:
  937. // CHECK:STDOUT: fn @F() {
  938. // CHECK:STDOUT: !entry:
  939. // CHECK:STDOUT: name_binding_decl {
  940. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = value_binding_pattern c1 [concrete]
  941. // CHECK:STDOUT: }
  942. // CHECK:STDOUT: %Cpp.ref.loc8_26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  943. // CHECK:STDOUT: %C.ref.loc8_29: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  944. // CHECK:STDOUT: %C.ref.loc8_31: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  945. // CHECK:STDOUT: %int_8.loc8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  946. // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [concrete = constants.%int_9.988]
  947. // CHECK:STDOUT: %.loc8_38.1: ref %C = temporary_storage
  948. // CHECK:STDOUT: %impl.elem0.loc8_34: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  949. // CHECK:STDOUT: %bound_method.loc8_34.1: <bound method> = bound_method %int_8.loc8, %impl.elem0.loc8_34 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.62f]
  950. // CHECK:STDOUT: %specific_fn.loc8_34: <specific function> = specific_function %impl.elem0.loc8_34, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  951. // CHECK:STDOUT: %bound_method.loc8_34.2: <bound method> = bound_method %int_8.loc8, %specific_fn.loc8_34 [concrete = constants.%bound_method.e07]
  952. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_34: init %i32 = call %bound_method.loc8_34.2(%int_8.loc8) [concrete = constants.%int_8.98c]
  953. // CHECK:STDOUT: %.loc8_34.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_34 [concrete = constants.%int_8.98c]
  954. // CHECK:STDOUT: %.loc8_34.2: %i32 = converted %int_8.loc8, %.loc8_34.1 [concrete = constants.%int_8.98c]
  955. // CHECK:STDOUT: %impl.elem0.loc8_37: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  956. // CHECK:STDOUT: %bound_method.loc8_37.1: <bound method> = bound_method %int_9, %impl.elem0.loc8_37 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.87d]
  957. // CHECK:STDOUT: %specific_fn.loc8_37: <specific function> = specific_function %impl.elem0.loc8_37, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  958. // CHECK:STDOUT: %bound_method.loc8_37.2: <bound method> = bound_method %int_9, %specific_fn.loc8_37 [concrete = constants.%bound_method.661]
  959. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_37: init %i32 = call %bound_method.loc8_37.2(%int_9) [concrete = constants.%int_9.f88]
  960. // CHECK:STDOUT: %.loc8_37.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_37 [concrete = constants.%int_9.f88]
  961. // CHECK:STDOUT: %.loc8_37.2: %i32 = converted %int_9, %.loc8_37.1 [concrete = constants.%int_9.f88]
  962. // CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_38.1
  963. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%.loc8_34.2, %.loc8_37.2, %addr.loc8)
  964. // CHECK:STDOUT: %.loc8_38.2: init %C to %.loc8_38.1 = mark_in_place_init %C__carbon_thunk.call.loc8
  965. // CHECK:STDOUT: %.loc8_21: type = splice_block %C.ref.loc8_21 [concrete = constants.%C] {
  966. // CHECK:STDOUT: %Cpp.ref.loc8_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  967. // CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  968. // CHECK:STDOUT: }
  969. // CHECK:STDOUT: %.loc8_38.3: ref %C = temporary %.loc8_38.1, %.loc8_38.2
  970. // CHECK:STDOUT: %.loc8_38.4: %C = acquire_value %.loc8_38.3
  971. // CHECK:STDOUT: %c1: %C = value_binding c1, %.loc8_38.4
  972. // CHECK:STDOUT: name_binding_decl {
  973. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = value_binding_pattern c2 [concrete]
  974. // CHECK:STDOUT: }
  975. // CHECK:STDOUT: %Cpp.ref.loc9_26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  976. // CHECK:STDOUT: %C.ref.loc9_29: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  977. // CHECK:STDOUT: %C.ref.loc9_31: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  978. // CHECK:STDOUT: %int_8.loc9: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  979. // CHECK:STDOUT: %.loc9_35.1: ref %C = temporary_storage
  980. // CHECK:STDOUT: %impl.elem0.loc9: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  981. // CHECK:STDOUT: %bound_method.loc9_34.1: <bound method> = bound_method %int_8.loc9, %impl.elem0.loc9 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.62f]
  982. // CHECK:STDOUT: %specific_fn.loc9: <specific function> = specific_function %impl.elem0.loc9, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  983. // CHECK:STDOUT: %bound_method.loc9_34.2: <bound method> = bound_method %int_8.loc9, %specific_fn.loc9 [concrete = constants.%bound_method.e07]
  984. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9: init %i32 = call %bound_method.loc9_34.2(%int_8.loc9) [concrete = constants.%int_8.98c]
  985. // CHECK:STDOUT: %.loc9_34.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9 [concrete = constants.%int_8.98c]
  986. // CHECK:STDOUT: %.loc9_34.2: %i32 = converted %int_8.loc9, %.loc9_34.1 [concrete = constants.%int_8.98c]
  987. // CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_35.1
  988. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc9_34.2, %addr.loc9)
  989. // CHECK:STDOUT: %.loc9_35.2: init %C to %.loc9_35.1 = mark_in_place_init %C__carbon_thunk.call.loc9
  990. // CHECK:STDOUT: %.loc9_21: type = splice_block %C.ref.loc9_21 [concrete = constants.%C] {
  991. // CHECK:STDOUT: %Cpp.ref.loc9_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  992. // CHECK:STDOUT: %C.ref.loc9_21: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  993. // CHECK:STDOUT: }
  994. // CHECK:STDOUT: %.loc9_35.3: ref %C = temporary %.loc9_35.1, %.loc9_35.2
  995. // CHECK:STDOUT: %.loc9_35.4: %C = acquire_value %.loc9_35.3
  996. // CHECK:STDOUT: %c2: %C = value_binding c2, %.loc9_35.4
  997. // CHECK:STDOUT: name_binding_decl {
  998. // CHECK:STDOUT: %c3.patt: %pattern_type.217 = value_binding_pattern c3 [concrete]
  999. // CHECK:STDOUT: }
  1000. // CHECK:STDOUT: %int_8.loc10: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  1001. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1002. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1003. // CHECK:STDOUT: %impl.elem0.loc10: %.9ed = impl_witness_access constants.%As.impl_witness.ab6, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.29b]
  1004. // CHECK:STDOUT: %bound_method.loc10_28.1: <bound method> = bound_method %int_8.loc10, %impl.elem0.loc10 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
  1005. // CHECK:STDOUT: %specific_fn.loc10: <specific function> = specific_function %impl.elem0.loc10, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
  1006. // CHECK:STDOUT: %bound_method.loc10_28.2: <bound method> = bound_method %int_8.loc10, %specific_fn.loc10 [concrete = constants.%bound_method.530]
  1007. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc10_28.2(%int_8.loc10) [concrete = constants.%int_8.98c]
  1008. // CHECK:STDOUT: %.loc10_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_8.98c]
  1009. // CHECK:STDOUT: %.loc10_28.2: %i32 = converted %int_8.loc10, %.loc10_28.1 [concrete = constants.%int_8.98c]
  1010. // CHECK:STDOUT: %.loc10_21: type = splice_block %C.ref.loc10 [concrete = constants.%C] {
  1011. // CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1012. // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1013. // CHECK:STDOUT: }
  1014. // CHECK:STDOUT: %.loc10_28.3: ref %C = temporary_storage
  1015. // CHECK:STDOUT: %addr.loc10: %ptr.d9e = addr_of %.loc10_28.3
  1016. // CHECK:STDOUT: %C__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc10_28.2, %addr.loc10)
  1017. // CHECK:STDOUT: %.loc10_28.4: init %C to %.loc10_28.3 = mark_in_place_init %C__carbon_thunk.call.loc10
  1018. // CHECK:STDOUT: %.loc10_28.5: init %C = converted %.loc10_28.2, %.loc10_28.4
  1019. // CHECK:STDOUT: %.loc10_28.6: ref %C = temporary %.loc10_28.3, %.loc10_28.5
  1020. // CHECK:STDOUT: %.loc10_28.7: %C = acquire_value %.loc10_28.6
  1021. // CHECK:STDOUT: %c3: %C = value_binding c3, %.loc10_28.7
  1022. // CHECK:STDOUT: %C.cpp_destructor.bound.loc10: <bound method> = bound_method %.loc10_28.6, constants.%C.cpp_destructor
  1023. // CHECK:STDOUT: %C.cpp_destructor.call.loc10: init %empty_tuple.type = call %C.cpp_destructor.bound.loc10(%.loc10_28.6)
  1024. // CHECK:STDOUT: %C.cpp_destructor.bound.loc9: <bound method> = bound_method %.loc9_35.3, constants.%C.cpp_destructor
  1025. // CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_35.3)
  1026. // CHECK:STDOUT: %C.cpp_destructor.bound.loc8: <bound method> = bound_method %.loc8_38.3, constants.%C.cpp_destructor
  1027. // CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_38.3)
  1028. // CHECK:STDOUT: <elided>
  1029. // CHECK:STDOUT: }
  1030. // CHECK:STDOUT: