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 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 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 c1: Cpp.C = Cpp.C.C();
  59. let 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 c1: Cpp.C = Cpp.C.C(8, 9);
  76. let 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 c2: Cpp.C = Cpp.C.C(true);
  95. var 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]]:26: error: call to deleted function 'C' [CppInteropParseError]
  116. // CHECK:STDERR: 15 | let 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 c: Cpp.C = Cpp.C.C();
  124. // CHECK:STDERR: fail_import_deleted.carbon:[[@LINE+12]]:27: error: call to deleted function 'D' [CppInteropParseError]
  125. // CHECK:STDERR: 29 | let 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 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. // --- fail_todo_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 c1: Cpp.C = Cpp.C.C(8);
  152. // CHECK:STDERR: fail_todo_import_implicit_single_argument.carbon:[[@LINE+7]]:19: error: cannot implicitly convert expression of type `i32` to `Cpp.C` [ConversionFailure]
  153. // CHECK:STDERR: let c2: Cpp.C = 8 as i32;
  154. // CHECK:STDERR: ^~~~~~~~
  155. // CHECK:STDERR: fail_todo_import_implicit_single_argument.carbon:[[@LINE+4]]:19: note: type `i32` does not implement interface `Core.ImplicitAs(Cpp.C)` [MissingImplInMemberAccessNote]
  156. // CHECK:STDERR: let c2: Cpp.C = 8 as i32;
  157. // CHECK:STDERR: ^~~~~~~~
  158. // CHECK:STDERR:
  159. let c2: Cpp.C = 8 as i32;
  160. //@dump-sem-ir-end
  161. }
  162. // ============================================================================
  163. // Implicit multi arguments constructor
  164. // ============================================================================
  165. // --- implicit_multi_arguments.h
  166. class C {
  167. public:
  168. C(int x, int y = 8);
  169. };
  170. // --- fail_todo_import_implicit_multi_arguments.carbon
  171. library "[[@TEST_NAME]]";
  172. import Cpp library "implicit_multi_arguments.h";
  173. fn F() {
  174. //@dump-sem-ir-begin
  175. let c1: Cpp.C = Cpp.C.C(8, 9);
  176. let c2: Cpp.C = Cpp.C.C(8);
  177. // CHECK:STDERR: fail_todo_import_implicit_multi_arguments.carbon:[[@LINE+7]]:19: error: cannot implicitly convert expression of type `i32` to `Cpp.C` [ConversionFailure]
  178. // CHECK:STDERR: let c3: Cpp.C = 8 as i32;
  179. // CHECK:STDERR: ^~~~~~~~
  180. // CHECK:STDERR: fail_todo_import_implicit_multi_arguments.carbon:[[@LINE+4]]:19: note: type `i32` does not implement interface `Core.ImplicitAs(Cpp.C)` [MissingImplInMemberAccessNote]
  181. // CHECK:STDERR: let c3: Cpp.C = 8 as i32;
  182. // CHECK:STDERR: ^~~~~~~~
  183. // CHECK:STDERR:
  184. let c3: Cpp.C = 8 as i32;
  185. //@dump-sem-ir-end
  186. }
  187. // ============================================================================
  188. // Trying to call a constructor of an incomplete class
  189. // ============================================================================
  190. // --- incomplete.h
  191. class C;
  192. // --- fail_import_incomplete.carbon
  193. library "[[@TEST_NAME]]";
  194. import Cpp library "incomplete.h";
  195. fn F() {
  196. // CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE+8]]:4: error: member access into incomplete class `Cpp.C` [QualifiedExprInIncompleteClassScope]
  197. // CHECK:STDERR: Cpp.C.C();
  198. // CHECK:STDERR: ^~~~~~~
  199. // CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
  200. // CHECK:STDERR: ./incomplete.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
  201. // CHECK:STDERR: class C;
  202. // CHECK:STDERR: ^
  203. // CHECK:STDERR:
  204. Cpp.C.C();
  205. }
  206. // CHECK:STDOUT: --- import_default.carbon
  207. // CHECK:STDOUT:
  208. // CHECK:STDOUT: constants {
  209. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  210. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  211. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  212. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  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]
  214. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  215. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  216. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  217. // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete]
  218. // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete]
  219. // CHECK:STDOUT: }
  220. // CHECK:STDOUT:
  221. // CHECK:STDOUT: imports {
  222. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  223. // CHECK:STDOUT: .C = %C.decl
  224. // CHECK:STDOUT: import Cpp//...
  225. // CHECK:STDOUT: }
  226. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  227. // 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]
  228. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  229. // CHECK:STDOUT: <elided>
  230. // CHECK:STDOUT: } {
  231. // CHECK:STDOUT: <elided>
  232. // CHECK:STDOUT: }
  233. // CHECK:STDOUT: }
  234. // CHECK:STDOUT:
  235. // CHECK:STDOUT: fn @F() {
  236. // CHECK:STDOUT: !entry:
  237. // CHECK:STDOUT: name_binding_decl {
  238. // CHECK:STDOUT: %c.patt: %pattern_type.217 = value_binding_pattern c [concrete]
  239. // CHECK:STDOUT: }
  240. // CHECK:STDOUT: %Cpp.ref.loc8_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  241. // CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  242. // CHECK:STDOUT: %C.ref.loc8_23: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  243. // CHECK:STDOUT: %.loc8_26.1: ref %C = temporary_storage
  244. // CHECK:STDOUT: %addr: %ptr.d9e = addr_of %.loc8_26.1
  245. // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr)
  246. // CHECK:STDOUT: %.loc8_26.2: init %C = in_place_init %C__carbon_thunk.call, %.loc8_26.1
  247. // CHECK:STDOUT: %.loc8_13: type = splice_block %C.ref.loc8_13 [concrete = constants.%C] {
  248. // CHECK:STDOUT: %Cpp.ref.loc8_10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  249. // CHECK:STDOUT: %C.ref.loc8_13: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  250. // CHECK:STDOUT: }
  251. // CHECK:STDOUT: %.loc8_26.3: ref %C = temporary %.loc8_26.1, %.loc8_26.2
  252. // CHECK:STDOUT: %.loc8_26.4: %C = acquire_value %.loc8_26.3
  253. // CHECK:STDOUT: %c: %C = value_binding c, %.loc8_26.4
  254. // CHECK:STDOUT: %C.cpp_destructor.bound: <bound method> = bound_method %.loc8_26.3, constants.%C.cpp_destructor
  255. // CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call %C.cpp_destructor.bound(%.loc8_26.3)
  256. // CHECK:STDOUT: <elided>
  257. // CHECK:STDOUT: }
  258. // CHECK:STDOUT:
  259. // CHECK:STDOUT: --- import_non_default.carbon
  260. // CHECK:STDOUT:
  261. // CHECK:STDOUT: constants {
  262. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  263. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  264. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  265. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  266. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  267. // CHECK:STDOUT: %int_123.fff: Core.IntLiteral = int_value 123 [concrete]
  268. // CHECK:STDOUT: %int_456.010: Core.IntLiteral = int_value 456 [concrete]
  269. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  270. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  271. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  272. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  273. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  274. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  275. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  276. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  277. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  278. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.740: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412 = struct_value () [symbolic]
  279. // CHECK:STDOUT: %ImplicitAs.impl_witness.ec0: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.99e, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  280. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.84b: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  281. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.84b = struct_value () [concrete]
  282. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.ec0) [concrete]
  283. // CHECK:STDOUT: %.d28: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  284. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7c9: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0 [concrete]
  285. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  286. // CHECK:STDOUT: %bound_method.b1d: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  287. // CHECK:STDOUT: %int_123.f7f: %i32 = int_value 123 [concrete]
  288. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.dc5: <bound method> = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0 [concrete]
  289. // CHECK:STDOUT: %bound_method.6da: <bound method> = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  290. // CHECK:STDOUT: %int_456.d17: %i32 = int_value 456 [concrete]
  291. // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete]
  292. // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete]
  293. // CHECK:STDOUT: }
  294. // CHECK:STDOUT:
  295. // CHECK:STDOUT: imports {
  296. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  297. // CHECK:STDOUT: .C = %C.decl
  298. // CHECK:STDOUT: import Cpp//...
  299. // CHECK:STDOUT: }
  300. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  301. // 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]
  302. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  303. // CHECK:STDOUT: <elided>
  304. // CHECK:STDOUT: } {
  305. // CHECK:STDOUT: <elided>
  306. // CHECK:STDOUT: }
  307. // CHECK:STDOUT: %Core.import_ref.3e1: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412) = 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.740)]
  308. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.99e = impl_witness_table (%Core.import_ref.3e1), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  309. // CHECK:STDOUT: }
  310. // CHECK:STDOUT:
  311. // CHECK:STDOUT: fn @F() {
  312. // CHECK:STDOUT: !entry:
  313. // CHECK:STDOUT: name_binding_decl {
  314. // CHECK:STDOUT: %c.patt: %pattern_type.217 = value_binding_pattern c [concrete]
  315. // CHECK:STDOUT: }
  316. // CHECK:STDOUT: %Cpp.ref.loc8_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  317. // CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  318. // CHECK:STDOUT: %C.ref.loc8_23: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  319. // CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [concrete = constants.%int_123.fff]
  320. // CHECK:STDOUT: %int_456: Core.IntLiteral = int_value 456 [concrete = constants.%int_456.010]
  321. // CHECK:STDOUT: %.loc8_34.1: ref %C = temporary_storage
  322. // CHECK:STDOUT: %impl.elem0.loc8_26: %.d28 = impl_witness_access constants.%ImplicitAs.impl_witness.ec0, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0]
  323. // CHECK:STDOUT: %bound_method.loc8_26.1: <bound method> = bound_method %int_123, %impl.elem0.loc8_26 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7c9]
  324. // CHECK:STDOUT: %specific_fn.loc8_26: <specific function> = specific_function %impl.elem0.loc8_26, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  325. // CHECK:STDOUT: %bound_method.loc8_26.2: <bound method> = bound_method %int_123, %specific_fn.loc8_26 [concrete = constants.%bound_method.b1d]
  326. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_26: init %i32 = call %bound_method.loc8_26.2(%int_123) [concrete = constants.%int_123.f7f]
  327. // CHECK:STDOUT: %.loc8_26.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_26 [concrete = constants.%int_123.f7f]
  328. // CHECK:STDOUT: %.loc8_26.2: %i32 = converted %int_123, %.loc8_26.1 [concrete = constants.%int_123.f7f]
  329. // CHECK:STDOUT: %impl.elem0.loc8_31: %.d28 = impl_witness_access constants.%ImplicitAs.impl_witness.ec0, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0]
  330. // CHECK:STDOUT: %bound_method.loc8_31.1: <bound method> = bound_method %int_456, %impl.elem0.loc8_31 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.dc5]
  331. // CHECK:STDOUT: %specific_fn.loc8_31: <specific function> = specific_function %impl.elem0.loc8_31, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  332. // CHECK:STDOUT: %bound_method.loc8_31.2: <bound method> = bound_method %int_456, %specific_fn.loc8_31 [concrete = constants.%bound_method.6da]
  333. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_31: init %i32 = call %bound_method.loc8_31.2(%int_456) [concrete = constants.%int_456.d17]
  334. // CHECK:STDOUT: %.loc8_31.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_31 [concrete = constants.%int_456.d17]
  335. // CHECK:STDOUT: %.loc8_31.2: %i32 = converted %int_456, %.loc8_31.1 [concrete = constants.%int_456.d17]
  336. // CHECK:STDOUT: %addr: %ptr.d9e = addr_of %.loc8_34.1
  337. // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc8_26.2, %.loc8_31.2, %addr)
  338. // CHECK:STDOUT: %.loc8_34.2: init %C = in_place_init %C__carbon_thunk.call, %.loc8_34.1
  339. // CHECK:STDOUT: %.loc8_13: type = splice_block %C.ref.loc8_13 [concrete = constants.%C] {
  340. // CHECK:STDOUT: %Cpp.ref.loc8_10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  341. // CHECK:STDOUT: %C.ref.loc8_13: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  342. // CHECK:STDOUT: }
  343. // CHECK:STDOUT: %.loc8_34.3: ref %C = temporary %.loc8_34.1, %.loc8_34.2
  344. // CHECK:STDOUT: %.loc8_34.4: %C = acquire_value %.loc8_34.3
  345. // CHECK:STDOUT: %c: %C = value_binding c, %.loc8_34.4
  346. // CHECK:STDOUT: %C.cpp_destructor.bound: <bound method> = bound_method %.loc8_34.3, constants.%C.cpp_destructor
  347. // CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call %C.cpp_destructor.bound(%.loc8_34.3)
  348. // CHECK:STDOUT: <elided>
  349. // CHECK:STDOUT: }
  350. // CHECK:STDOUT:
  351. // CHECK:STDOUT: --- import_multiple.carbon
  352. // CHECK:STDOUT:
  353. // CHECK:STDOUT: constants {
  354. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  355. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  356. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  357. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  358. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  359. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  360. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.1: type = fn_type @C__carbon_thunk.1 [concrete]
  361. // CHECK:STDOUT: %C__carbon_thunk.d98342.1: %C__carbon_thunk.type.65f120.1 = struct_value () [concrete]
  362. // CHECK:STDOUT: %int_123.fff: Core.IntLiteral = int_value 123 [concrete]
  363. // CHECK:STDOUT: %int_456.010: Core.IntLiteral = int_value 456 [concrete]
  364. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  365. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  366. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.2: type = fn_type @C__carbon_thunk.2 [concrete]
  367. // CHECK:STDOUT: %C__carbon_thunk.d98342.2: %C__carbon_thunk.type.65f120.2 = struct_value () [concrete]
  368. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  369. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  370. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  371. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  372. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.740: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412 = struct_value () [symbolic]
  373. // CHECK:STDOUT: %ImplicitAs.impl_witness.ec0: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.99e, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  374. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.84b: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  375. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.84b = struct_value () [concrete]
  376. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.ec0) [concrete]
  377. // CHECK:STDOUT: %.d28: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  378. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7c9: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0 [concrete]
  379. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  380. // CHECK:STDOUT: %bound_method.b1d: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  381. // CHECK:STDOUT: %int_123.f7f: %i32 = int_value 123 [concrete]
  382. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.dc5: <bound method> = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0 [concrete]
  383. // CHECK:STDOUT: %bound_method.6da: <bound method> = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  384. // CHECK:STDOUT: %int_456.d17: %i32 = int_value 456 [concrete]
  385. // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete]
  386. // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete]
  387. // CHECK:STDOUT: }
  388. // CHECK:STDOUT:
  389. // CHECK:STDOUT: imports {
  390. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  391. // CHECK:STDOUT: .C = %C.decl
  392. // CHECK:STDOUT: import Cpp//...
  393. // CHECK:STDOUT: }
  394. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  395. // 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]
  396. // 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] {
  397. // CHECK:STDOUT: <elided>
  398. // CHECK:STDOUT: } {
  399. // CHECK:STDOUT: <elided>
  400. // CHECK:STDOUT: }
  401. // 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] {
  402. // CHECK:STDOUT: <elided>
  403. // CHECK:STDOUT: } {
  404. // CHECK:STDOUT: <elided>
  405. // CHECK:STDOUT: }
  406. // CHECK:STDOUT: %Core.import_ref.3e1: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412) = 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.740)]
  407. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.99e = impl_witness_table (%Core.import_ref.3e1), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  408. // CHECK:STDOUT: }
  409. // CHECK:STDOUT:
  410. // CHECK:STDOUT: fn @F() {
  411. // CHECK:STDOUT: !entry:
  412. // CHECK:STDOUT: name_binding_decl {
  413. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = value_binding_pattern c1 [concrete]
  414. // CHECK:STDOUT: }
  415. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  416. // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  417. // 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]
  418. // CHECK:STDOUT: %.loc8_27.1: ref %C = temporary_storage
  419. // CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_27.1
  420. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%addr.loc8)
  421. // CHECK:STDOUT: %.loc8_27.2: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_27.1
  422. // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] {
  423. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  424. // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  425. // CHECK:STDOUT: }
  426. // CHECK:STDOUT: %.loc8_27.3: ref %C = temporary %.loc8_27.1, %.loc8_27.2
  427. // CHECK:STDOUT: %.loc8_27.4: %C = acquire_value %.loc8_27.3
  428. // CHECK:STDOUT: %c1: %C = value_binding c1, %.loc8_27.4
  429. // CHECK:STDOUT: name_binding_decl {
  430. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = value_binding_pattern c2 [concrete]
  431. // CHECK:STDOUT: }
  432. // CHECK:STDOUT: %Cpp.ref.loc9_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  433. // CHECK:STDOUT: %C.ref.loc9_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  434. // CHECK:STDOUT: %C.ref.loc9_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]
  435. // CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [concrete = constants.%int_123.fff]
  436. // CHECK:STDOUT: %int_456: Core.IntLiteral = int_value 456 [concrete = constants.%int_456.010]
  437. // CHECK:STDOUT: %.loc9_35.1: ref %C = temporary_storage
  438. // CHECK:STDOUT: %impl.elem0.loc9_27: %.d28 = impl_witness_access constants.%ImplicitAs.impl_witness.ec0, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0]
  439. // CHECK:STDOUT: %bound_method.loc9_27.1: <bound method> = bound_method %int_123, %impl.elem0.loc9_27 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7c9]
  440. // CHECK:STDOUT: %specific_fn.loc9_27: <specific function> = specific_function %impl.elem0.loc9_27, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  441. // CHECK:STDOUT: %bound_method.loc9_27.2: <bound method> = bound_method %int_123, %specific_fn.loc9_27 [concrete = constants.%bound_method.b1d]
  442. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_27: init %i32 = call %bound_method.loc9_27.2(%int_123) [concrete = constants.%int_123.f7f]
  443. // CHECK:STDOUT: %.loc9_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_27 [concrete = constants.%int_123.f7f]
  444. // CHECK:STDOUT: %.loc9_27.2: %i32 = converted %int_123, %.loc9_27.1 [concrete = constants.%int_123.f7f]
  445. // CHECK:STDOUT: %impl.elem0.loc9_32: %.d28 = impl_witness_access constants.%ImplicitAs.impl_witness.ec0, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0]
  446. // CHECK:STDOUT: %bound_method.loc9_32.1: <bound method> = bound_method %int_456, %impl.elem0.loc9_32 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.dc5]
  447. // CHECK:STDOUT: %specific_fn.loc9_32: <specific function> = specific_function %impl.elem0.loc9_32, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  448. // CHECK:STDOUT: %bound_method.loc9_32.2: <bound method> = bound_method %int_456, %specific_fn.loc9_32 [concrete = constants.%bound_method.6da]
  449. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_32: init %i32 = call %bound_method.loc9_32.2(%int_456) [concrete = constants.%int_456.d17]
  450. // CHECK:STDOUT: %.loc9_32.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_32 [concrete = constants.%int_456.d17]
  451. // CHECK:STDOUT: %.loc9_32.2: %i32 = converted %int_456, %.loc9_32.1 [concrete = constants.%int_456.d17]
  452. // CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_35.1
  453. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc9_27.2, %.loc9_32.2, %addr.loc9)
  454. // CHECK:STDOUT: %.loc9_35.2: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_35.1
  455. // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] {
  456. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  457. // CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  458. // CHECK:STDOUT: }
  459. // CHECK:STDOUT: %.loc9_35.3: ref %C = temporary %.loc9_35.1, %.loc9_35.2
  460. // CHECK:STDOUT: %.loc9_35.4: %C = acquire_value %.loc9_35.3
  461. // CHECK:STDOUT: %c2: %C = value_binding c2, %.loc9_35.4
  462. // CHECK:STDOUT: %C.cpp_destructor.bound.loc9: <bound method> = bound_method %.loc9_35.3, constants.%C.cpp_destructor
  463. // CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_35.3)
  464. // CHECK:STDOUT: %C.cpp_destructor.bound.loc8: <bound method> = bound_method %.loc8_27.3, constants.%C.cpp_destructor
  465. // CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_27.3)
  466. // CHECK:STDOUT: <elided>
  467. // CHECK:STDOUT: }
  468. // CHECK:STDOUT:
  469. // CHECK:STDOUT: --- import_default_arguments.carbon
  470. // CHECK:STDOUT:
  471. // CHECK:STDOUT: constants {
  472. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  473. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  474. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  475. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  476. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  477. // CHECK:STDOUT: %int_8.b85: Core.IntLiteral = int_value 8 [concrete]
  478. // CHECK:STDOUT: %int_9.988: Core.IntLiteral = int_value 9 [concrete]
  479. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  480. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  481. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  482. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.1: type = fn_type @C__carbon_thunk.1 [concrete]
  483. // CHECK:STDOUT: %C__carbon_thunk.d98342.1: %C__carbon_thunk.type.65f120.1 = struct_value () [concrete]
  484. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  485. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  486. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  487. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  488. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.740: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412 = struct_value () [symbolic]
  489. // CHECK:STDOUT: %ImplicitAs.impl_witness.ec0: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.99e, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  490. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.84b: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  491. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.84b = struct_value () [concrete]
  492. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.ec0) [concrete]
  493. // CHECK:STDOUT: %.d28: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  494. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7ac: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0 [concrete]
  495. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  496. // CHECK:STDOUT: %bound_method.42b: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  497. // CHECK:STDOUT: %int_8.98c: %i32 = int_value 8 [concrete]
  498. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.1f1: <bound method> = bound_method %int_9.988, %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0 [concrete]
  499. // CHECK:STDOUT: %bound_method.0b2: <bound method> = bound_method %int_9.988, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  500. // CHECK:STDOUT: %int_9.f88: %i32 = int_value 9 [concrete]
  501. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.2: type = fn_type @C__carbon_thunk.2 [concrete]
  502. // CHECK:STDOUT: %C__carbon_thunk.d98342.2: %C__carbon_thunk.type.65f120.2 = struct_value () [concrete]
  503. // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete]
  504. // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete]
  505. // CHECK:STDOUT: }
  506. // CHECK:STDOUT:
  507. // CHECK:STDOUT: imports {
  508. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  509. // CHECK:STDOUT: .C = %C.decl
  510. // CHECK:STDOUT: import Cpp//...
  511. // CHECK:STDOUT: }
  512. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  513. // 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]
  514. // 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] {
  515. // CHECK:STDOUT: <elided>
  516. // CHECK:STDOUT: } {
  517. // CHECK:STDOUT: <elided>
  518. // CHECK:STDOUT: }
  519. // CHECK:STDOUT: %Core.import_ref.3e1: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412) = 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.740)]
  520. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.99e = impl_witness_table (%Core.import_ref.3e1), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  521. // 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] {
  522. // CHECK:STDOUT: <elided>
  523. // CHECK:STDOUT: } {
  524. // CHECK:STDOUT: <elided>
  525. // CHECK:STDOUT: }
  526. // CHECK:STDOUT: }
  527. // CHECK:STDOUT:
  528. // CHECK:STDOUT: fn @F() {
  529. // CHECK:STDOUT: !entry:
  530. // CHECK:STDOUT: name_binding_decl {
  531. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = value_binding_pattern c1 [concrete]
  532. // CHECK:STDOUT: }
  533. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  534. // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  535. // 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]
  536. // CHECK:STDOUT: %int_8.loc8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  537. // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [concrete = constants.%int_9.988]
  538. // CHECK:STDOUT: %.loc8_31.1: ref %C = temporary_storage
  539. // CHECK:STDOUT: %impl.elem0.loc8_27: %.d28 = impl_witness_access constants.%ImplicitAs.impl_witness.ec0, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0]
  540. // CHECK:STDOUT: %bound_method.loc8_27.1: <bound method> = bound_method %int_8.loc8, %impl.elem0.loc8_27 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7ac]
  541. // CHECK:STDOUT: %specific_fn.loc8_27: <specific function> = specific_function %impl.elem0.loc8_27, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  542. // CHECK:STDOUT: %bound_method.loc8_27.2: <bound method> = bound_method %int_8.loc8, %specific_fn.loc8_27 [concrete = constants.%bound_method.42b]
  543. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_27: init %i32 = call %bound_method.loc8_27.2(%int_8.loc8) [concrete = constants.%int_8.98c]
  544. // CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_27 [concrete = constants.%int_8.98c]
  545. // CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_8.loc8, %.loc8_27.1 [concrete = constants.%int_8.98c]
  546. // CHECK:STDOUT: %impl.elem0.loc8_30: %.d28 = impl_witness_access constants.%ImplicitAs.impl_witness.ec0, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0]
  547. // CHECK:STDOUT: %bound_method.loc8_30.1: <bound method> = bound_method %int_9, %impl.elem0.loc8_30 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.1f1]
  548. // CHECK:STDOUT: %specific_fn.loc8_30: <specific function> = specific_function %impl.elem0.loc8_30, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  549. // CHECK:STDOUT: %bound_method.loc8_30.2: <bound method> = bound_method %int_9, %specific_fn.loc8_30 [concrete = constants.%bound_method.0b2]
  550. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_30: init %i32 = call %bound_method.loc8_30.2(%int_9) [concrete = constants.%int_9.f88]
  551. // CHECK:STDOUT: %.loc8_30.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_30 [concrete = constants.%int_9.f88]
  552. // CHECK:STDOUT: %.loc8_30.2: %i32 = converted %int_9, %.loc8_30.1 [concrete = constants.%int_9.f88]
  553. // CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_31.1
  554. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%.loc8_27.2, %.loc8_30.2, %addr.loc8)
  555. // CHECK:STDOUT: %.loc8_31.2: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_31.1
  556. // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] {
  557. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  558. // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  559. // CHECK:STDOUT: }
  560. // CHECK:STDOUT: %.loc8_31.3: ref %C = temporary %.loc8_31.1, %.loc8_31.2
  561. // CHECK:STDOUT: %.loc8_31.4: %C = acquire_value %.loc8_31.3
  562. // CHECK:STDOUT: %c1: %C = value_binding c1, %.loc8_31.4
  563. // CHECK:STDOUT: name_binding_decl {
  564. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = value_binding_pattern c2 [concrete]
  565. // CHECK:STDOUT: }
  566. // CHECK:STDOUT: %Cpp.ref.loc9_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  567. // CHECK:STDOUT: %C.ref.loc9_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  568. // CHECK:STDOUT: %C.ref.loc9_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]
  569. // CHECK:STDOUT: %int_8.loc9: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  570. // CHECK:STDOUT: %.loc9_28.1: ref %C = temporary_storage
  571. // CHECK:STDOUT: %impl.elem0.loc9: %.d28 = impl_witness_access constants.%ImplicitAs.impl_witness.ec0, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0]
  572. // CHECK:STDOUT: %bound_method.loc9_27.1: <bound method> = bound_method %int_8.loc9, %impl.elem0.loc9 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7ac]
  573. // 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]
  574. // CHECK:STDOUT: %bound_method.loc9_27.2: <bound method> = bound_method %int_8.loc9, %specific_fn.loc9 [concrete = constants.%bound_method.42b]
  575. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9: init %i32 = call %bound_method.loc9_27.2(%int_8.loc9) [concrete = constants.%int_8.98c]
  576. // CHECK:STDOUT: %.loc9_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9 [concrete = constants.%int_8.98c]
  577. // CHECK:STDOUT: %.loc9_27.2: %i32 = converted %int_8.loc9, %.loc9_27.1 [concrete = constants.%int_8.98c]
  578. // CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_28.1
  579. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc9_27.2, %addr.loc9)
  580. // CHECK:STDOUT: %.loc9_28.2: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_28.1
  581. // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] {
  582. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  583. // CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  584. // CHECK:STDOUT: }
  585. // CHECK:STDOUT: %.loc9_28.3: ref %C = temporary %.loc9_28.1, %.loc9_28.2
  586. // CHECK:STDOUT: %.loc9_28.4: %C = acquire_value %.loc9_28.3
  587. // CHECK:STDOUT: %c2: %C = value_binding c2, %.loc9_28.4
  588. // CHECK:STDOUT: %C.cpp_destructor.bound.loc9: <bound method> = bound_method %.loc9_28.3, constants.%C.cpp_destructor
  589. // CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_28.3)
  590. // CHECK:STDOUT: %C.cpp_destructor.bound.loc8: <bound method> = bound_method %.loc8_31.3, constants.%C.cpp_destructor
  591. // CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_31.3)
  592. // CHECK:STDOUT: <elided>
  593. // CHECK:STDOUT: }
  594. // CHECK:STDOUT:
  595. // CHECK:STDOUT: --- import_template.carbon
  596. // CHECK:STDOUT:
  597. // CHECK:STDOUT: constants {
  598. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  599. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  600. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  601. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  602. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  603. // CHECK:STDOUT: %int_123.fff: Core.IntLiteral = int_value 123 [concrete]
  604. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  605. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  606. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  607. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.1: type = fn_type @C__carbon_thunk.1 [concrete]
  608. // CHECK:STDOUT: %C__carbon_thunk.d98342.1: %C__carbon_thunk.type.65f120.1 = struct_value () [concrete]
  609. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  610. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  611. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  612. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  613. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.740: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412 = struct_value () [symbolic]
  614. // CHECK:STDOUT: %ImplicitAs.impl_witness.ec0: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.99e, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  615. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.84b: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  616. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.84b = struct_value () [concrete]
  617. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.ec0) [concrete]
  618. // CHECK:STDOUT: %.d28: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  619. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0 [concrete]
  620. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  621. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  622. // CHECK:STDOUT: %int_123.f7f: %i32 = int_value 123 [concrete]
  623. // CHECK:STDOUT: %true: bool = bool_literal true [concrete]
  624. // CHECK:STDOUT: %ptr.bb2: type = ptr_type bool [concrete]
  625. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.2: type = fn_type @C__carbon_thunk.2 [concrete]
  626. // CHECK:STDOUT: %C__carbon_thunk.d98342.2: %C__carbon_thunk.type.65f120.2 = struct_value () [concrete]
  627. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  628. // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
  629. // CHECK:STDOUT: %Copy.impl_witness.a56: <witness> = impl_witness imports.%Copy.impl_witness_table.189 [concrete]
  630. // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value bool, (%Copy.impl_witness.a56) [concrete]
  631. // CHECK:STDOUT: %.05c: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete]
  632. // CHECK:STDOUT: %bool.as.Copy.impl.Op.type: type = fn_type @bool.as.Copy.impl.Op [concrete]
  633. // CHECK:STDOUT: %bool.as.Copy.impl.Op: %bool.as.Copy.impl.Op.type = struct_value () [concrete]
  634. // CHECK:STDOUT: %bool.as.Copy.impl.Op.bound: <bound method> = bound_method %true, %bool.as.Copy.impl.Op [concrete]
  635. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.3: type = fn_type @C__carbon_thunk.3 [concrete]
  636. // CHECK:STDOUT: %C__carbon_thunk.d98342.3: %C__carbon_thunk.type.65f120.3 = struct_value () [concrete]
  637. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  638. // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete]
  639. // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete]
  640. // CHECK:STDOUT: %facet_value.3f5: %type_where = facet_value bool, () [concrete]
  641. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b70: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.3f5) [concrete]
  642. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.653: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b70 = struct_value () [concrete]
  643. // CHECK:STDOUT: }
  644. // CHECK:STDOUT:
  645. // CHECK:STDOUT: imports {
  646. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  647. // CHECK:STDOUT: .C = %C.decl
  648. // CHECK:STDOUT: import Cpp//...
  649. // CHECK:STDOUT: }
  650. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  651. // 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]
  652. // 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] {
  653. // CHECK:STDOUT: <elided>
  654. // CHECK:STDOUT: } {
  655. // CHECK:STDOUT: <elided>
  656. // CHECK:STDOUT: }
  657. // CHECK:STDOUT: %Core.import_ref.3e1: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412) = 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.740)]
  658. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.99e = impl_witness_table (%Core.import_ref.3e1), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  659. // 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] {
  660. // CHECK:STDOUT: <elided>
  661. // CHECK:STDOUT: } {
  662. // CHECK:STDOUT: <elided>
  663. // CHECK:STDOUT: }
  664. // CHECK:STDOUT: %Core.import_ref.cc5: %bool.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, loaded [concrete = constants.%bool.as.Copy.impl.Op]
  665. // CHECK:STDOUT: %Copy.impl_witness_table.189 = impl_witness_table (%Core.import_ref.cc5), @bool.as.Copy.impl [concrete]
  666. // 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] {
  667. // CHECK:STDOUT: <elided>
  668. // CHECK:STDOUT: } {
  669. // CHECK:STDOUT: <elided>
  670. // CHECK:STDOUT: }
  671. // CHECK:STDOUT: }
  672. // CHECK:STDOUT:
  673. // CHECK:STDOUT: fn @F() {
  674. // CHECK:STDOUT: !entry:
  675. // CHECK:STDOUT: name_binding_decl {
  676. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = ref_binding_pattern c1 [concrete]
  677. // CHECK:STDOUT: %c1.var_patt: %pattern_type.217 = var_pattern %c1.patt [concrete]
  678. // CHECK:STDOUT: }
  679. // CHECK:STDOUT: %c1.var: ref %C = var %c1.var_patt
  680. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  681. // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  682. // 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]
  683. // CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [concrete = constants.%int_123.fff]
  684. // CHECK:STDOUT: %.loc8_3: ref %C = splice_block %c1.var {}
  685. // CHECK:STDOUT: %impl.elem0.loc8: %.d28 = impl_witness_access constants.%ImplicitAs.impl_witness.ec0, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0]
  686. // 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]
  687. // 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]
  688. // CHECK:STDOUT: %bound_method.loc8_27.2: <bound method> = bound_method %int_123, %specific_fn [concrete = constants.%bound_method]
  689. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc8_27.2(%int_123) [concrete = constants.%int_123.f7f]
  690. // CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_123.f7f]
  691. // CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_123, %.loc8_27.1 [concrete = constants.%int_123.f7f]
  692. // CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_3
  693. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%.loc8_27.2, %addr.loc8)
  694. // CHECK:STDOUT: %.loc8_30: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_3
  695. // CHECK:STDOUT: assign %c1.var, %.loc8_30
  696. // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] {
  697. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  698. // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  699. // CHECK:STDOUT: }
  700. // CHECK:STDOUT: %c1: ref %C = ref_binding c1, %c1.var
  701. // CHECK:STDOUT: name_binding_decl {
  702. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = ref_binding_pattern c2 [concrete]
  703. // CHECK:STDOUT: %c2.var_patt: %pattern_type.217 = var_pattern %c2.patt [concrete]
  704. // CHECK:STDOUT: }
  705. // CHECK:STDOUT: %c2.var: ref %C = var %c2.var_patt
  706. // CHECK:STDOUT: %Cpp.ref.loc9_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  707. // CHECK:STDOUT: %C.ref.loc9_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  708. // CHECK:STDOUT: %C.ref.loc9_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]
  709. // CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
  710. // CHECK:STDOUT: %.loc9_3: ref %C = splice_block %c2.var {}
  711. // CHECK:STDOUT: %.loc9_27.1: ref bool = temporary_storage
  712. // CHECK:STDOUT: %impl.elem0.loc9: %.05c = impl_witness_access constants.%Copy.impl_witness.a56, element0 [concrete = constants.%bool.as.Copy.impl.Op]
  713. // CHECK:STDOUT: %bound_method.loc9_27.1: <bound method> = bound_method %true, %impl.elem0.loc9 [concrete = constants.%bool.as.Copy.impl.Op.bound]
  714. // CHECK:STDOUT: %bool.as.Copy.impl.Op.call: init bool = call %bound_method.loc9_27.1(%true) [concrete = constants.%true]
  715. // CHECK:STDOUT: %.loc9_27.2: ref bool = temporary %.loc9_27.1, %bool.as.Copy.impl.Op.call
  716. // CHECK:STDOUT: %addr.loc9_31.1: %ptr.bb2 = addr_of %.loc9_27.2
  717. // CHECK:STDOUT: %addr.loc9_31.2: %ptr.d9e = addr_of %.loc9_3
  718. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%addr.loc9_31.1, %addr.loc9_31.2)
  719. // CHECK:STDOUT: %.loc9_31: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_3
  720. // CHECK:STDOUT: assign %c2.var, %.loc9_31
  721. // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] {
  722. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  723. // CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  724. // CHECK:STDOUT: }
  725. // CHECK:STDOUT: %c2: ref %C = ref_binding c2, %c2.var
  726. // CHECK:STDOUT: name_binding_decl {
  727. // CHECK:STDOUT: %c3.patt: %pattern_type.217 = ref_binding_pattern c3 [concrete]
  728. // CHECK:STDOUT: %c3.var_patt: %pattern_type.217 = var_pattern %c3.patt [concrete]
  729. // CHECK:STDOUT: }
  730. // CHECK:STDOUT: %c3.var: ref %C = var %c3.var_patt
  731. // CHECK:STDOUT: %Cpp.ref.loc10_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  732. // CHECK:STDOUT: %C.ref.loc10_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  733. // CHECK:STDOUT: %C.ref.loc10_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]
  734. // CHECK:STDOUT: %c1.ref: ref %C = name_ref c1, %c1
  735. // CHECK:STDOUT: %addr.loc10_27: %ptr.d9e = addr_of %c1.ref
  736. // CHECK:STDOUT: %.loc10_3: ref %C = splice_block %c3.var {}
  737. // CHECK:STDOUT: %addr.loc10_30: %ptr.d9e = addr_of %.loc10_3
  738. // CHECK:STDOUT: %C__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.3(%addr.loc10_27, %addr.loc10_30)
  739. // CHECK:STDOUT: %.loc10_30: init %C = in_place_init %C__carbon_thunk.call.loc10, %.loc10_3
  740. // CHECK:STDOUT: assign %c3.var, %.loc10_30
  741. // CHECK:STDOUT: %.loc10_14: type = splice_block %C.ref.loc10_14 [concrete = constants.%C] {
  742. // CHECK:STDOUT: %Cpp.ref.loc10_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  743. // CHECK:STDOUT: %C.ref.loc10_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  744. // CHECK:STDOUT: }
  745. // CHECK:STDOUT: %c3: ref %C = ref_binding c3, %c3.var
  746. // CHECK:STDOUT: %C.cpp_destructor.bound.loc10: <bound method> = bound_method %c3.var, constants.%C.cpp_destructor
  747. // CHECK:STDOUT: %C.cpp_destructor.call.loc10: init %empty_tuple.type = call %C.cpp_destructor.bound.loc10(%c3.var)
  748. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc9_27.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.653
  749. // CHECK:STDOUT: <elided>
  750. // CHECK:STDOUT: %bound_method.loc9_27.2: <bound method> = bound_method %.loc9_27.2, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  751. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc9_27.2(%.loc9_27.2)
  752. // CHECK:STDOUT: %C.cpp_destructor.bound.loc9: <bound method> = bound_method %c2.var, constants.%C.cpp_destructor
  753. // CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%c2.var)
  754. // CHECK:STDOUT: %C.cpp_destructor.bound.loc8: <bound method> = bound_method %c1.var, constants.%C.cpp_destructor
  755. // CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%c1.var)
  756. // CHECK:STDOUT: <elided>
  757. // CHECK:STDOUT: }
  758. // CHECK:STDOUT:
  759. // CHECK:STDOUT: --- fail_todo_import_implicit_single_argument.carbon
  760. // CHECK:STDOUT:
  761. // CHECK:STDOUT: constants {
  762. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  763. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  764. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  765. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  766. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  767. // CHECK:STDOUT: %int_8.b85: Core.IntLiteral = int_value 8 [concrete]
  768. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  769. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  770. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  771. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  772. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  773. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  774. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  775. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  776. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  777. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.740: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412 = struct_value () [symbolic]
  778. // CHECK:STDOUT: %ImplicitAs.impl_witness.ec0: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.99e, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  779. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.84b: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  780. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.84b = struct_value () [concrete]
  781. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.ec0) [concrete]
  782. // CHECK:STDOUT: %.d28: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  783. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0 [concrete]
  784. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  785. // CHECK:STDOUT: %bound_method.42b: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  786. // CHECK:STDOUT: %int_8.98c: %i32 = int_value 8 [concrete]
  787. // CHECK:STDOUT: %As.type.dbd: type = facet_type <@As, @As(%i32)> [concrete]
  788. // CHECK:STDOUT: %As.Convert.type.99b: type = fn_type @As.Convert, @As(%i32) [concrete]
  789. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.be4: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To) [symbolic]
  790. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.b5e: %Core.IntLiteral.as.As.impl.Convert.type.be4 = struct_value () [symbolic]
  791. // CHECK:STDOUT: %As.impl_witness.bb6: <witness> = impl_witness imports.%As.impl_witness_table.de3, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  792. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.b71: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  793. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.070: %Core.IntLiteral.as.As.impl.Convert.type.b71 = struct_value () [concrete]
  794. // CHECK:STDOUT: %As.facet: %As.type.dbd = facet_value Core.IntLiteral, (%As.impl_witness.bb6) [concrete]
  795. // CHECK:STDOUT: %.2bb: type = fn_type_with_self_type %As.Convert.type.99b, %As.facet [concrete]
  796. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.070 [concrete]
  797. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.070, @Core.IntLiteral.as.As.impl.Convert(%int_32) [concrete]
  798. // CHECK:STDOUT: %bound_method.819: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
  799. // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete]
  800. // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete]
  801. // CHECK:STDOUT: }
  802. // CHECK:STDOUT:
  803. // CHECK:STDOUT: imports {
  804. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  805. // CHECK:STDOUT: .C = %C.decl
  806. // CHECK:STDOUT: import Cpp//...
  807. // CHECK:STDOUT: }
  808. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  809. // 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]
  810. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  811. // CHECK:STDOUT: <elided>
  812. // CHECK:STDOUT: } {
  813. // CHECK:STDOUT: <elided>
  814. // CHECK:STDOUT: }
  815. // CHECK:STDOUT: %Core.import_ref.3e1: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412) = 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.740)]
  816. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.99e = impl_witness_table (%Core.import_ref.3e1), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  817. // CHECK:STDOUT: %Core.import_ref.ef2: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.be4) = 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.b5e)]
  818. // CHECK:STDOUT: %As.impl_witness_table.de3 = impl_witness_table (%Core.import_ref.ef2), @Core.IntLiteral.as.As.impl [concrete]
  819. // CHECK:STDOUT: }
  820. // CHECK:STDOUT:
  821. // CHECK:STDOUT: fn @F() {
  822. // CHECK:STDOUT: !entry:
  823. // CHECK:STDOUT: name_binding_decl {
  824. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = value_binding_pattern c1 [concrete]
  825. // CHECK:STDOUT: }
  826. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  827. // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  828. // 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]
  829. // CHECK:STDOUT: %int_8.loc8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  830. // CHECK:STDOUT: %.loc8_28.1: ref %C = temporary_storage
  831. // CHECK:STDOUT: %impl.elem0.loc8: %.d28 = impl_witness_access constants.%ImplicitAs.impl_witness.ec0, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0]
  832. // CHECK:STDOUT: %bound_method.loc8_27.1: <bound method> = bound_method %int_8.loc8, %impl.elem0.loc8 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  833. // 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]
  834. // CHECK:STDOUT: %bound_method.loc8_27.2: <bound method> = bound_method %int_8.loc8, %specific_fn.loc8 [concrete = constants.%bound_method.42b]
  835. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc8_27.2(%int_8.loc8) [concrete = constants.%int_8.98c]
  836. // CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_8.98c]
  837. // CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_8.loc8, %.loc8_27.1 [concrete = constants.%int_8.98c]
  838. // CHECK:STDOUT: %addr: %ptr.d9e = addr_of %.loc8_28.1
  839. // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc8_27.2, %addr)
  840. // CHECK:STDOUT: %.loc8_28.2: init %C = in_place_init %C__carbon_thunk.call, %.loc8_28.1
  841. // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] {
  842. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  843. // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  844. // CHECK:STDOUT: }
  845. // CHECK:STDOUT: %.loc8_28.3: ref %C = temporary %.loc8_28.1, %.loc8_28.2
  846. // CHECK:STDOUT: %.loc8_28.4: %C = acquire_value %.loc8_28.3
  847. // CHECK:STDOUT: %c1: %C = value_binding c1, %.loc8_28.4
  848. // CHECK:STDOUT: name_binding_decl {
  849. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = value_binding_pattern c2 [concrete]
  850. // CHECK:STDOUT: }
  851. // CHECK:STDOUT: %int_8.loc16: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  852. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  853. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  854. // CHECK:STDOUT: %impl.elem0.loc16: %.2bb = impl_witness_access constants.%As.impl_witness.bb6, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.070]
  855. // CHECK:STDOUT: %bound_method.loc16_21.1: <bound method> = bound_method %int_8.loc16, %impl.elem0.loc16 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
  856. // CHECK:STDOUT: %specific_fn.loc16: <specific function> = specific_function %impl.elem0.loc16, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
  857. // CHECK:STDOUT: %bound_method.loc16_21.2: <bound method> = bound_method %int_8.loc16, %specific_fn.loc16 [concrete = constants.%bound_method.819]
  858. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc16_21.2(%int_8.loc16) [concrete = constants.%int_8.98c]
  859. // CHECK:STDOUT: %.loc16_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_8.98c]
  860. // CHECK:STDOUT: %.loc16_21.2: %i32 = converted %int_8.loc16, %.loc16_21.1 [concrete = constants.%int_8.98c]
  861. // CHECK:STDOUT: %.loc16_14: type = splice_block %C.ref.loc16 [concrete = constants.%C] {
  862. // CHECK:STDOUT: %Cpp.ref.loc16: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  863. // CHECK:STDOUT: %C.ref.loc16: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  864. // CHECK:STDOUT: }
  865. // CHECK:STDOUT: %.loc16_21.3: %C = converted %.loc16_21.2, <error> [concrete = <error>]
  866. // CHECK:STDOUT: %c2: %C = value_binding c2, <error> [concrete = <error>]
  867. // CHECK:STDOUT: %C.cpp_destructor.bound: <bound method> = bound_method %.loc8_28.3, constants.%C.cpp_destructor
  868. // CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call %C.cpp_destructor.bound(%.loc8_28.3)
  869. // CHECK:STDOUT: <elided>
  870. // CHECK:STDOUT: }
  871. // CHECK:STDOUT:
  872. // CHECK:STDOUT: --- fail_todo_import_implicit_multi_arguments.carbon
  873. // CHECK:STDOUT:
  874. // CHECK:STDOUT: constants {
  875. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  876. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  877. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  878. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  879. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  880. // CHECK:STDOUT: %int_8.b85: Core.IntLiteral = int_value 8 [concrete]
  881. // CHECK:STDOUT: %int_9.988: Core.IntLiteral = int_value 9 [concrete]
  882. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  883. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  884. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  885. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.1: type = fn_type @C__carbon_thunk.1 [concrete]
  886. // CHECK:STDOUT: %C__carbon_thunk.d98342.1: %C__carbon_thunk.type.65f120.1 = struct_value () [concrete]
  887. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  888. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  889. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  890. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  891. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.740: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412 = struct_value () [symbolic]
  892. // CHECK:STDOUT: %ImplicitAs.impl_witness.ec0: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.99e, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  893. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.84b: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  894. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.84b = struct_value () [concrete]
  895. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.ec0) [concrete]
  896. // CHECK:STDOUT: %.d28: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  897. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7ac: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0 [concrete]
  898. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  899. // CHECK:STDOUT: %bound_method.42b: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  900. // CHECK:STDOUT: %int_8.98c: %i32 = int_value 8 [concrete]
  901. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.1f1: <bound method> = bound_method %int_9.988, %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0 [concrete]
  902. // CHECK:STDOUT: %bound_method.0b2: <bound method> = bound_method %int_9.988, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  903. // CHECK:STDOUT: %int_9.f88: %i32 = int_value 9 [concrete]
  904. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.2: type = fn_type @C__carbon_thunk.2 [concrete]
  905. // CHECK:STDOUT: %C__carbon_thunk.d98342.2: %C__carbon_thunk.type.65f120.2 = struct_value () [concrete]
  906. // CHECK:STDOUT: %As.type.dbd: type = facet_type <@As, @As(%i32)> [concrete]
  907. // CHECK:STDOUT: %As.Convert.type.99b: type = fn_type @As.Convert, @As(%i32) [concrete]
  908. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.be4: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To) [symbolic]
  909. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.b5e: %Core.IntLiteral.as.As.impl.Convert.type.be4 = struct_value () [symbolic]
  910. // CHECK:STDOUT: %As.impl_witness.bb6: <witness> = impl_witness imports.%As.impl_witness_table.de3, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  911. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.b71: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  912. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.070: %Core.IntLiteral.as.As.impl.Convert.type.b71 = struct_value () [concrete]
  913. // CHECK:STDOUT: %As.facet: %As.type.dbd = facet_value Core.IntLiteral, (%As.impl_witness.bb6) [concrete]
  914. // CHECK:STDOUT: %.2bb: type = fn_type_with_self_type %As.Convert.type.99b, %As.facet [concrete]
  915. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.070 [concrete]
  916. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.070, @Core.IntLiteral.as.As.impl.Convert(%int_32) [concrete]
  917. // CHECK:STDOUT: %bound_method.819: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
  918. // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete]
  919. // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete]
  920. // CHECK:STDOUT: }
  921. // CHECK:STDOUT:
  922. // CHECK:STDOUT: imports {
  923. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  924. // CHECK:STDOUT: .C = %C.decl
  925. // CHECK:STDOUT: import Cpp//...
  926. // CHECK:STDOUT: }
  927. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  928. // 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]
  929. // 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] {
  930. // CHECK:STDOUT: <elided>
  931. // CHECK:STDOUT: } {
  932. // CHECK:STDOUT: <elided>
  933. // CHECK:STDOUT: }
  934. // CHECK:STDOUT: %Core.import_ref.3e1: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.412) = 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.740)]
  935. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.99e = impl_witness_table (%Core.import_ref.3e1), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  936. // 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] {
  937. // CHECK:STDOUT: <elided>
  938. // CHECK:STDOUT: } {
  939. // CHECK:STDOUT: <elided>
  940. // CHECK:STDOUT: }
  941. // CHECK:STDOUT: %Core.import_ref.ef2: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.be4) = 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.b5e)]
  942. // CHECK:STDOUT: %As.impl_witness_table.de3 = impl_witness_table (%Core.import_ref.ef2), @Core.IntLiteral.as.As.impl [concrete]
  943. // CHECK:STDOUT: }
  944. // CHECK:STDOUT:
  945. // CHECK:STDOUT: fn @F() {
  946. // CHECK:STDOUT: !entry:
  947. // CHECK:STDOUT: name_binding_decl {
  948. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = value_binding_pattern c1 [concrete]
  949. // CHECK:STDOUT: }
  950. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  951. // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  952. // 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]
  953. // CHECK:STDOUT: %int_8.loc8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  954. // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [concrete = constants.%int_9.988]
  955. // CHECK:STDOUT: %.loc8_31.1: ref %C = temporary_storage
  956. // CHECK:STDOUT: %impl.elem0.loc8_27: %.d28 = impl_witness_access constants.%ImplicitAs.impl_witness.ec0, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0]
  957. // CHECK:STDOUT: %bound_method.loc8_27.1: <bound method> = bound_method %int_8.loc8, %impl.elem0.loc8_27 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7ac]
  958. // CHECK:STDOUT: %specific_fn.loc8_27: <specific function> = specific_function %impl.elem0.loc8_27, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  959. // CHECK:STDOUT: %bound_method.loc8_27.2: <bound method> = bound_method %int_8.loc8, %specific_fn.loc8_27 [concrete = constants.%bound_method.42b]
  960. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_27: init %i32 = call %bound_method.loc8_27.2(%int_8.loc8) [concrete = constants.%int_8.98c]
  961. // CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_27 [concrete = constants.%int_8.98c]
  962. // CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_8.loc8, %.loc8_27.1 [concrete = constants.%int_8.98c]
  963. // CHECK:STDOUT: %impl.elem0.loc8_30: %.d28 = impl_witness_access constants.%ImplicitAs.impl_witness.ec0, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0]
  964. // CHECK:STDOUT: %bound_method.loc8_30.1: <bound method> = bound_method %int_9, %impl.elem0.loc8_30 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.1f1]
  965. // CHECK:STDOUT: %specific_fn.loc8_30: <specific function> = specific_function %impl.elem0.loc8_30, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  966. // CHECK:STDOUT: %bound_method.loc8_30.2: <bound method> = bound_method %int_9, %specific_fn.loc8_30 [concrete = constants.%bound_method.0b2]
  967. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_30: init %i32 = call %bound_method.loc8_30.2(%int_9) [concrete = constants.%int_9.f88]
  968. // CHECK:STDOUT: %.loc8_30.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_30 [concrete = constants.%int_9.f88]
  969. // CHECK:STDOUT: %.loc8_30.2: %i32 = converted %int_9, %.loc8_30.1 [concrete = constants.%int_9.f88]
  970. // CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_31.1
  971. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%.loc8_27.2, %.loc8_30.2, %addr.loc8)
  972. // CHECK:STDOUT: %.loc8_31.2: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_31.1
  973. // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] {
  974. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  975. // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  976. // CHECK:STDOUT: }
  977. // CHECK:STDOUT: %.loc8_31.3: ref %C = temporary %.loc8_31.1, %.loc8_31.2
  978. // CHECK:STDOUT: %.loc8_31.4: %C = acquire_value %.loc8_31.3
  979. // CHECK:STDOUT: %c1: %C = value_binding c1, %.loc8_31.4
  980. // CHECK:STDOUT: name_binding_decl {
  981. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = value_binding_pattern c2 [concrete]
  982. // CHECK:STDOUT: }
  983. // CHECK:STDOUT: %Cpp.ref.loc9_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  984. // CHECK:STDOUT: %C.ref.loc9_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  985. // CHECK:STDOUT: %C.ref.loc9_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]
  986. // CHECK:STDOUT: %int_8.loc9: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  987. // CHECK:STDOUT: %.loc9_28.1: ref %C = temporary_storage
  988. // CHECK:STDOUT: %impl.elem0.loc9: %.d28 = impl_witness_access constants.%ImplicitAs.impl_witness.ec0, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f0]
  989. // CHECK:STDOUT: %bound_method.loc9_27.1: <bound method> = bound_method %int_8.loc9, %impl.elem0.loc9 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.7ac]
  990. // 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]
  991. // CHECK:STDOUT: %bound_method.loc9_27.2: <bound method> = bound_method %int_8.loc9, %specific_fn.loc9 [concrete = constants.%bound_method.42b]
  992. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9: init %i32 = call %bound_method.loc9_27.2(%int_8.loc9) [concrete = constants.%int_8.98c]
  993. // CHECK:STDOUT: %.loc9_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9 [concrete = constants.%int_8.98c]
  994. // CHECK:STDOUT: %.loc9_27.2: %i32 = converted %int_8.loc9, %.loc9_27.1 [concrete = constants.%int_8.98c]
  995. // CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_28.1
  996. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc9_27.2, %addr.loc9)
  997. // CHECK:STDOUT: %.loc9_28.2: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_28.1
  998. // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] {
  999. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1000. // CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1001. // CHECK:STDOUT: }
  1002. // CHECK:STDOUT: %.loc9_28.3: ref %C = temporary %.loc9_28.1, %.loc9_28.2
  1003. // CHECK:STDOUT: %.loc9_28.4: %C = acquire_value %.loc9_28.3
  1004. // CHECK:STDOUT: %c2: %C = value_binding c2, %.loc9_28.4
  1005. // CHECK:STDOUT: name_binding_decl {
  1006. // CHECK:STDOUT: %c3.patt: %pattern_type.217 = value_binding_pattern c3 [concrete]
  1007. // CHECK:STDOUT: }
  1008. // CHECK:STDOUT: %int_8.loc17: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  1009. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1010. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1011. // CHECK:STDOUT: %impl.elem0.loc17: %.2bb = impl_witness_access constants.%As.impl_witness.bb6, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.070]
  1012. // CHECK:STDOUT: %bound_method.loc17_21.1: <bound method> = bound_method %int_8.loc17, %impl.elem0.loc17 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
  1013. // CHECK:STDOUT: %specific_fn.loc17: <specific function> = specific_function %impl.elem0.loc17, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
  1014. // CHECK:STDOUT: %bound_method.loc17_21.2: <bound method> = bound_method %int_8.loc17, %specific_fn.loc17 [concrete = constants.%bound_method.819]
  1015. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc17_21.2(%int_8.loc17) [concrete = constants.%int_8.98c]
  1016. // CHECK:STDOUT: %.loc17_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_8.98c]
  1017. // CHECK:STDOUT: %.loc17_21.2: %i32 = converted %int_8.loc17, %.loc17_21.1 [concrete = constants.%int_8.98c]
  1018. // CHECK:STDOUT: %.loc17_14: type = splice_block %C.ref.loc17 [concrete = constants.%C] {
  1019. // CHECK:STDOUT: %Cpp.ref.loc17: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1020. // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1021. // CHECK:STDOUT: }
  1022. // CHECK:STDOUT: %.loc17_21.3: %C = converted %.loc17_21.2, <error> [concrete = <error>]
  1023. // CHECK:STDOUT: %c3: %C = value_binding c3, <error> [concrete = <error>]
  1024. // CHECK:STDOUT: %C.cpp_destructor.bound.loc9: <bound method> = bound_method %.loc9_28.3, constants.%C.cpp_destructor
  1025. // CHECK:STDOUT: %C.cpp_destructor.call.loc9: init %empty_tuple.type = call %C.cpp_destructor.bound.loc9(%.loc9_28.3)
  1026. // CHECK:STDOUT: %C.cpp_destructor.bound.loc8: <bound method> = bound_method %.loc8_31.3, constants.%C.cpp_destructor
  1027. // CHECK:STDOUT: %C.cpp_destructor.call.loc8: init %empty_tuple.type = call %C.cpp_destructor.bound.loc8(%.loc8_31.3)
  1028. // CHECK:STDOUT: <elided>
  1029. // CHECK:STDOUT: }
  1030. // CHECK:STDOUT: