constructor.carbon 92 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172
  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: %.d40: type = cpp_overload_set_type @C.C [concrete]
  213. // CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @C.C [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: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  218. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  219. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.type.fc1: type = fn_type @DestroyT.as_type.as.Destroy.impl.Op, @DestroyT.as_type.as.Destroy.impl(%facet_value) [concrete]
  220. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.6b9: %DestroyT.as_type.as.Destroy.impl.Op.type.fc1 = struct_value () [concrete]
  221. // CHECK:STDOUT: }
  222. // CHECK:STDOUT:
  223. // CHECK:STDOUT: imports {
  224. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  225. // CHECK:STDOUT: .C = %C.decl
  226. // CHECK:STDOUT: import Cpp//...
  227. // CHECK:STDOUT: }
  228. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  229. // CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @C.C [concrete = constants.%.40b]
  230. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  231. // CHECK:STDOUT: <elided>
  232. // CHECK:STDOUT: } {
  233. // CHECK:STDOUT: <elided>
  234. // CHECK:STDOUT: }
  235. // CHECK:STDOUT: }
  236. // CHECK:STDOUT:
  237. // CHECK:STDOUT: fn @F() {
  238. // CHECK:STDOUT: !entry:
  239. // CHECK:STDOUT: name_binding_decl {
  240. // CHECK:STDOUT: %c.patt: %pattern_type.217 = binding_pattern c [concrete]
  241. // CHECK:STDOUT: }
  242. // CHECK:STDOUT: %Cpp.ref.loc8_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  243. // CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  244. // CHECK:STDOUT: %C.ref.loc8_23: %.d40 = name_ref C, imports.%.40b [concrete = constants.%.40b]
  245. // CHECK:STDOUT: %.loc8_26.1: ref %C = temporary_storage
  246. // CHECK:STDOUT: %addr.loc8_26.1: %ptr.d9e = addr_of %.loc8_26.1
  247. // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_26.1)
  248. // CHECK:STDOUT: %.loc8_26.2: init %C = in_place_init %C__carbon_thunk.call, %.loc8_26.1
  249. // CHECK:STDOUT: %.loc8_13: type = splice_block %C.ref.loc8_13 [concrete = constants.%C] {
  250. // CHECK:STDOUT: %Cpp.ref.loc8_10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  251. // CHECK:STDOUT: %C.ref.loc8_13: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  252. // CHECK:STDOUT: }
  253. // CHECK:STDOUT: %.loc8_26.3: ref %C = temporary %.loc8_26.1, %.loc8_26.2
  254. // CHECK:STDOUT: %.loc8_26.4: %C = bind_value %.loc8_26.3
  255. // CHECK:STDOUT: %c: %C = bind_name c, %.loc8_26.4
  256. // CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  257. // CHECK:STDOUT: %.loc8_26.5: %type_where = converted constants.%C, %facet_value [concrete = constants.%facet_value]
  258. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc8_26.3, constants.%DestroyT.as_type.as.Destroy.impl.Op.6b9
  259. // CHECK:STDOUT: <elided>
  260. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc8_26.3, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn
  261. // CHECK:STDOUT: %addr.loc8_26.2: %ptr.d9e = addr_of %.loc8_26.3
  262. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc8_26.2)
  263. // CHECK:STDOUT: <elided>
  264. // CHECK:STDOUT: }
  265. // CHECK:STDOUT:
  266. // CHECK:STDOUT: --- import_non_default.carbon
  267. // CHECK:STDOUT:
  268. // CHECK:STDOUT: constants {
  269. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  270. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  271. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  272. // CHECK:STDOUT: %.d40: type = cpp_overload_set_type @C.C [concrete]
  273. // CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @C.C [concrete]
  274. // CHECK:STDOUT: %int_123.fff: Core.IntLiteral = int_value 123 [concrete]
  275. // CHECK:STDOUT: %int_456.010: Core.IntLiteral = int_value 456 [concrete]
  276. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  277. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  278. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  279. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  280. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  281. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  282. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  283. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  284. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  285. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340 = struct_value () [symbolic]
  286. // CHECK:STDOUT: %ImplicitAs.impl_witness.204: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.9e9, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  287. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  288. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584 = struct_value () [concrete]
  289. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.204) [concrete]
  290. // CHECK:STDOUT: %.1df: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  291. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.0c9: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [concrete]
  292. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  293. // CHECK:STDOUT: %bound_method.bec: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  294. // CHECK:STDOUT: %int_123.f7f: %i32 = int_value 123 [concrete]
  295. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.ec6: <bound method> = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [concrete]
  296. // CHECK:STDOUT: %bound_method.ed0: <bound method> = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  297. // CHECK:STDOUT: %int_456.d17: %i32 = int_value 456 [concrete]
  298. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  299. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  300. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.type.fc1: type = fn_type @DestroyT.as_type.as.Destroy.impl.Op, @DestroyT.as_type.as.Destroy.impl(%facet_value) [concrete]
  301. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.6b9: %DestroyT.as_type.as.Destroy.impl.Op.type.fc1 = struct_value () [concrete]
  302. // CHECK:STDOUT: }
  303. // CHECK:STDOUT:
  304. // CHECK:STDOUT: imports {
  305. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  306. // CHECK:STDOUT: .C = %C.decl
  307. // CHECK:STDOUT: import Cpp//...
  308. // CHECK:STDOUT: }
  309. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  310. // CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @C.C [concrete = constants.%.40b]
  311. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  312. // CHECK:STDOUT: <elided>
  313. // CHECK:STDOUT: } {
  314. // CHECK:STDOUT: <elided>
  315. // CHECK:STDOUT: }
  316. // CHECK:STDOUT: %Core.import_ref.ee7: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340) = 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.1c0)]
  317. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.9e9 = impl_witness_table (%Core.import_ref.ee7), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  318. // CHECK:STDOUT: }
  319. // CHECK:STDOUT:
  320. // CHECK:STDOUT: fn @F() {
  321. // CHECK:STDOUT: !entry:
  322. // CHECK:STDOUT: name_binding_decl {
  323. // CHECK:STDOUT: %c.patt: %pattern_type.217 = binding_pattern c [concrete]
  324. // CHECK:STDOUT: }
  325. // CHECK:STDOUT: %Cpp.ref.loc8_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  326. // CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  327. // CHECK:STDOUT: %C.ref.loc8_23: %.d40 = name_ref C, imports.%.40b [concrete = constants.%.40b]
  328. // CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [concrete = constants.%int_123.fff]
  329. // CHECK:STDOUT: %int_456: Core.IntLiteral = int_value 456 [concrete = constants.%int_456.010]
  330. // CHECK:STDOUT: %.loc8_34.1: ref %C = temporary_storage
  331. // CHECK:STDOUT: %impl.elem0.loc8_26: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  332. // 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.0c9]
  333. // 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]
  334. // CHECK:STDOUT: %bound_method.loc8_26.2: <bound method> = bound_method %int_123, %specific_fn.loc8_26 [concrete = constants.%bound_method.bec]
  335. // 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]
  336. // CHECK:STDOUT: %.loc8_26.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_26 [concrete = constants.%int_123.f7f]
  337. // CHECK:STDOUT: %.loc8_26.2: %i32 = converted %int_123, %.loc8_26.1 [concrete = constants.%int_123.f7f]
  338. // CHECK:STDOUT: %impl.elem0.loc8_31: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  339. // 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.ec6]
  340. // 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]
  341. // CHECK:STDOUT: %bound_method.loc8_31.2: <bound method> = bound_method %int_456, %specific_fn.loc8_31 [concrete = constants.%bound_method.ed0]
  342. // 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]
  343. // CHECK:STDOUT: %.loc8_31.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_31 [concrete = constants.%int_456.d17]
  344. // CHECK:STDOUT: %.loc8_31.2: %i32 = converted %int_456, %.loc8_31.1 [concrete = constants.%int_456.d17]
  345. // CHECK:STDOUT: %addr.loc8_34.1: %ptr.d9e = addr_of %.loc8_34.1
  346. // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc8_26.2, %.loc8_31.2, %addr.loc8_34.1)
  347. // CHECK:STDOUT: %.loc8_34.2: init %C = in_place_init %C__carbon_thunk.call, %.loc8_34.1
  348. // CHECK:STDOUT: %.loc8_13: type = splice_block %C.ref.loc8_13 [concrete = constants.%C] {
  349. // CHECK:STDOUT: %Cpp.ref.loc8_10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  350. // CHECK:STDOUT: %C.ref.loc8_13: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  351. // CHECK:STDOUT: }
  352. // CHECK:STDOUT: %.loc8_34.3: ref %C = temporary %.loc8_34.1, %.loc8_34.2
  353. // CHECK:STDOUT: %.loc8_34.4: %C = bind_value %.loc8_34.3
  354. // CHECK:STDOUT: %c: %C = bind_name c, %.loc8_34.4
  355. // CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  356. // CHECK:STDOUT: %.loc8_34.5: %type_where = converted constants.%C, %facet_value [concrete = constants.%facet_value]
  357. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc8_34.3, constants.%DestroyT.as_type.as.Destroy.impl.Op.6b9
  358. // CHECK:STDOUT: <elided>
  359. // CHECK:STDOUT: %bound_method.loc8_34: <bound method> = bound_method %.loc8_34.3, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn
  360. // CHECK:STDOUT: %addr.loc8_34.2: %ptr.d9e = addr_of %.loc8_34.3
  361. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_34(%addr.loc8_34.2)
  362. // CHECK:STDOUT: <elided>
  363. // CHECK:STDOUT: }
  364. // CHECK:STDOUT:
  365. // CHECK:STDOUT: --- import_multiple.carbon
  366. // CHECK:STDOUT:
  367. // CHECK:STDOUT: constants {
  368. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  369. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  370. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  371. // CHECK:STDOUT: %.d40: type = cpp_overload_set_type @C.C.1 [concrete]
  372. // CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @C.C.1 [concrete]
  373. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  374. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.1: type = fn_type @C__carbon_thunk.1 [concrete]
  375. // CHECK:STDOUT: %C__carbon_thunk.d98342.1: %C__carbon_thunk.type.65f120.1 = struct_value () [concrete]
  376. // CHECK:STDOUT: %int_123.fff: Core.IntLiteral = int_value 123 [concrete]
  377. // CHECK:STDOUT: %int_456.010: Core.IntLiteral = int_value 456 [concrete]
  378. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  379. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  380. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.2: type = fn_type @C__carbon_thunk.2 [concrete]
  381. // CHECK:STDOUT: %C__carbon_thunk.d98342.2: %C__carbon_thunk.type.65f120.2 = struct_value () [concrete]
  382. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  383. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  384. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  385. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  386. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340 = struct_value () [symbolic]
  387. // CHECK:STDOUT: %ImplicitAs.impl_witness.204: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.9e9, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  388. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  389. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584 = struct_value () [concrete]
  390. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.204) [concrete]
  391. // CHECK:STDOUT: %.1df: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  392. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.0c9: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [concrete]
  393. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  394. // CHECK:STDOUT: %bound_method.bec: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  395. // CHECK:STDOUT: %int_123.f7f: %i32 = int_value 123 [concrete]
  396. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.ec6: <bound method> = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [concrete]
  397. // CHECK:STDOUT: %bound_method.ed0: <bound method> = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  398. // CHECK:STDOUT: %int_456.d17: %i32 = int_value 456 [concrete]
  399. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  400. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  401. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.type.fc1: type = fn_type @DestroyT.as_type.as.Destroy.impl.Op, @DestroyT.as_type.as.Destroy.impl(%facet_value) [concrete]
  402. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.6b9: %DestroyT.as_type.as.Destroy.impl.Op.type.fc1 = struct_value () [concrete]
  403. // CHECK:STDOUT: }
  404. // CHECK:STDOUT:
  405. // CHECK:STDOUT: imports {
  406. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  407. // CHECK:STDOUT: .C = %C.decl
  408. // CHECK:STDOUT: import Cpp//...
  409. // CHECK:STDOUT: }
  410. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  411. // CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @C.C.1 [concrete = constants.%.40b]
  412. // 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] {
  413. // CHECK:STDOUT: <elided>
  414. // CHECK:STDOUT: } {
  415. // CHECK:STDOUT: <elided>
  416. // CHECK:STDOUT: }
  417. // 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] {
  418. // CHECK:STDOUT: <elided>
  419. // CHECK:STDOUT: } {
  420. // CHECK:STDOUT: <elided>
  421. // CHECK:STDOUT: }
  422. // CHECK:STDOUT: %Core.import_ref.ee7: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340) = 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.1c0)]
  423. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.9e9 = impl_witness_table (%Core.import_ref.ee7), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  424. // CHECK:STDOUT: }
  425. // CHECK:STDOUT:
  426. // CHECK:STDOUT: fn @F() {
  427. // CHECK:STDOUT: !entry:
  428. // CHECK:STDOUT: name_binding_decl {
  429. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = binding_pattern c1 [concrete]
  430. // CHECK:STDOUT: }
  431. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  432. // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  433. // CHECK:STDOUT: %C.ref.loc8_24: %.d40 = name_ref C, imports.%.40b [concrete = constants.%.40b]
  434. // CHECK:STDOUT: %.loc8_27.1: ref %C = temporary_storage
  435. // CHECK:STDOUT: %addr.loc8_27.1: %ptr.d9e = addr_of %.loc8_27.1
  436. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%addr.loc8_27.1)
  437. // CHECK:STDOUT: %.loc8_27.2: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_27.1
  438. // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] {
  439. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  440. // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  441. // CHECK:STDOUT: }
  442. // CHECK:STDOUT: %.loc8_27.3: ref %C = temporary %.loc8_27.1, %.loc8_27.2
  443. // CHECK:STDOUT: %.loc8_27.4: %C = bind_value %.loc8_27.3
  444. // CHECK:STDOUT: %c1: %C = bind_name c1, %.loc8_27.4
  445. // CHECK:STDOUT: name_binding_decl {
  446. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = binding_pattern c2 [concrete]
  447. // CHECK:STDOUT: }
  448. // CHECK:STDOUT: %Cpp.ref.loc9_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  449. // CHECK:STDOUT: %C.ref.loc9_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  450. // CHECK:STDOUT: %C.ref.loc9_24: %.d40 = name_ref C, imports.%.40b [concrete = constants.%.40b]
  451. // CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [concrete = constants.%int_123.fff]
  452. // CHECK:STDOUT: %int_456: Core.IntLiteral = int_value 456 [concrete = constants.%int_456.010]
  453. // CHECK:STDOUT: %.loc9_35.1: ref %C = temporary_storage
  454. // CHECK:STDOUT: %impl.elem0.loc9_27: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  455. // 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.0c9]
  456. // 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]
  457. // CHECK:STDOUT: %bound_method.loc9_27.2: <bound method> = bound_method %int_123, %specific_fn.loc9_27 [concrete = constants.%bound_method.bec]
  458. // 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]
  459. // CHECK:STDOUT: %.loc9_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_27 [concrete = constants.%int_123.f7f]
  460. // CHECK:STDOUT: %.loc9_27.2: %i32 = converted %int_123, %.loc9_27.1 [concrete = constants.%int_123.f7f]
  461. // CHECK:STDOUT: %impl.elem0.loc9_32: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  462. // 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.ec6]
  463. // 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]
  464. // CHECK:STDOUT: %bound_method.loc9_32.2: <bound method> = bound_method %int_456, %specific_fn.loc9_32 [concrete = constants.%bound_method.ed0]
  465. // 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]
  466. // CHECK:STDOUT: %.loc9_32.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_32 [concrete = constants.%int_456.d17]
  467. // CHECK:STDOUT: %.loc9_32.2: %i32 = converted %int_456, %.loc9_32.1 [concrete = constants.%int_456.d17]
  468. // CHECK:STDOUT: %addr.loc9_35.1: %ptr.d9e = addr_of %.loc9_35.1
  469. // 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_35.1)
  470. // CHECK:STDOUT: %.loc9_35.2: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_35.1
  471. // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] {
  472. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  473. // CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  474. // CHECK:STDOUT: }
  475. // CHECK:STDOUT: %.loc9_35.3: ref %C = temporary %.loc9_35.1, %.loc9_35.2
  476. // CHECK:STDOUT: %.loc9_35.4: %C = bind_value %.loc9_35.3
  477. // CHECK:STDOUT: %c2: %C = bind_name c2, %.loc9_35.4
  478. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  479. // CHECK:STDOUT: %.loc9_35.5: %type_where = converted constants.%C, %facet_value.loc9 [concrete = constants.%facet_value]
  480. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound.loc9: <bound method> = bound_method %.loc9_35.3, constants.%DestroyT.as_type.as.Destroy.impl.Op.6b9
  481. // CHECK:STDOUT: <elided>
  482. // CHECK:STDOUT: %bound_method.loc9_35: <bound method> = bound_method %.loc9_35.3, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn.1
  483. // CHECK:STDOUT: %addr.loc9_35.2: %ptr.d9e = addr_of %.loc9_35.3
  484. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9_35(%addr.loc9_35.2)
  485. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  486. // CHECK:STDOUT: %.loc8_27.5: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  487. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %.loc8_27.3, constants.%DestroyT.as_type.as.Destroy.impl.Op.6b9
  488. // CHECK:STDOUT: <elided>
  489. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %.loc8_27.3, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn.2
  490. // CHECK:STDOUT: %addr.loc8_27.2: %ptr.d9e = addr_of %.loc8_27.3
  491. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_27.2)
  492. // CHECK:STDOUT: <elided>
  493. // CHECK:STDOUT: }
  494. // CHECK:STDOUT:
  495. // CHECK:STDOUT: --- import_default_arguments.carbon
  496. // CHECK:STDOUT:
  497. // CHECK:STDOUT: constants {
  498. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  499. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  500. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  501. // CHECK:STDOUT: %.d40: type = cpp_overload_set_type @C.C.1 [concrete]
  502. // CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @C.C.1 [concrete]
  503. // CHECK:STDOUT: %int_8.b85: Core.IntLiteral = int_value 8 [concrete]
  504. // CHECK:STDOUT: %int_9.988: Core.IntLiteral = int_value 9 [concrete]
  505. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  506. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  507. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  508. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.1: type = fn_type @C__carbon_thunk.1 [concrete]
  509. // CHECK:STDOUT: %C__carbon_thunk.d98342.1: %C__carbon_thunk.type.65f120.1 = struct_value () [concrete]
  510. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  511. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  512. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  513. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  514. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340 = struct_value () [symbolic]
  515. // CHECK:STDOUT: %ImplicitAs.impl_witness.204: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.9e9, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  516. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  517. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584 = struct_value () [concrete]
  518. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.204) [concrete]
  519. // CHECK:STDOUT: %.1df: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  520. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.0ab: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [concrete]
  521. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  522. // CHECK:STDOUT: %bound_method.b23: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  523. // CHECK:STDOUT: %int_8.98c: %i32 = int_value 8 [concrete]
  524. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.36a: <bound method> = bound_method %int_9.988, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [concrete]
  525. // CHECK:STDOUT: %bound_method.942: <bound method> = bound_method %int_9.988, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  526. // CHECK:STDOUT: %int_9.f88: %i32 = int_value 9 [concrete]
  527. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.2: type = fn_type @C__carbon_thunk.2 [concrete]
  528. // CHECK:STDOUT: %C__carbon_thunk.d98342.2: %C__carbon_thunk.type.65f120.2 = struct_value () [concrete]
  529. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  530. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  531. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.type.fc1: type = fn_type @DestroyT.as_type.as.Destroy.impl.Op, @DestroyT.as_type.as.Destroy.impl(%facet_value) [concrete]
  532. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.6b9: %DestroyT.as_type.as.Destroy.impl.Op.type.fc1 = struct_value () [concrete]
  533. // CHECK:STDOUT: }
  534. // CHECK:STDOUT:
  535. // CHECK:STDOUT: imports {
  536. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  537. // CHECK:STDOUT: .C = %C.decl
  538. // CHECK:STDOUT: import Cpp//...
  539. // CHECK:STDOUT: }
  540. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  541. // CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @C.C.1 [concrete = constants.%.40b]
  542. // 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] {
  543. // CHECK:STDOUT: <elided>
  544. // CHECK:STDOUT: } {
  545. // CHECK:STDOUT: <elided>
  546. // CHECK:STDOUT: }
  547. // CHECK:STDOUT: %Core.import_ref.ee7: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340) = 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.1c0)]
  548. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.9e9 = impl_witness_table (%Core.import_ref.ee7), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  549. // 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] {
  550. // CHECK:STDOUT: <elided>
  551. // CHECK:STDOUT: } {
  552. // CHECK:STDOUT: <elided>
  553. // CHECK:STDOUT: }
  554. // CHECK:STDOUT: }
  555. // CHECK:STDOUT:
  556. // CHECK:STDOUT: fn @F() {
  557. // CHECK:STDOUT: !entry:
  558. // CHECK:STDOUT: name_binding_decl {
  559. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = binding_pattern c1 [concrete]
  560. // CHECK:STDOUT: }
  561. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  562. // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  563. // CHECK:STDOUT: %C.ref.loc8_24: %.d40 = name_ref C, imports.%.40b [concrete = constants.%.40b]
  564. // CHECK:STDOUT: %int_8.loc8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  565. // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [concrete = constants.%int_9.988]
  566. // CHECK:STDOUT: %.loc8_31.1: ref %C = temporary_storage
  567. // CHECK:STDOUT: %impl.elem0.loc8_27: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  568. // 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.0ab]
  569. // 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]
  570. // CHECK:STDOUT: %bound_method.loc8_27.2: <bound method> = bound_method %int_8.loc8, %specific_fn.loc8_27 [concrete = constants.%bound_method.b23]
  571. // 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]
  572. // CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_27 [concrete = constants.%int_8.98c]
  573. // CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_8.loc8, %.loc8_27.1 [concrete = constants.%int_8.98c]
  574. // CHECK:STDOUT: %impl.elem0.loc8_30: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  575. // 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.36a]
  576. // 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]
  577. // CHECK:STDOUT: %bound_method.loc8_30.2: <bound method> = bound_method %int_9, %specific_fn.loc8_30 [concrete = constants.%bound_method.942]
  578. // 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]
  579. // CHECK:STDOUT: %.loc8_30.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_30 [concrete = constants.%int_9.f88]
  580. // CHECK:STDOUT: %.loc8_30.2: %i32 = converted %int_9, %.loc8_30.1 [concrete = constants.%int_9.f88]
  581. // CHECK:STDOUT: %addr.loc8_31.1: %ptr.d9e = addr_of %.loc8_31.1
  582. // 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_31.1)
  583. // CHECK:STDOUT: %.loc8_31.2: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_31.1
  584. // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] {
  585. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  586. // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  587. // CHECK:STDOUT: }
  588. // CHECK:STDOUT: %.loc8_31.3: ref %C = temporary %.loc8_31.1, %.loc8_31.2
  589. // CHECK:STDOUT: %.loc8_31.4: %C = bind_value %.loc8_31.3
  590. // CHECK:STDOUT: %c1: %C = bind_name c1, %.loc8_31.4
  591. // CHECK:STDOUT: name_binding_decl {
  592. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = binding_pattern c2 [concrete]
  593. // CHECK:STDOUT: }
  594. // CHECK:STDOUT: %Cpp.ref.loc9_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  595. // CHECK:STDOUT: %C.ref.loc9_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  596. // CHECK:STDOUT: %C.ref.loc9_24: %.d40 = name_ref C, imports.%.40b [concrete = constants.%.40b]
  597. // CHECK:STDOUT: %int_8.loc9: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  598. // CHECK:STDOUT: %.loc9_28.1: ref %C = temporary_storage
  599. // CHECK:STDOUT: %impl.elem0.loc9: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  600. // 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.0ab]
  601. // 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]
  602. // CHECK:STDOUT: %bound_method.loc9_27.2: <bound method> = bound_method %int_8.loc9, %specific_fn.loc9 [concrete = constants.%bound_method.b23]
  603. // 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]
  604. // CHECK:STDOUT: %.loc9_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9 [concrete = constants.%int_8.98c]
  605. // CHECK:STDOUT: %.loc9_27.2: %i32 = converted %int_8.loc9, %.loc9_27.1 [concrete = constants.%int_8.98c]
  606. // CHECK:STDOUT: %addr.loc9_28.1: %ptr.d9e = addr_of %.loc9_28.1
  607. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc9_27.2, %addr.loc9_28.1)
  608. // CHECK:STDOUT: %.loc9_28.2: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_28.1
  609. // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] {
  610. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  611. // CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  612. // CHECK:STDOUT: }
  613. // CHECK:STDOUT: %.loc9_28.3: ref %C = temporary %.loc9_28.1, %.loc9_28.2
  614. // CHECK:STDOUT: %.loc9_28.4: %C = bind_value %.loc9_28.3
  615. // CHECK:STDOUT: %c2: %C = bind_name c2, %.loc9_28.4
  616. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  617. // CHECK:STDOUT: %.loc9_28.5: %type_where = converted constants.%C, %facet_value.loc9 [concrete = constants.%facet_value]
  618. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound.loc9: <bound method> = bound_method %.loc9_28.3, constants.%DestroyT.as_type.as.Destroy.impl.Op.6b9
  619. // CHECK:STDOUT: <elided>
  620. // CHECK:STDOUT: %bound_method.loc9_28: <bound method> = bound_method %.loc9_28.3, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn.1
  621. // CHECK:STDOUT: %addr.loc9_28.2: %ptr.d9e = addr_of %.loc9_28.3
  622. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9_28(%addr.loc9_28.2)
  623. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  624. // CHECK:STDOUT: %.loc8_31.5: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  625. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %.loc8_31.3, constants.%DestroyT.as_type.as.Destroy.impl.Op.6b9
  626. // CHECK:STDOUT: <elided>
  627. // CHECK:STDOUT: %bound_method.loc8_31: <bound method> = bound_method %.loc8_31.3, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn.2
  628. // CHECK:STDOUT: %addr.loc8_31.2: %ptr.d9e = addr_of %.loc8_31.3
  629. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8_31(%addr.loc8_31.2)
  630. // CHECK:STDOUT: <elided>
  631. // CHECK:STDOUT: }
  632. // CHECK:STDOUT:
  633. // CHECK:STDOUT: --- import_template.carbon
  634. // CHECK:STDOUT:
  635. // CHECK:STDOUT: constants {
  636. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  637. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  638. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  639. // CHECK:STDOUT: %.d40: type = cpp_overload_set_type @C.C.1 [concrete]
  640. // CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @C.C.1 [concrete]
  641. // CHECK:STDOUT: %int_123.fff: Core.IntLiteral = int_value 123 [concrete]
  642. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  643. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  644. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  645. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.1: type = fn_type @C__carbon_thunk.1 [concrete]
  646. // CHECK:STDOUT: %C__carbon_thunk.d98342.1: %C__carbon_thunk.type.65f120.1 = struct_value () [concrete]
  647. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  648. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  649. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  650. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  651. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340 = struct_value () [symbolic]
  652. // CHECK:STDOUT: %ImplicitAs.impl_witness.204: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.9e9, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  653. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  654. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584 = struct_value () [concrete]
  655. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.204) [concrete]
  656. // CHECK:STDOUT: %.1df: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  657. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [concrete]
  658. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  659. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  660. // CHECK:STDOUT: %int_123.f7f: %i32 = int_value 123 [concrete]
  661. // CHECK:STDOUT: %true: bool = bool_literal true [concrete]
  662. // CHECK:STDOUT: %ptr.bb2: type = ptr_type bool [concrete]
  663. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.2: type = fn_type @C__carbon_thunk.2 [concrete]
  664. // CHECK:STDOUT: %C__carbon_thunk.d98342.2: %C__carbon_thunk.type.65f120.2 = struct_value () [concrete]
  665. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  666. // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
  667. // CHECK:STDOUT: %Copy.impl_witness.a56: <witness> = impl_witness imports.%Copy.impl_witness_table.189 [concrete]
  668. // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value bool, (%Copy.impl_witness.a56) [concrete]
  669. // CHECK:STDOUT: %.05c: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete]
  670. // CHECK:STDOUT: %bool.as.Copy.impl.Op.type: type = fn_type @bool.as.Copy.impl.Op [concrete]
  671. // CHECK:STDOUT: %bool.as.Copy.impl.Op: %bool.as.Copy.impl.Op.type = struct_value () [concrete]
  672. // CHECK:STDOUT: %bool.as.Copy.impl.Op.bound: <bound method> = bound_method %true, %bool.as.Copy.impl.Op [concrete]
  673. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.3: type = fn_type @C__carbon_thunk.3 [concrete]
  674. // CHECK:STDOUT: %C__carbon_thunk.d98342.3: %C__carbon_thunk.type.65f120.3 = struct_value () [concrete]
  675. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  676. // CHECK:STDOUT: %facet_value.b21: %type_where = facet_value %C, () [concrete]
  677. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.type.fc1: type = fn_type @DestroyT.as_type.as.Destroy.impl.Op, @DestroyT.as_type.as.Destroy.impl(%facet_value.b21) [concrete]
  678. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.6b9: %DestroyT.as_type.as.Destroy.impl.Op.type.fc1 = struct_value () [concrete]
  679. // CHECK:STDOUT: %facet_value.3f5: %type_where = facet_value bool, () [concrete]
  680. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.type.28d: type = fn_type @DestroyT.as_type.as.Destroy.impl.Op, @DestroyT.as_type.as.Destroy.impl(%facet_value.3f5) [concrete]
  681. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.167: %DestroyT.as_type.as.Destroy.impl.Op.type.28d = struct_value () [concrete]
  682. // CHECK:STDOUT: }
  683. // CHECK:STDOUT:
  684. // CHECK:STDOUT: imports {
  685. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  686. // CHECK:STDOUT: .C = %C.decl
  687. // CHECK:STDOUT: import Cpp//...
  688. // CHECK:STDOUT: }
  689. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  690. // CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @C.C.1 [concrete = constants.%.40b]
  691. // 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] {
  692. // CHECK:STDOUT: <elided>
  693. // CHECK:STDOUT: } {
  694. // CHECK:STDOUT: <elided>
  695. // CHECK:STDOUT: }
  696. // CHECK:STDOUT: %Core.import_ref.ee7: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340) = 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.1c0)]
  697. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.9e9 = impl_witness_table (%Core.import_ref.ee7), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  698. // 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] {
  699. // CHECK:STDOUT: <elided>
  700. // CHECK:STDOUT: } {
  701. // CHECK:STDOUT: <elided>
  702. // CHECK:STDOUT: }
  703. // 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]
  704. // CHECK:STDOUT: %Copy.impl_witness_table.189 = impl_witness_table (%Core.import_ref.cc5), @bool.as.Copy.impl [concrete]
  705. // 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] {
  706. // CHECK:STDOUT: <elided>
  707. // CHECK:STDOUT: } {
  708. // CHECK:STDOUT: <elided>
  709. // CHECK:STDOUT: }
  710. // CHECK:STDOUT: }
  711. // CHECK:STDOUT:
  712. // CHECK:STDOUT: fn @F() {
  713. // CHECK:STDOUT: !entry:
  714. // CHECK:STDOUT: name_binding_decl {
  715. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = binding_pattern c1 [concrete]
  716. // CHECK:STDOUT: %c1.var_patt: %pattern_type.217 = var_pattern %c1.patt [concrete]
  717. // CHECK:STDOUT: }
  718. // CHECK:STDOUT: %c1.var: ref %C = var %c1.var_patt
  719. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  720. // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  721. // CHECK:STDOUT: %C.ref.loc8_24: %.d40 = name_ref C, imports.%.40b [concrete = constants.%.40b]
  722. // CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [concrete = constants.%int_123.fff]
  723. // CHECK:STDOUT: %.loc8_3.1: ref %C = splice_block %c1.var {}
  724. // CHECK:STDOUT: %impl.elem0.loc8: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  725. // 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]
  726. // 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]
  727. // CHECK:STDOUT: %bound_method.loc8_27.2: <bound method> = bound_method %int_123, %specific_fn [concrete = constants.%bound_method]
  728. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc8_27.2(%int_123) [concrete = constants.%int_123.f7f]
  729. // CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_123.f7f]
  730. // CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_123, %.loc8_27.1 [concrete = constants.%int_123.f7f]
  731. // CHECK:STDOUT: %addr.loc8_30: %ptr.d9e = addr_of %.loc8_3.1
  732. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%.loc8_27.2, %addr.loc8_30)
  733. // CHECK:STDOUT: %.loc8_30: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_3.1
  734. // CHECK:STDOUT: assign %c1.var, %.loc8_30
  735. // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] {
  736. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  737. // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  738. // CHECK:STDOUT: }
  739. // CHECK:STDOUT: %c1: ref %C = bind_name c1, %c1.var
  740. // CHECK:STDOUT: name_binding_decl {
  741. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = binding_pattern c2 [concrete]
  742. // CHECK:STDOUT: %c2.var_patt: %pattern_type.217 = var_pattern %c2.patt [concrete]
  743. // CHECK:STDOUT: }
  744. // CHECK:STDOUT: %c2.var: ref %C = var %c2.var_patt
  745. // CHECK:STDOUT: %Cpp.ref.loc9_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  746. // CHECK:STDOUT: %C.ref.loc9_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  747. // CHECK:STDOUT: %C.ref.loc9_24: %.d40 = name_ref C, imports.%.40b [concrete = constants.%.40b]
  748. // CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
  749. // CHECK:STDOUT: %.loc9_3.1: ref %C = splice_block %c2.var {}
  750. // CHECK:STDOUT: %.loc9_27.1: ref bool = temporary_storage
  751. // CHECK:STDOUT: %impl.elem0.loc9: %.05c = impl_witness_access constants.%Copy.impl_witness.a56, element0 [concrete = constants.%bool.as.Copy.impl.Op]
  752. // CHECK:STDOUT: %bound_method.loc9_27.1: <bound method> = bound_method %true, %impl.elem0.loc9 [concrete = constants.%bool.as.Copy.impl.Op.bound]
  753. // CHECK:STDOUT: %bool.as.Copy.impl.Op.call: init bool = call %bound_method.loc9_27.1(%true) [concrete = constants.%true]
  754. // CHECK:STDOUT: %.loc9_27.2: ref bool = temporary %.loc9_27.1, %bool.as.Copy.impl.Op.call
  755. // CHECK:STDOUT: %addr.loc9_31.1: %ptr.bb2 = addr_of %.loc9_27.2
  756. // CHECK:STDOUT: %addr.loc9_31.2: %ptr.d9e = addr_of %.loc9_3.1
  757. // 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)
  758. // CHECK:STDOUT: %.loc9_31: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_3.1
  759. // CHECK:STDOUT: assign %c2.var, %.loc9_31
  760. // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] {
  761. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  762. // CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  763. // CHECK:STDOUT: }
  764. // CHECK:STDOUT: %c2: ref %C = bind_name c2, %c2.var
  765. // CHECK:STDOUT: name_binding_decl {
  766. // CHECK:STDOUT: %c3.patt: %pattern_type.217 = binding_pattern c3 [concrete]
  767. // CHECK:STDOUT: %c3.var_patt: %pattern_type.217 = var_pattern %c3.patt [concrete]
  768. // CHECK:STDOUT: }
  769. // CHECK:STDOUT: %c3.var: ref %C = var %c3.var_patt
  770. // CHECK:STDOUT: %Cpp.ref.loc10_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  771. // CHECK:STDOUT: %C.ref.loc10_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  772. // CHECK:STDOUT: %C.ref.loc10_24: %.d40 = name_ref C, imports.%.40b [concrete = constants.%.40b]
  773. // CHECK:STDOUT: %c1.ref: ref %C = name_ref c1, %c1
  774. // CHECK:STDOUT: %addr.loc10_27: %ptr.d9e = addr_of %c1.ref
  775. // CHECK:STDOUT: %.loc10_3.1: ref %C = splice_block %c3.var {}
  776. // CHECK:STDOUT: %addr.loc10_30: %ptr.d9e = addr_of %.loc10_3.1
  777. // 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)
  778. // CHECK:STDOUT: %.loc10_30: init %C = in_place_init %C__carbon_thunk.call.loc10, %.loc10_3.1
  779. // CHECK:STDOUT: assign %c3.var, %.loc10_30
  780. // CHECK:STDOUT: %.loc10_14: type = splice_block %C.ref.loc10_14 [concrete = constants.%C] {
  781. // CHECK:STDOUT: %Cpp.ref.loc10_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  782. // CHECK:STDOUT: %C.ref.loc10_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  783. // CHECK:STDOUT: }
  784. // CHECK:STDOUT: %c3: ref %C = bind_name c3, %c3.var
  785. // CHECK:STDOUT: %facet_value.loc10: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value.b21]
  786. // CHECK:STDOUT: %.loc10_3.2: %type_where = converted constants.%C, %facet_value.loc10 [concrete = constants.%facet_value.b21]
  787. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound.loc10: <bound method> = bound_method %c3.var, constants.%DestroyT.as_type.as.Destroy.impl.Op.6b9
  788. // CHECK:STDOUT: <elided>
  789. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %c3.var, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn.1
  790. // CHECK:STDOUT: %addr.loc10_3: %ptr.d9e = addr_of %c3.var
  791. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10_3)
  792. // CHECK:STDOUT: %facet_value.loc9_27: %type_where = facet_value bool, () [concrete = constants.%facet_value.3f5]
  793. // CHECK:STDOUT: %.loc9_27.3: %type_where = converted bool, %facet_value.loc9_27 [concrete = constants.%facet_value.3f5]
  794. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound.loc9_27: <bound method> = bound_method %.loc9_27.2, constants.%DestroyT.as_type.as.Destroy.impl.Op.167
  795. // CHECK:STDOUT: <elided>
  796. // CHECK:STDOUT: %bound_method.loc9_27.2: <bound method> = bound_method %.loc9_27.2, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn.2
  797. // CHECK:STDOUT: %addr.loc9_27: %ptr.bb2 = addr_of %.loc9_27.2
  798. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call.loc9_27: init %empty_tuple.type = call %bound_method.loc9_27.2(%addr.loc9_27)
  799. // CHECK:STDOUT: %facet_value.loc9_3: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value.b21]
  800. // CHECK:STDOUT: %.loc9_3.2: %type_where = converted constants.%C, %facet_value.loc9_3 [concrete = constants.%facet_value.b21]
  801. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound.loc9_3: <bound method> = bound_method %c2.var, constants.%DestroyT.as_type.as.Destroy.impl.Op.6b9
  802. // CHECK:STDOUT: <elided>
  803. // CHECK:STDOUT: %bound_method.loc9_3: <bound method> = bound_method %c2.var, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn.3
  804. // CHECK:STDOUT: %addr.loc9_3: %ptr.d9e = addr_of %c2.var
  805. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call.loc9_3: init %empty_tuple.type = call %bound_method.loc9_3(%addr.loc9_3)
  806. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value.b21]
  807. // CHECK:STDOUT: %.loc8_3.2: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value.b21]
  808. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %c1.var, constants.%DestroyT.as_type.as.Destroy.impl.Op.6b9
  809. // CHECK:STDOUT: <elided>
  810. // CHECK:STDOUT: %bound_method.loc8_3: <bound method> = bound_method %c1.var, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn.4
  811. // CHECK:STDOUT: %addr.loc8_3: %ptr.d9e = addr_of %c1.var
  812. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8_3(%addr.loc8_3)
  813. // CHECK:STDOUT: <elided>
  814. // CHECK:STDOUT: }
  815. // CHECK:STDOUT:
  816. // CHECK:STDOUT: --- fail_todo_import_implicit_single_argument.carbon
  817. // CHECK:STDOUT:
  818. // CHECK:STDOUT: constants {
  819. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  820. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  821. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  822. // CHECK:STDOUT: %.d40: type = cpp_overload_set_type @C.C [concrete]
  823. // CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @C.C [concrete]
  824. // CHECK:STDOUT: %int_8.b85: Core.IntLiteral = int_value 8 [concrete]
  825. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  826. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  827. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  828. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  829. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  830. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  831. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  832. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  833. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  834. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340 = struct_value () [symbolic]
  835. // CHECK:STDOUT: %ImplicitAs.impl_witness.204: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.9e9, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  836. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  837. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584 = struct_value () [concrete]
  838. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.204) [concrete]
  839. // CHECK:STDOUT: %.1df: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  840. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [concrete]
  841. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  842. // CHECK:STDOUT: %bound_method.b23: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  843. // CHECK:STDOUT: %int_8.98c: %i32 = int_value 8 [concrete]
  844. // CHECK:STDOUT: %As.type.dbd: type = facet_type <@As, @As(%i32)> [concrete]
  845. // CHECK:STDOUT: %As.Convert.type.99b: type = fn_type @As.Convert, @As(%i32) [concrete]
  846. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.565: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To) [symbolic]
  847. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.d2c: %Core.IntLiteral.as.As.impl.Convert.type.565 = struct_value () [symbolic]
  848. // CHECK:STDOUT: %As.impl_witness.080: <witness> = impl_witness imports.%As.impl_witness_table.5ad, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  849. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.aaf: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  850. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.414: %Core.IntLiteral.as.As.impl.Convert.type.aaf = struct_value () [concrete]
  851. // CHECK:STDOUT: %As.facet: %As.type.dbd = facet_value Core.IntLiteral, (%As.impl_witness.080) [concrete]
  852. // CHECK:STDOUT: %.351: type = fn_type_with_self_type %As.Convert.type.99b, %As.facet [concrete]
  853. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.414 [concrete]
  854. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.414, @Core.IntLiteral.as.As.impl.Convert(%int_32) [concrete]
  855. // CHECK:STDOUT: %bound_method.80c: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
  856. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  857. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  858. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.type.fc1: type = fn_type @DestroyT.as_type.as.Destroy.impl.Op, @DestroyT.as_type.as.Destroy.impl(%facet_value) [concrete]
  859. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.6b9: %DestroyT.as_type.as.Destroy.impl.Op.type.fc1 = struct_value () [concrete]
  860. // CHECK:STDOUT: }
  861. // CHECK:STDOUT:
  862. // CHECK:STDOUT: imports {
  863. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  864. // CHECK:STDOUT: .C = %C.decl
  865. // CHECK:STDOUT: import Cpp//...
  866. // CHECK:STDOUT: }
  867. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  868. // CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @C.C [concrete = constants.%.40b]
  869. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  870. // CHECK:STDOUT: <elided>
  871. // CHECK:STDOUT: } {
  872. // CHECK:STDOUT: <elided>
  873. // CHECK:STDOUT: }
  874. // CHECK:STDOUT: %Core.import_ref.ee7: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340) = 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.1c0)]
  875. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.9e9 = impl_witness_table (%Core.import_ref.ee7), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  876. // CHECK:STDOUT: %Core.import_ref.99c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.565) = 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.d2c)]
  877. // CHECK:STDOUT: %As.impl_witness_table.5ad = impl_witness_table (%Core.import_ref.99c), @Core.IntLiteral.as.As.impl [concrete]
  878. // CHECK:STDOUT: }
  879. // CHECK:STDOUT:
  880. // CHECK:STDOUT: fn @F() {
  881. // CHECK:STDOUT: !entry:
  882. // CHECK:STDOUT: name_binding_decl {
  883. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = binding_pattern c1 [concrete]
  884. // CHECK:STDOUT: }
  885. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  886. // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  887. // CHECK:STDOUT: %C.ref.loc8_24: %.d40 = name_ref C, imports.%.40b [concrete = constants.%.40b]
  888. // CHECK:STDOUT: %int_8.loc8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  889. // CHECK:STDOUT: %.loc8_28.1: ref %C = temporary_storage
  890. // CHECK:STDOUT: %impl.elem0.loc8: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  891. // 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]
  892. // 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]
  893. // CHECK:STDOUT: %bound_method.loc8_27.2: <bound method> = bound_method %int_8.loc8, %specific_fn.loc8 [concrete = constants.%bound_method.b23]
  894. // 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]
  895. // CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_8.98c]
  896. // CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_8.loc8, %.loc8_27.1 [concrete = constants.%int_8.98c]
  897. // CHECK:STDOUT: %addr.loc8_28.1: %ptr.d9e = addr_of %.loc8_28.1
  898. // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc8_27.2, %addr.loc8_28.1)
  899. // CHECK:STDOUT: %.loc8_28.2: init %C = in_place_init %C__carbon_thunk.call, %.loc8_28.1
  900. // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] {
  901. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  902. // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  903. // CHECK:STDOUT: }
  904. // CHECK:STDOUT: %.loc8_28.3: ref %C = temporary %.loc8_28.1, %.loc8_28.2
  905. // CHECK:STDOUT: %.loc8_28.4: %C = bind_value %.loc8_28.3
  906. // CHECK:STDOUT: %c1: %C = bind_name c1, %.loc8_28.4
  907. // CHECK:STDOUT: name_binding_decl {
  908. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = binding_pattern c2 [concrete]
  909. // CHECK:STDOUT: }
  910. // CHECK:STDOUT: %int_8.loc16: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  911. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  912. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  913. // CHECK:STDOUT: %impl.elem0.loc16: %.351 = impl_witness_access constants.%As.impl_witness.080, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.414]
  914. // 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]
  915. // 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]
  916. // CHECK:STDOUT: %bound_method.loc16_21.2: <bound method> = bound_method %int_8.loc16, %specific_fn.loc16 [concrete = constants.%bound_method.80c]
  917. // 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]
  918. // CHECK:STDOUT: %.loc16_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_8.98c]
  919. // CHECK:STDOUT: %.loc16_21.2: %i32 = converted %int_8.loc16, %.loc16_21.1 [concrete = constants.%int_8.98c]
  920. // CHECK:STDOUT: %.loc16_14: type = splice_block %C.ref.loc16 [concrete = constants.%C] {
  921. // CHECK:STDOUT: %Cpp.ref.loc16: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  922. // CHECK:STDOUT: %C.ref.loc16: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  923. // CHECK:STDOUT: }
  924. // CHECK:STDOUT: %.loc16_21.3: %C = converted %.loc16_21.2, <error> [concrete = <error>]
  925. // CHECK:STDOUT: %c2: %C = bind_name c2, <error> [concrete = <error>]
  926. // CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  927. // CHECK:STDOUT: %.loc8_28.5: %type_where = converted constants.%C, %facet_value [concrete = constants.%facet_value]
  928. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc8_28.3, constants.%DestroyT.as_type.as.Destroy.impl.Op.6b9
  929. // CHECK:STDOUT: <elided>
  930. // CHECK:STDOUT: %bound_method.loc8_28: <bound method> = bound_method %.loc8_28.3, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn
  931. // CHECK:STDOUT: %addr.loc8_28.2: %ptr.d9e = addr_of %.loc8_28.3
  932. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_28(%addr.loc8_28.2)
  933. // CHECK:STDOUT: <elided>
  934. // CHECK:STDOUT: }
  935. // CHECK:STDOUT:
  936. // CHECK:STDOUT: --- fail_todo_import_implicit_multi_arguments.carbon
  937. // CHECK:STDOUT:
  938. // CHECK:STDOUT: constants {
  939. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  940. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  941. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  942. // CHECK:STDOUT: %.d40: type = cpp_overload_set_type @C.C.1 [concrete]
  943. // CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @C.C.1 [concrete]
  944. // CHECK:STDOUT: %int_8.b85: Core.IntLiteral = int_value 8 [concrete]
  945. // CHECK:STDOUT: %int_9.988: Core.IntLiteral = int_value 9 [concrete]
  946. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  947. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  948. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  949. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.1: type = fn_type @C__carbon_thunk.1 [concrete]
  950. // CHECK:STDOUT: %C__carbon_thunk.d98342.1: %C__carbon_thunk.type.65f120.1 = struct_value () [concrete]
  951. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  952. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  953. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  954. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  955. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340 = struct_value () [symbolic]
  956. // CHECK:STDOUT: %ImplicitAs.impl_witness.204: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.9e9, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  957. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  958. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584 = struct_value () [concrete]
  959. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.204) [concrete]
  960. // CHECK:STDOUT: %.1df: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  961. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.0ab: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [concrete]
  962. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  963. // CHECK:STDOUT: %bound_method.b23: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  964. // CHECK:STDOUT: %int_8.98c: %i32 = int_value 8 [concrete]
  965. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.36a: <bound method> = bound_method %int_9.988, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [concrete]
  966. // CHECK:STDOUT: %bound_method.942: <bound method> = bound_method %int_9.988, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  967. // CHECK:STDOUT: %int_9.f88: %i32 = int_value 9 [concrete]
  968. // CHECK:STDOUT: %C__carbon_thunk.type.65f120.2: type = fn_type @C__carbon_thunk.2 [concrete]
  969. // CHECK:STDOUT: %C__carbon_thunk.d98342.2: %C__carbon_thunk.type.65f120.2 = struct_value () [concrete]
  970. // CHECK:STDOUT: %As.type.dbd: type = facet_type <@As, @As(%i32)> [concrete]
  971. // CHECK:STDOUT: %As.Convert.type.99b: type = fn_type @As.Convert, @As(%i32) [concrete]
  972. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.565: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To) [symbolic]
  973. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.d2c: %Core.IntLiteral.as.As.impl.Convert.type.565 = struct_value () [symbolic]
  974. // CHECK:STDOUT: %As.impl_witness.080: <witness> = impl_witness imports.%As.impl_witness_table.5ad, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  975. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.aaf: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  976. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.414: %Core.IntLiteral.as.As.impl.Convert.type.aaf = struct_value () [concrete]
  977. // CHECK:STDOUT: %As.facet: %As.type.dbd = facet_value Core.IntLiteral, (%As.impl_witness.080) [concrete]
  978. // CHECK:STDOUT: %.351: type = fn_type_with_self_type %As.Convert.type.99b, %As.facet [concrete]
  979. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.414 [concrete]
  980. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.414, @Core.IntLiteral.as.As.impl.Convert(%int_32) [concrete]
  981. // CHECK:STDOUT: %bound_method.80c: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
  982. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  983. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  984. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.type.fc1: type = fn_type @DestroyT.as_type.as.Destroy.impl.Op, @DestroyT.as_type.as.Destroy.impl(%facet_value) [concrete]
  985. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.6b9: %DestroyT.as_type.as.Destroy.impl.Op.type.fc1 = struct_value () [concrete]
  986. // CHECK:STDOUT: }
  987. // CHECK:STDOUT:
  988. // CHECK:STDOUT: imports {
  989. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  990. // CHECK:STDOUT: .C = %C.decl
  991. // CHECK:STDOUT: import Cpp//...
  992. // CHECK:STDOUT: }
  993. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  994. // CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @C.C.1 [concrete = constants.%.40b]
  995. // 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] {
  996. // CHECK:STDOUT: <elided>
  997. // CHECK:STDOUT: } {
  998. // CHECK:STDOUT: <elided>
  999. // CHECK:STDOUT: }
  1000. // CHECK:STDOUT: %Core.import_ref.ee7: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340) = 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.1c0)]
  1001. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.9e9 = impl_witness_table (%Core.import_ref.ee7), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  1002. // 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] {
  1003. // CHECK:STDOUT: <elided>
  1004. // CHECK:STDOUT: } {
  1005. // CHECK:STDOUT: <elided>
  1006. // CHECK:STDOUT: }
  1007. // CHECK:STDOUT: %Core.import_ref.99c: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.565) = 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.d2c)]
  1008. // CHECK:STDOUT: %As.impl_witness_table.5ad = impl_witness_table (%Core.import_ref.99c), @Core.IntLiteral.as.As.impl [concrete]
  1009. // CHECK:STDOUT: }
  1010. // CHECK:STDOUT:
  1011. // CHECK:STDOUT: fn @F() {
  1012. // CHECK:STDOUT: !entry:
  1013. // CHECK:STDOUT: name_binding_decl {
  1014. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = binding_pattern c1 [concrete]
  1015. // CHECK:STDOUT: }
  1016. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1017. // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1018. // CHECK:STDOUT: %C.ref.loc8_24: %.d40 = name_ref C, imports.%.40b [concrete = constants.%.40b]
  1019. // CHECK:STDOUT: %int_8.loc8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  1020. // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [concrete = constants.%int_9.988]
  1021. // CHECK:STDOUT: %.loc8_31.1: ref %C = temporary_storage
  1022. // CHECK:STDOUT: %impl.elem0.loc8_27: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  1023. // 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.0ab]
  1024. // 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]
  1025. // CHECK:STDOUT: %bound_method.loc8_27.2: <bound method> = bound_method %int_8.loc8, %specific_fn.loc8_27 [concrete = constants.%bound_method.b23]
  1026. // 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]
  1027. // CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_27 [concrete = constants.%int_8.98c]
  1028. // CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_8.loc8, %.loc8_27.1 [concrete = constants.%int_8.98c]
  1029. // CHECK:STDOUT: %impl.elem0.loc8_30: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  1030. // 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.36a]
  1031. // 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]
  1032. // CHECK:STDOUT: %bound_method.loc8_30.2: <bound method> = bound_method %int_9, %specific_fn.loc8_30 [concrete = constants.%bound_method.942]
  1033. // 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]
  1034. // CHECK:STDOUT: %.loc8_30.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_30 [concrete = constants.%int_9.f88]
  1035. // CHECK:STDOUT: %.loc8_30.2: %i32 = converted %int_9, %.loc8_30.1 [concrete = constants.%int_9.f88]
  1036. // CHECK:STDOUT: %addr.loc8_31.1: %ptr.d9e = addr_of %.loc8_31.1
  1037. // 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_31.1)
  1038. // CHECK:STDOUT: %.loc8_31.2: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_31.1
  1039. // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] {
  1040. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1041. // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1042. // CHECK:STDOUT: }
  1043. // CHECK:STDOUT: %.loc8_31.3: ref %C = temporary %.loc8_31.1, %.loc8_31.2
  1044. // CHECK:STDOUT: %.loc8_31.4: %C = bind_value %.loc8_31.3
  1045. // CHECK:STDOUT: %c1: %C = bind_name c1, %.loc8_31.4
  1046. // CHECK:STDOUT: name_binding_decl {
  1047. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = binding_pattern c2 [concrete]
  1048. // CHECK:STDOUT: }
  1049. // CHECK:STDOUT: %Cpp.ref.loc9_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1050. // CHECK:STDOUT: %C.ref.loc9_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1051. // CHECK:STDOUT: %C.ref.loc9_24: %.d40 = name_ref C, imports.%.40b [concrete = constants.%.40b]
  1052. // CHECK:STDOUT: %int_8.loc9: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  1053. // CHECK:STDOUT: %.loc9_28.1: ref %C = temporary_storage
  1054. // CHECK:STDOUT: %impl.elem0.loc9: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  1055. // 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.0ab]
  1056. // 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]
  1057. // CHECK:STDOUT: %bound_method.loc9_27.2: <bound method> = bound_method %int_8.loc9, %specific_fn.loc9 [concrete = constants.%bound_method.b23]
  1058. // 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]
  1059. // CHECK:STDOUT: %.loc9_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9 [concrete = constants.%int_8.98c]
  1060. // CHECK:STDOUT: %.loc9_27.2: %i32 = converted %int_8.loc9, %.loc9_27.1 [concrete = constants.%int_8.98c]
  1061. // CHECK:STDOUT: %addr.loc9_28.1: %ptr.d9e = addr_of %.loc9_28.1
  1062. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc9_27.2, %addr.loc9_28.1)
  1063. // CHECK:STDOUT: %.loc9_28.2: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_28.1
  1064. // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] {
  1065. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1066. // CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1067. // CHECK:STDOUT: }
  1068. // CHECK:STDOUT: %.loc9_28.3: ref %C = temporary %.loc9_28.1, %.loc9_28.2
  1069. // CHECK:STDOUT: %.loc9_28.4: %C = bind_value %.loc9_28.3
  1070. // CHECK:STDOUT: %c2: %C = bind_name c2, %.loc9_28.4
  1071. // CHECK:STDOUT: name_binding_decl {
  1072. // CHECK:STDOUT: %c3.patt: %pattern_type.217 = binding_pattern c3 [concrete]
  1073. // CHECK:STDOUT: }
  1074. // CHECK:STDOUT: %int_8.loc17: Core.IntLiteral = int_value 8 [concrete = constants.%int_8.b85]
  1075. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1076. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1077. // CHECK:STDOUT: %impl.elem0.loc17: %.351 = impl_witness_access constants.%As.impl_witness.080, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.414]
  1078. // 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]
  1079. // 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]
  1080. // CHECK:STDOUT: %bound_method.loc17_21.2: <bound method> = bound_method %int_8.loc17, %specific_fn.loc17 [concrete = constants.%bound_method.80c]
  1081. // 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]
  1082. // CHECK:STDOUT: %.loc17_21.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_8.98c]
  1083. // CHECK:STDOUT: %.loc17_21.2: %i32 = converted %int_8.loc17, %.loc17_21.1 [concrete = constants.%int_8.98c]
  1084. // CHECK:STDOUT: %.loc17_14: type = splice_block %C.ref.loc17 [concrete = constants.%C] {
  1085. // CHECK:STDOUT: %Cpp.ref.loc17: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1086. // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1087. // CHECK:STDOUT: }
  1088. // CHECK:STDOUT: %.loc17_21.3: %C = converted %.loc17_21.2, <error> [concrete = <error>]
  1089. // CHECK:STDOUT: %c3: %C = bind_name c3, <error> [concrete = <error>]
  1090. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1091. // CHECK:STDOUT: %.loc9_28.5: %type_where = converted constants.%C, %facet_value.loc9 [concrete = constants.%facet_value]
  1092. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound.loc9: <bound method> = bound_method %.loc9_28.3, constants.%DestroyT.as_type.as.Destroy.impl.Op.6b9
  1093. // CHECK:STDOUT: <elided>
  1094. // CHECK:STDOUT: %bound_method.loc9_28: <bound method> = bound_method %.loc9_28.3, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn.1
  1095. // CHECK:STDOUT: %addr.loc9_28.2: %ptr.d9e = addr_of %.loc9_28.3
  1096. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9_28(%addr.loc9_28.2)
  1097. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1098. // CHECK:STDOUT: %.loc8_31.5: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  1099. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %.loc8_31.3, constants.%DestroyT.as_type.as.Destroy.impl.Op.6b9
  1100. // CHECK:STDOUT: <elided>
  1101. // CHECK:STDOUT: %bound_method.loc8_31: <bound method> = bound_method %.loc8_31.3, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn.2
  1102. // CHECK:STDOUT: %addr.loc8_31.2: %ptr.d9e = addr_of %.loc8_31.3
  1103. // CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8_31(%addr.loc8_31.2)
  1104. // CHECK:STDOUT: <elided>
  1105. // CHECK:STDOUT: }
  1106. // CHECK:STDOUT: