overloads.carbon 148 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107
  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/primitives.carbon
  6. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  7. //
  8. // AUTOUPDATE
  9. // TIP: To test this file alone, run:
  10. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/overloads.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/overloads.carbon
  13. // ============================================================================
  14. // Overloaded sets tests
  15. // ============================================================================
  16. // --- multiple_functions_no_overloads.h
  17. auto foo(short a) -> void;
  18. auto bar(short a) -> void;
  19. // --- import_multiple_functions_no_overloads.carbon
  20. library "[[@TEST_NAME]]";
  21. import Cpp library "multiple_functions_no_overloads.h";
  22. fn F() {
  23. Cpp.bar(1 as i16);
  24. }
  25. // --- overloaded_functions.h
  26. auto foo(short a) -> void;
  27. auto foo(int a) -> void;
  28. // --- import_overloaded_functions.carbon
  29. library "[[@TEST_NAME]]";
  30. import Cpp library "overloaded_functions.h";
  31. fn F() {
  32. Cpp.foo(1 as i32);
  33. }
  34. // --- both_overloaded_functions_called.h
  35. auto foo(short a) -> void;
  36. auto foo(int a) -> void;
  37. // --- import_both_overloaded_functions_called.carbon
  38. library "[[@TEST_NAME]]";
  39. import Cpp library "both_overloaded_functions_called.h";
  40. fn F() {
  41. Cpp.foo(1 as i32);
  42. Cpp.foo(1 as i16);
  43. }
  44. // --- multiple_overloaded_sets.h
  45. auto foo(short a) -> void;
  46. auto foo(int a) -> void;
  47. auto bar(long a) -> void;
  48. auto bar(int a) -> void;
  49. // --- import_multiple_overloaded_sets.carbon
  50. library "[[@TEST_NAME]]";
  51. import Cpp library "multiple_overloaded_sets.h";
  52. fn F() {
  53. Cpp.foo(1 as i32);
  54. Cpp.bar(1 as i32);
  55. }
  56. // ============================================================================
  57. // Call args tests
  58. // ============================================================================
  59. // --- int_i32_literal.h
  60. auto foo(short a) -> void;
  61. auto foo(int a) -> void;
  62. // --- import_int_i32_literal.carbon
  63. library "[[@TEST_NAME]]";
  64. import Cpp library "int_i32_literal.h";
  65. fn F() {
  66. Cpp.foo(0x7FFF);
  67. }
  68. // --- int_i64_literal.h
  69. auto foo(long a) -> void;
  70. auto foo(int a) -> void;
  71. // --- import_int_i64_literal.carbon
  72. library "[[@TEST_NAME]]";
  73. import Cpp library "int_i64_literal.h";
  74. fn F() {
  75. Cpp.foo(0x7FFF_FFFF_FFFF_FFFF);
  76. }
  77. // --- large_int_literal.h
  78. auto foo(long a) -> void;
  79. auto foo(int a) -> void;
  80. // --- fail_import_large_int_literal.carbon
  81. library "[[@TEST_NAME]]";
  82. import Cpp library "large_int_literal.h";
  83. fn F() {
  84. // CHECK:STDERR: fail_import_large_int_literal.carbon:[[@LINE+5]]:11: error: integer value 9223372036854775808 too large for type `i64` [IntTooLargeForType]
  85. // CHECK:STDERR: Cpp.foo(0x8000_0000_0000_0000);
  86. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
  87. // CHECK:STDERR: fail_import_large_int_literal.carbon: note: initializing function parameter [InCallToFunctionParam]
  88. // CHECK:STDERR:
  89. Cpp.foo(0x8000_0000_0000_0000);
  90. }
  91. // --- negative_int_literal.h
  92. auto foo(long a) -> void;
  93. auto foo(int a) -> void;
  94. // --- import_negative_int_literal.carbon
  95. library "[[@TEST_NAME]]";
  96. import Cpp library "negative_int_literal.h";
  97. fn F() {
  98. // selects `auto foo(int a) -> void;`
  99. Cpp.foo(-1);
  100. }
  101. // --- negative_literal_passed_to_unsigned.h
  102. auto foo(unsigned int a) -> void;
  103. // --- fail_import_negative_literal_passed_to_unsigned.carbon
  104. library "[[@TEST_NAME]]";
  105. import Cpp library "negative_literal_passed_to_unsigned.h";
  106. fn F() {
  107. // CHECK:STDERR: fail_import_negative_literal_passed_to_unsigned.carbon:[[@LINE+5]]:11: error: negative integer value -1 converted to unsigned type `u32` [NegativeIntInUnsignedType]
  108. // CHECK:STDERR: Cpp.foo(-1);
  109. // CHECK:STDERR: ^~
  110. // CHECK:STDERR: fail_import_negative_literal_passed_to_unsigned.carbon: note: initializing function parameter [InCallToFunctionParam]
  111. // CHECK:STDERR:
  112. Cpp.foo(-1);
  113. }
  114. // --- struct_literal_call_arg.h
  115. struct S {};
  116. auto foo(S a) -> void;
  117. auto foo(int a) -> void;
  118. // --- fail_todo_import_struct_literal_call_arg.carbon
  119. library "[[@TEST_NAME]]";
  120. import Cpp library "struct_literal_call_arg.h";
  121. fn F() {
  122. // CHECK:STDERR: fail_todo_import_struct_literal_call_arg.carbon:[[@LINE+7]]:11: error: call argument of type `{}` is not supported [CppCallArgTypeNotSupported]
  123. // CHECK:STDERR: Cpp.foo({});
  124. // CHECK:STDERR: ^~
  125. // CHECK:STDERR: fail_todo_import_struct_literal_call_arg.carbon:[[@LINE+4]]:3: note: in call to Cpp function here [InCallToCppFunction]
  126. // CHECK:STDERR: Cpp.foo({});
  127. // CHECK:STDERR: ^~~~~~~~~~~
  128. // CHECK:STDERR:
  129. Cpp.foo({});
  130. }
  131. // ============================================================================
  132. // Overload rejected on Carbon side
  133. // ============================================================================
  134. // --- upsizing_rejected.h
  135. auto foo(int a) -> void;
  136. // --- fail_import_upsizing_rejected.carbon
  137. library "[[@TEST_NAME]]";
  138. import Cpp library "upsizing_rejected.h";
  139. fn F() {
  140. // CHECK:STDERR: fail_import_upsizing_rejected.carbon:[[@LINE+8]]:11: error: cannot implicitly convert expression of type `i16` to `i32` [ConversionFailure]
  141. // CHECK:STDERR: Cpp.foo(1 as i16);
  142. // CHECK:STDERR: ^~~~~~~~
  143. // CHECK:STDERR: fail_import_upsizing_rejected.carbon:[[@LINE+5]]:11: note: type `i16` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessNote]
  144. // CHECK:STDERR: Cpp.foo(1 as i16);
  145. // CHECK:STDERR: ^~~~~~~~
  146. // CHECK:STDERR: fail_import_upsizing_rejected.carbon: note: initializing function parameter [InCallToFunctionParam]
  147. // CHECK:STDERR:
  148. Cpp.foo(1 as i16);
  149. }
  150. // --- downsizing_rejected.h
  151. auto foo(short a) -> void;
  152. // --- fail_import_downsizing_rejected.carbon
  153. library "[[@TEST_NAME]]";
  154. import Cpp library "downsizing_rejected.h";
  155. fn F() {
  156. // CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE+8]]:11: error: cannot implicitly convert expression of type `i32` to `i16` [ConversionFailure]
  157. // CHECK:STDERR: Cpp.foo(1 as i32);
  158. // CHECK:STDERR: ^~~~~~~~
  159. // CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE+5]]:11: note: type `i32` does not implement interface `Core.ImplicitAs(i16)` [MissingImplInMemberAccessNote]
  160. // CHECK:STDERR: Cpp.foo(1 as i32);
  161. // CHECK:STDERR: ^~~~~~~~
  162. // CHECK:STDERR: fail_import_downsizing_rejected.carbon: note: initializing function parameter [InCallToFunctionParam]
  163. // CHECK:STDERR:
  164. Cpp.foo(1 as i32);
  165. }
  166. // ============================================================================
  167. // Overloads access
  168. // ============================================================================
  169. // --- same_access_level.h
  170. struct S {
  171. public:
  172. static auto foo(short a) -> void;
  173. static auto foo(int a) -> void;
  174. };
  175. // --- import_same_access_level.carbon
  176. library "[[@TEST_NAME]]";
  177. import Cpp library "same_access_level.h";
  178. fn F() {
  179. Cpp.S.foo(1 as i32);
  180. }
  181. // --- mixed_access_level.h
  182. struct S {
  183. public:
  184. static auto foo(int a) -> void;
  185. protected:
  186. static auto foo(short a) -> void;
  187. };
  188. // --- fail_todo_import_mixed_access_level.carbon
  189. library "[[@TEST_NAME]]";
  190. import Cpp library "mixed_access_level.h";
  191. fn F() {
  192. // CHECK:STDERR: fail_todo_import_mixed_access_level.carbon:[[@LINE+7]]:3: error: semantics TODO: `Unsupported: Overloaded set with mixed access` [SemanticsTodo]
  193. // CHECK:STDERR: Cpp.S.foo(1 as i32);
  194. // CHECK:STDERR: ^~~~~~~~~
  195. // CHECK:STDERR: fail_todo_import_mixed_access_level.carbon:[[@LINE+4]]:3: note: in `Cpp` name lookup for `foo` [InCppNameLookup]
  196. // CHECK:STDERR: Cpp.S.foo(1 as i32);
  197. // CHECK:STDERR: ^~~~~~~~~
  198. // CHECK:STDERR:
  199. Cpp.S.foo(1 as i32);
  200. }
  201. // ============================================================================
  202. // No viable function found
  203. // ============================================================================
  204. // --- no_viable_function.h
  205. auto foo(short a, int b) -> void;
  206. // --- fail_import_no_viable_function.carbon
  207. library "[[@TEST_NAME]]";
  208. import Cpp library "no_viable_function.h";
  209. fn F() {
  210. // CHECK:STDERR: fail_import_no_viable_function.carbon:[[@LINE+7]]:3: error: no matching function for call to `foo` [CppOverloadingNoViableFunctionFound]
  211. // CHECK:STDERR: Cpp.foo(1 as i64);
  212. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~
  213. // CHECK:STDERR: fail_import_no_viable_function.carbon:[[@LINE+4]]:3: note: in call to Cpp function here [InCallToCppFunction]
  214. // CHECK:STDERR: Cpp.foo(1 as i64);
  215. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~
  216. // CHECK:STDERR:
  217. Cpp.foo(1 as i64);
  218. }
  219. // ============================================================================
  220. // Ambiguous overload found
  221. // ============================================================================
  222. // --- ambiguous_overload.h
  223. auto foo(short a) -> void;
  224. auto foo(int a) -> void;
  225. // --- fail_import_ambiguous_overload.carbon
  226. library "[[@TEST_NAME]]";
  227. import Cpp library "ambiguous_overload.h";
  228. fn F() {
  229. // CHECK:STDERR: fail_import_ambiguous_overload.carbon:[[@LINE+7]]:3: error: call to `foo` is ambiguous [CppOverloadingAmbiguousCandidatesFound]
  230. // CHECK:STDERR: Cpp.foo(1 as i64);
  231. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~
  232. // CHECK:STDERR: fail_import_ambiguous_overload.carbon:[[@LINE+4]]:3: note: in call to Cpp function here [InCallToCppFunction]
  233. // CHECK:STDERR: Cpp.foo(1 as i64);
  234. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~
  235. // CHECK:STDERR:
  236. Cpp.foo(1 as i64);
  237. }
  238. // ============================================================================
  239. // Deleted function found
  240. // ============================================================================
  241. // --- deleted_function.h
  242. auto foo(short a) -> void;
  243. auto foo(int a) -> void = delete;
  244. // --- fail_import_deleted_function.carbon
  245. library "[[@TEST_NAME]]";
  246. import Cpp library "deleted_function.h";
  247. fn F() {
  248. // CHECK:STDERR: fail_import_deleted_function.carbon:[[@LINE+7]]:3: error: call to deleted function `foo` [CppOverloadingDeletedFunctionFound]
  249. // CHECK:STDERR: Cpp.foo(1 as i32);
  250. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~
  251. // CHECK:STDERR: fail_import_deleted_function.carbon:[[@LINE+4]]:3: note: in call to Cpp function here [InCallToCppFunction]
  252. // CHECK:STDERR: Cpp.foo(1 as i32);
  253. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~
  254. // CHECK:STDERR:
  255. Cpp.foo(1 as i32);
  256. }
  257. // CHECK:STDOUT: --- import_multiple_functions_no_overloads.carbon
  258. // CHECK:STDOUT:
  259. // CHECK:STDOUT: constants {
  260. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  261. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  262. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  263. // CHECK:STDOUT: %.414: type = cpp_overload_set_type @As.Convert [concrete]
  264. // CHECK:STDOUT: %empty_struct: %.414 = struct_value () [concrete]
  265. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  266. // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete]
  267. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  268. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  269. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  270. // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete]
  271. // CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete]
  272. // CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete]
  273. // CHECK:STDOUT: %As.type.771: type = facet_type <@As, @As(%i16)> [concrete]
  274. // CHECK:STDOUT: %As.Convert.type.be5: type = fn_type @As.Convert, @As(%i16) [concrete]
  275. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  276. // 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]
  277. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.d2c: %Core.IntLiteral.as.As.impl.Convert.type.565 = struct_value () [symbolic]
  278. // CHECK:STDOUT: %As.impl_witness.2d2: <witness> = impl_witness imports.%As.impl_witness_table.5ad, @Core.IntLiteral.as.As.impl(%int_16) [concrete]
  279. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.38a: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_16) [concrete]
  280. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.97a: %Core.IntLiteral.as.As.impl.Convert.type.38a = struct_value () [concrete]
  281. // CHECK:STDOUT: %As.facet: %As.type.771 = facet_value Core.IntLiteral, (%As.impl_witness.2d2) [concrete]
  282. // CHECK:STDOUT: %.026: type = fn_type_with_self_type %As.Convert.type.be5, %As.facet [concrete]
  283. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.97a [concrete]
  284. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.97a, @Core.IntLiteral.as.As.impl.Convert(%int_16) [concrete]
  285. // CHECK:STDOUT: %bound_method.7be: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
  286. // CHECK:STDOUT: %int_1.f90: %i16 = int_value 1 [concrete]
  287. // CHECK:STDOUT: %ptr.251: type = ptr_type %i16 [concrete]
  288. // CHECK:STDOUT: %pattern_type.54c: type = pattern_type %ptr.251 [concrete]
  289. // CHECK:STDOUT: %bar__carbon_thunk.type: type = fn_type @bar__carbon_thunk [concrete]
  290. // CHECK:STDOUT: %bar__carbon_thunk: %bar__carbon_thunk.type = struct_value () [concrete]
  291. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  292. // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
  293. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.afd: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic]
  294. // CHECK:STDOUT: %Int.as.Copy.impl.Op.6cd: %Int.as.Copy.impl.Op.type.afd = struct_value () [symbolic]
  295. // CHECK:STDOUT: %Copy.impl_witness.2f8: <witness> = impl_witness imports.%Copy.impl_witness_table.1ed, @Int.as.Copy.impl(%int_16) [concrete]
  296. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.c73: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_16) [concrete]
  297. // CHECK:STDOUT: %Int.as.Copy.impl.Op.3dc: %Int.as.Copy.impl.Op.type.c73 = struct_value () [concrete]
  298. // CHECK:STDOUT: %Copy.facet.4bb: %Copy.type = facet_value %i16, (%Copy.impl_witness.2f8) [concrete]
  299. // CHECK:STDOUT: %.798: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.4bb [concrete]
  300. // CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: <bound method> = bound_method %int_1.f90, %Int.as.Copy.impl.Op.3dc [concrete]
  301. // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.3dc, @Int.as.Copy.impl.Op(%int_16) [concrete]
  302. // CHECK:STDOUT: %bound_method.7c2: <bound method> = bound_method %int_1.f90, %Int.as.Copy.impl.Op.specific_fn [concrete]
  303. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  304. // CHECK:STDOUT: %Int.as.Destroy.impl.Op.type.038: type = fn_type @Int.as.Destroy.impl.Op, @Int.as.Destroy.impl(%int_16) [concrete]
  305. // CHECK:STDOUT: %Int.as.Destroy.impl.Op.431: %Int.as.Destroy.impl.Op.type.038 = struct_value () [concrete]
  306. // CHECK:STDOUT: %Int.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Destroy.impl.Op.431, @Int.as.Destroy.impl.Op(%int_16) [concrete]
  307. // CHECK:STDOUT: }
  308. // CHECK:STDOUT:
  309. // CHECK:STDOUT: imports {
  310. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  311. // CHECK:STDOUT: .Int = %Core.Int
  312. // CHECK:STDOUT: .As = %Core.As
  313. // CHECK:STDOUT: .Copy = %Core.Copy
  314. // CHECK:STDOUT: .Destroy = %Core.Destroy
  315. // CHECK:STDOUT: import Core//prelude
  316. // CHECK:STDOUT: import Core//prelude/...
  317. // CHECK:STDOUT: }
  318. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  319. // CHECK:STDOUT: .bar = %.146
  320. // CHECK:STDOUT: import Cpp//...
  321. // CHECK:STDOUT: }
  322. // CHECK:STDOUT: %.146: %.414 = cpp_overload_set_value @As.Convert [concrete = constants.%empty_struct]
  323. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  324. // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic]
  325. // 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, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.d2c)]
  326. // CHECK:STDOUT: %As.impl_witness_table.5ad = impl_witness_table (%Core.import_ref.99c), @Core.IntLiteral.as.As.impl [concrete]
  327. // CHECK:STDOUT: %bar__carbon_thunk.decl: %bar__carbon_thunk.type = fn_decl @bar__carbon_thunk [concrete = constants.%bar__carbon_thunk] {
  328. // CHECK:STDOUT: %a.patt: %pattern_type.54c = binding_pattern a [concrete]
  329. // CHECK:STDOUT: %a.param_patt: %pattern_type.54c = value_param_pattern %a.patt, call_param0 [concrete]
  330. // CHECK:STDOUT: } {
  331. // CHECK:STDOUT: %a.param: %ptr.251 = value_param call_param0
  332. // CHECK:STDOUT: %.1: type = splice_block constants.%ptr.251 [concrete = constants.%ptr.251] {
  333. // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16]
  334. // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16]
  335. // CHECK:STDOUT: }
  336. // CHECK:STDOUT: %a: %ptr.251 = bind_name a, %a.param
  337. // CHECK:STDOUT: }
  338. // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
  339. // CHECK:STDOUT: %Core.import_ref.d0f6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.afd) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6cd)]
  340. // CHECK:STDOUT: %Copy.impl_witness_table.1ed = impl_witness_table (%Core.import_ref.d0f6), @Int.as.Copy.impl [concrete]
  341. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  342. // CHECK:STDOUT: }
  343. // CHECK:STDOUT:
  344. // CHECK:STDOUT: file {
  345. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  346. // CHECK:STDOUT: .Core = imports.%Core
  347. // CHECK:STDOUT: .Cpp = imports.%Cpp
  348. // CHECK:STDOUT: .F = %F.decl
  349. // CHECK:STDOUT: }
  350. // CHECK:STDOUT: %Core.import = import Core
  351. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  352. // CHECK:STDOUT: import Cpp "multiple_functions_no_overloads.h"
  353. // CHECK:STDOUT: }
  354. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  355. // CHECK:STDOUT: }
  356. // CHECK:STDOUT:
  357. // CHECK:STDOUT: fn @F() {
  358. // CHECK:STDOUT: !entry:
  359. // CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  360. // CHECK:STDOUT: %bar.ref: %.414 = name_ref bar, imports.%.146 [concrete = constants.%empty_struct]
  361. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  362. // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16]
  363. // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16]
  364. // CHECK:STDOUT: %impl.elem0.loc7_13.1: %.026 = impl_witness_access constants.%As.impl_witness.2d2, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.97a]
  365. // CHECK:STDOUT: %bound_method.loc7_13.1: <bound method> = bound_method %int_1, %impl.elem0.loc7_13.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
  366. // CHECK:STDOUT: %specific_fn.loc7_13.1: <specific function> = specific_function %impl.elem0.loc7_13.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
  367. // CHECK:STDOUT: %bound_method.loc7_13.2: <bound method> = bound_method %int_1, %specific_fn.loc7_13.1 [concrete = constants.%bound_method.7be]
  368. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i16 = call %bound_method.loc7_13.2(%int_1) [concrete = constants.%int_1.f90]
  369. // CHECK:STDOUT: %.loc7_13.1: %i16 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.f90]
  370. // CHECK:STDOUT: %.loc7_13.2: %i16 = converted %int_1, %.loc7_13.1 [concrete = constants.%int_1.f90]
  371. // CHECK:STDOUT: %.loc7_13.3: ref %i16 = temporary_storage
  372. // CHECK:STDOUT: %impl.elem0.loc7_13.2: %.798 = impl_witness_access constants.%Copy.impl_witness.2f8, element0 [concrete = constants.%Int.as.Copy.impl.Op.3dc]
  373. // CHECK:STDOUT: %bound_method.loc7_13.3: <bound method> = bound_method %.loc7_13.2, %impl.elem0.loc7_13.2 [concrete = constants.%Int.as.Copy.impl.Op.bound]
  374. // CHECK:STDOUT: %specific_fn.loc7_13.2: <specific function> = specific_function %impl.elem0.loc7_13.2, @Int.as.Copy.impl.Op(constants.%int_16) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
  375. // CHECK:STDOUT: %bound_method.loc7_13.4: <bound method> = bound_method %.loc7_13.2, %specific_fn.loc7_13.2 [concrete = constants.%bound_method.7c2]
  376. // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i16 = call %bound_method.loc7_13.4(%.loc7_13.2) [concrete = constants.%int_1.f90]
  377. // CHECK:STDOUT: %.loc7_13.4: ref %i16 = temporary %.loc7_13.3, %Int.as.Copy.impl.Op.call
  378. // CHECK:STDOUT: %addr.loc7_19: %ptr.251 = addr_of %.loc7_13.4
  379. // CHECK:STDOUT: %bar__carbon_thunk.call: init %empty_tuple.type = call imports.%bar__carbon_thunk.decl(%addr.loc7_19)
  380. // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc7_13.4, constants.%Int.as.Destroy.impl.Op.431
  381. // CHECK:STDOUT: %Int.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%Int.as.Destroy.impl.Op.431, @Int.as.Destroy.impl.Op(constants.%int_16) [concrete = constants.%Int.as.Destroy.impl.Op.specific_fn]
  382. // CHECK:STDOUT: %bound_method.loc7_13.5: <bound method> = bound_method %.loc7_13.4, %Int.as.Destroy.impl.Op.specific_fn
  383. // CHECK:STDOUT: %addr.loc7_13: %ptr.251 = addr_of %.loc7_13.4
  384. // CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc7_13.5(%addr.loc7_13)
  385. // CHECK:STDOUT: return
  386. // CHECK:STDOUT: }
  387. // CHECK:STDOUT:
  388. // CHECK:STDOUT: fn @bar(%a.param: %i16);
  389. // CHECK:STDOUT:
  390. // CHECK:STDOUT: fn @bar__carbon_thunk(%a.param: %ptr.251);
  391. // CHECK:STDOUT:
  392. // CHECK:STDOUT: --- import_overloaded_functions.carbon
  393. // CHECK:STDOUT:
  394. // CHECK:STDOUT: constants {
  395. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  396. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  397. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  398. // CHECK:STDOUT: %.c5d: type = cpp_overload_set_type @As.Convert [concrete]
  399. // CHECK:STDOUT: %empty_struct: %.c5d = struct_value () [concrete]
  400. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  401. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  402. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  403. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  404. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  405. // CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete]
  406. // CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete]
  407. // CHECK:STDOUT: %As.type.dbd: type = facet_type <@As, @As(%i32)> [concrete]
  408. // CHECK:STDOUT: %As.Convert.type.99b: type = fn_type @As.Convert, @As(%i32) [concrete]
  409. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  410. // 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]
  411. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.d2c: %Core.IntLiteral.as.As.impl.Convert.type.565 = struct_value () [symbolic]
  412. // CHECK:STDOUT: %As.impl_witness.080: <witness> = impl_witness imports.%As.impl_witness_table.5ad, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  413. // 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]
  414. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.414: %Core.IntLiteral.as.As.impl.Convert.type.aaf = struct_value () [concrete]
  415. // CHECK:STDOUT: %As.facet: %As.type.dbd = facet_value Core.IntLiteral, (%As.impl_witness.080) [concrete]
  416. // CHECK:STDOUT: %.351: type = fn_type_with_self_type %As.Convert.type.99b, %As.facet [concrete]
  417. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.414 [concrete]
  418. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  419. // 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]
  420. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
  421. // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
  422. // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
  423. // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
  424. // CHECK:STDOUT: }
  425. // CHECK:STDOUT:
  426. // CHECK:STDOUT: imports {
  427. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  428. // CHECK:STDOUT: .Int = %Core.Int
  429. // CHECK:STDOUT: .As = %Core.As
  430. // CHECK:STDOUT: import Core//prelude
  431. // CHECK:STDOUT: import Core//prelude/...
  432. // CHECK:STDOUT: }
  433. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  434. // CHECK:STDOUT: .foo = %.a21
  435. // CHECK:STDOUT: import Cpp//...
  436. // CHECK:STDOUT: }
  437. // CHECK:STDOUT: %.a21: %.c5d = cpp_overload_set_value @As.Convert [concrete = constants.%empty_struct]
  438. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  439. // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic]
  440. // 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, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.d2c)]
  441. // CHECK:STDOUT: %As.impl_witness_table.5ad = impl_witness_table (%Core.import_ref.99c), @Core.IntLiteral.as.As.impl [concrete]
  442. // CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
  443. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete]
  444. // CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete]
  445. // CHECK:STDOUT: } {
  446. // CHECK:STDOUT: %a.param: %i32 = value_param call_param0
  447. // CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] {
  448. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  449. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  450. // CHECK:STDOUT: }
  451. // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
  452. // CHECK:STDOUT: }
  453. // CHECK:STDOUT: }
  454. // CHECK:STDOUT:
  455. // CHECK:STDOUT: file {
  456. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  457. // CHECK:STDOUT: .Core = imports.%Core
  458. // CHECK:STDOUT: .Cpp = imports.%Cpp
  459. // CHECK:STDOUT: .F = %F.decl
  460. // CHECK:STDOUT: }
  461. // CHECK:STDOUT: %Core.import = import Core
  462. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  463. // CHECK:STDOUT: import Cpp "overloaded_functions.h"
  464. // CHECK:STDOUT: }
  465. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  466. // CHECK:STDOUT: }
  467. // CHECK:STDOUT:
  468. // CHECK:STDOUT: fn @F() {
  469. // CHECK:STDOUT: !entry:
  470. // CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  471. // CHECK:STDOUT: %foo.ref: %.c5d = name_ref foo, imports.%.a21 [concrete = constants.%empty_struct]
  472. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  473. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  474. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  475. // CHECK:STDOUT: %impl.elem0: %.351 = impl_witness_access constants.%As.impl_witness.080, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.414]
  476. // CHECK:STDOUT: %bound_method.loc7_13.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
  477. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
  478. // CHECK:STDOUT: %bound_method.loc7_13.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
  479. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc7_13.2(%int_1) [concrete = constants.%int_1.5d2]
  480. // CHECK:STDOUT: %.loc7_13.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.5d2]
  481. // CHECK:STDOUT: %.loc7_13.2: %i32 = converted %int_1, %.loc7_13.1 [concrete = constants.%int_1.5d2]
  482. // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc7_13.2)
  483. // CHECK:STDOUT: return
  484. // CHECK:STDOUT: }
  485. // CHECK:STDOUT:
  486. // CHECK:STDOUT: fn @foo(%a.param: %i32);
  487. // CHECK:STDOUT:
  488. // CHECK:STDOUT: --- import_both_overloaded_functions_called.carbon
  489. // CHECK:STDOUT:
  490. // CHECK:STDOUT: constants {
  491. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  492. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  493. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  494. // CHECK:STDOUT: %.c5d: type = cpp_overload_set_type @As.Convert [concrete]
  495. // CHECK:STDOUT: %empty_struct: %.c5d = struct_value () [concrete]
  496. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  497. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  498. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  499. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  500. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  501. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  502. // CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete]
  503. // CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete]
  504. // CHECK:STDOUT: %As.type.dbd: type = facet_type <@As, @As(%i32)> [concrete]
  505. // CHECK:STDOUT: %As.Convert.type.99b: type = fn_type @As.Convert, @As(%i32) [concrete]
  506. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  507. // 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]
  508. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.d2c: %Core.IntLiteral.as.As.impl.Convert.type.565 = struct_value () [symbolic]
  509. // CHECK:STDOUT: %As.impl_witness.080: <witness> = impl_witness imports.%As.impl_witness_table.5ad, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  510. // 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]
  511. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.414: %Core.IntLiteral.as.As.impl.Convert.type.aaf = struct_value () [concrete]
  512. // CHECK:STDOUT: %As.facet.b49: %As.type.dbd = facet_value Core.IntLiteral, (%As.impl_witness.080) [concrete]
  513. // CHECK:STDOUT: %.351: type = fn_type_with_self_type %As.Convert.type.99b, %As.facet.b49 [concrete]
  514. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.9f3: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.414 [concrete]
  515. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  516. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn.478: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.414, @Core.IntLiteral.as.As.impl.Convert(%int_32) [concrete]
  517. // CHECK:STDOUT: %bound_method.fb8: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn.478 [concrete]
  518. // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
  519. // CHECK:STDOUT: %foo.type.a5abd1.1: type = fn_type @foo.1 [concrete]
  520. // CHECK:STDOUT: %foo.23ea43.1: %foo.type.a5abd1.1 = struct_value () [concrete]
  521. // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete]
  522. // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete]
  523. // CHECK:STDOUT: %As.type.771: type = facet_type <@As, @As(%i16)> [concrete]
  524. // CHECK:STDOUT: %As.Convert.type.be5: type = fn_type @As.Convert, @As(%i16) [concrete]
  525. // CHECK:STDOUT: %As.impl_witness.2d2: <witness> = impl_witness imports.%As.impl_witness_table.5ad, @Core.IntLiteral.as.As.impl(%int_16) [concrete]
  526. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.38a: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_16) [concrete]
  527. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.97a: %Core.IntLiteral.as.As.impl.Convert.type.38a = struct_value () [concrete]
  528. // CHECK:STDOUT: %As.facet.56b: %As.type.771 = facet_value Core.IntLiteral, (%As.impl_witness.2d2) [concrete]
  529. // CHECK:STDOUT: %.026: type = fn_type_with_self_type %As.Convert.type.be5, %As.facet.56b [concrete]
  530. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.3fb: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.97a [concrete]
  531. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn.613: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.97a, @Core.IntLiteral.as.As.impl.Convert(%int_16) [concrete]
  532. // CHECK:STDOUT: %bound_method.7be: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn.613 [concrete]
  533. // CHECK:STDOUT: %int_1.f90: %i16 = int_value 1 [concrete]
  534. // CHECK:STDOUT: %ptr.251: type = ptr_type %i16 [concrete]
  535. // CHECK:STDOUT: %pattern_type.54c: type = pattern_type %ptr.251 [concrete]
  536. // CHECK:STDOUT: %foo__carbon_thunk.type: type = fn_type @foo__carbon_thunk [concrete]
  537. // CHECK:STDOUT: %foo__carbon_thunk: %foo__carbon_thunk.type = struct_value () [concrete]
  538. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  539. // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
  540. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.afd: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic]
  541. // CHECK:STDOUT: %Int.as.Copy.impl.Op.6cd: %Int.as.Copy.impl.Op.type.afd = struct_value () [symbolic]
  542. // CHECK:STDOUT: %Copy.impl_witness.2f8: <witness> = impl_witness imports.%Copy.impl_witness_table.1ed, @Int.as.Copy.impl(%int_16) [concrete]
  543. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.c73: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_16) [concrete]
  544. // CHECK:STDOUT: %Int.as.Copy.impl.Op.3dc: %Int.as.Copy.impl.Op.type.c73 = struct_value () [concrete]
  545. // CHECK:STDOUT: %Copy.facet.4bb: %Copy.type = facet_value %i16, (%Copy.impl_witness.2f8) [concrete]
  546. // CHECK:STDOUT: %.798: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.4bb [concrete]
  547. // CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: <bound method> = bound_method %int_1.f90, %Int.as.Copy.impl.Op.3dc [concrete]
  548. // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.3dc, @Int.as.Copy.impl.Op(%int_16) [concrete]
  549. // CHECK:STDOUT: %bound_method.7c2: <bound method> = bound_method %int_1.f90, %Int.as.Copy.impl.Op.specific_fn [concrete]
  550. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  551. // CHECK:STDOUT: %Int.as.Destroy.impl.Op.type.038: type = fn_type @Int.as.Destroy.impl.Op, @Int.as.Destroy.impl(%int_16) [concrete]
  552. // CHECK:STDOUT: %Int.as.Destroy.impl.Op.431: %Int.as.Destroy.impl.Op.type.038 = struct_value () [concrete]
  553. // CHECK:STDOUT: %Int.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Destroy.impl.Op.431, @Int.as.Destroy.impl.Op(%int_16) [concrete]
  554. // CHECK:STDOUT: }
  555. // CHECK:STDOUT:
  556. // CHECK:STDOUT: imports {
  557. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  558. // CHECK:STDOUT: .Int = %Core.Int
  559. // CHECK:STDOUT: .As = %Core.As
  560. // CHECK:STDOUT: .Copy = %Core.Copy
  561. // CHECK:STDOUT: .Destroy = %Core.Destroy
  562. // CHECK:STDOUT: import Core//prelude
  563. // CHECK:STDOUT: import Core//prelude/...
  564. // CHECK:STDOUT: }
  565. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  566. // CHECK:STDOUT: .foo = %.a21
  567. // CHECK:STDOUT: import Cpp//...
  568. // CHECK:STDOUT: }
  569. // CHECK:STDOUT: %.a21: %.c5d = cpp_overload_set_value @As.Convert [concrete = constants.%empty_struct]
  570. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  571. // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic]
  572. // 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, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.d2c)]
  573. // CHECK:STDOUT: %As.impl_witness_table.5ad = impl_witness_table (%Core.import_ref.99c), @Core.IntLiteral.as.As.impl [concrete]
  574. // CHECK:STDOUT: %foo.decl.bd967b.1: %foo.type.a5abd1.1 = fn_decl @foo.1 [concrete = constants.%foo.23ea43.1] {
  575. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete]
  576. // CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete]
  577. // CHECK:STDOUT: } {
  578. // CHECK:STDOUT: %a.param: %i32 = value_param call_param0
  579. // CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] {
  580. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  581. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  582. // CHECK:STDOUT: }
  583. // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
  584. // CHECK:STDOUT: }
  585. // CHECK:STDOUT: %foo__carbon_thunk.decl: %foo__carbon_thunk.type = fn_decl @foo__carbon_thunk [concrete = constants.%foo__carbon_thunk] {
  586. // CHECK:STDOUT: %a.patt: %pattern_type.54c = binding_pattern a [concrete]
  587. // CHECK:STDOUT: %a.param_patt: %pattern_type.54c = value_param_pattern %a.patt, call_param0 [concrete]
  588. // CHECK:STDOUT: } {
  589. // CHECK:STDOUT: %a.param: %ptr.251 = value_param call_param0
  590. // CHECK:STDOUT: %.1: type = splice_block constants.%ptr.251 [concrete = constants.%ptr.251] {
  591. // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16]
  592. // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16]
  593. // CHECK:STDOUT: }
  594. // CHECK:STDOUT: %a: %ptr.251 = bind_name a, %a.param
  595. // CHECK:STDOUT: }
  596. // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
  597. // CHECK:STDOUT: %Core.import_ref.d0f6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.afd) = import_ref Core//prelude/parts/int, loc17_31, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6cd)]
  598. // CHECK:STDOUT: %Copy.impl_witness_table.1ed = impl_witness_table (%Core.import_ref.d0f6), @Int.as.Copy.impl [concrete]
  599. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  600. // CHECK:STDOUT: }
  601. // CHECK:STDOUT:
  602. // CHECK:STDOUT: file {
  603. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  604. // CHECK:STDOUT: .Core = imports.%Core
  605. // CHECK:STDOUT: .Cpp = imports.%Cpp
  606. // CHECK:STDOUT: .F = %F.decl
  607. // CHECK:STDOUT: }
  608. // CHECK:STDOUT: %Core.import = import Core
  609. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  610. // CHECK:STDOUT: import Cpp "both_overloaded_functions_called.h"
  611. // CHECK:STDOUT: }
  612. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  613. // CHECK:STDOUT: }
  614. // CHECK:STDOUT:
  615. // CHECK:STDOUT: fn @F() {
  616. // CHECK:STDOUT: !entry:
  617. // CHECK:STDOUT: %Cpp.ref.loc7: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  618. // CHECK:STDOUT: %foo.ref.loc7: %.c5d = name_ref foo, imports.%.a21 [concrete = constants.%empty_struct]
  619. // CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  620. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  621. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  622. // CHECK:STDOUT: %impl.elem0.loc7: %.351 = impl_witness_access constants.%As.impl_witness.080, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.414]
  623. // CHECK:STDOUT: %bound_method.loc7_13.1: <bound method> = bound_method %int_1.loc7, %impl.elem0.loc7 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.9f3]
  624. // CHECK:STDOUT: %specific_fn.loc7: <specific function> = specific_function %impl.elem0.loc7, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn.478]
  625. // CHECK:STDOUT: %bound_method.loc7_13.2: <bound method> = bound_method %int_1.loc7, %specific_fn.loc7 [concrete = constants.%bound_method.fb8]
  626. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc7: init %i32 = call %bound_method.loc7_13.2(%int_1.loc7) [concrete = constants.%int_1.5d2]
  627. // CHECK:STDOUT: %.loc7_13.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc7 [concrete = constants.%int_1.5d2]
  628. // CHECK:STDOUT: %.loc7_13.2: %i32 = converted %int_1.loc7, %.loc7_13.1 [concrete = constants.%int_1.5d2]
  629. // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl.bd967b.1(%.loc7_13.2)
  630. // CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  631. // CHECK:STDOUT: %foo.ref.loc8: %.c5d = name_ref foo, imports.%.a21 [concrete = constants.%empty_struct]
  632. // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  633. // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16]
  634. // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16]
  635. // CHECK:STDOUT: %impl.elem0.loc8_13.1: %.026 = impl_witness_access constants.%As.impl_witness.2d2, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.97a]
  636. // CHECK:STDOUT: %bound_method.loc8_13.1: <bound method> = bound_method %int_1.loc8, %impl.elem0.loc8_13.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.3fb]
  637. // CHECK:STDOUT: %specific_fn.loc8_13.1: <specific function> = specific_function %impl.elem0.loc8_13.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn.613]
  638. // CHECK:STDOUT: %bound_method.loc8_13.2: <bound method> = bound_method %int_1.loc8, %specific_fn.loc8_13.1 [concrete = constants.%bound_method.7be]
  639. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc8: init %i16 = call %bound_method.loc8_13.2(%int_1.loc8) [concrete = constants.%int_1.f90]
  640. // CHECK:STDOUT: %.loc8_13.1: %i16 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc8 [concrete = constants.%int_1.f90]
  641. // CHECK:STDOUT: %.loc8_13.2: %i16 = converted %int_1.loc8, %.loc8_13.1 [concrete = constants.%int_1.f90]
  642. // CHECK:STDOUT: %.loc8_13.3: ref %i16 = temporary_storage
  643. // CHECK:STDOUT: %impl.elem0.loc8_13.2: %.798 = impl_witness_access constants.%Copy.impl_witness.2f8, element0 [concrete = constants.%Int.as.Copy.impl.Op.3dc]
  644. // CHECK:STDOUT: %bound_method.loc8_13.3: <bound method> = bound_method %.loc8_13.2, %impl.elem0.loc8_13.2 [concrete = constants.%Int.as.Copy.impl.Op.bound]
  645. // CHECK:STDOUT: %specific_fn.loc8_13.2: <specific function> = specific_function %impl.elem0.loc8_13.2, @Int.as.Copy.impl.Op(constants.%int_16) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
  646. // CHECK:STDOUT: %bound_method.loc8_13.4: <bound method> = bound_method %.loc8_13.2, %specific_fn.loc8_13.2 [concrete = constants.%bound_method.7c2]
  647. // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i16 = call %bound_method.loc8_13.4(%.loc8_13.2) [concrete = constants.%int_1.f90]
  648. // CHECK:STDOUT: %.loc8_13.4: ref %i16 = temporary %.loc8_13.3, %Int.as.Copy.impl.Op.call
  649. // CHECK:STDOUT: %addr.loc8_19: %ptr.251 = addr_of %.loc8_13.4
  650. // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc8_19)
  651. // CHECK:STDOUT: %Int.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc8_13.4, constants.%Int.as.Destroy.impl.Op.431
  652. // CHECK:STDOUT: %Int.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%Int.as.Destroy.impl.Op.431, @Int.as.Destroy.impl.Op(constants.%int_16) [concrete = constants.%Int.as.Destroy.impl.Op.specific_fn]
  653. // CHECK:STDOUT: %bound_method.loc8_13.5: <bound method> = bound_method %.loc8_13.4, %Int.as.Destroy.impl.Op.specific_fn
  654. // CHECK:STDOUT: %addr.loc8_13: %ptr.251 = addr_of %.loc8_13.4
  655. // CHECK:STDOUT: %Int.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method.loc8_13.5(%addr.loc8_13)
  656. // CHECK:STDOUT: return
  657. // CHECK:STDOUT: }
  658. // CHECK:STDOUT:
  659. // CHECK:STDOUT: fn @foo.1(%a.param: %i32);
  660. // CHECK:STDOUT:
  661. // CHECK:STDOUT: fn @foo.2(%a.param: %i16);
  662. // CHECK:STDOUT:
  663. // CHECK:STDOUT: fn @foo__carbon_thunk(%a.param: %ptr.251);
  664. // CHECK:STDOUT:
  665. // CHECK:STDOUT: --- import_multiple_overloaded_sets.carbon
  666. // CHECK:STDOUT:
  667. // CHECK:STDOUT: constants {
  668. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  669. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  670. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  671. // CHECK:STDOUT: %.c5d: type = cpp_overload_set_type @Core.IntLiteral.as.As.impl.Convert [concrete]
  672. // CHECK:STDOUT: %empty_struct.109: %.c5d = struct_value () [concrete]
  673. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  674. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  675. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  676. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  677. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  678. // CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete]
  679. // CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete]
  680. // CHECK:STDOUT: %As.type.dbd: type = facet_type <@As, @As(%i32)> [concrete]
  681. // CHECK:STDOUT: %As.Convert.type.99b: type = fn_type @As.Convert, @As(%i32) [concrete]
  682. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  683. // 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]
  684. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.d2c: %Core.IntLiteral.as.As.impl.Convert.type.565 = struct_value () [symbolic]
  685. // CHECK:STDOUT: %As.impl_witness.080: <witness> = impl_witness imports.%As.impl_witness_table.5ad, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  686. // 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]
  687. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.414: %Core.IntLiteral.as.As.impl.Convert.type.aaf = struct_value () [concrete]
  688. // CHECK:STDOUT: %As.facet: %As.type.dbd = facet_value Core.IntLiteral, (%As.impl_witness.080) [concrete]
  689. // CHECK:STDOUT: %.351: type = fn_type_with_self_type %As.Convert.type.99b, %As.facet [concrete]
  690. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.414 [concrete]
  691. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  692. // 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]
  693. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
  694. // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
  695. // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
  696. // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
  697. // CHECK:STDOUT: %.414: type = cpp_overload_set_type @Int.as.As.impl.Convert [concrete]
  698. // CHECK:STDOUT: %empty_struct.540: %.414 = struct_value () [concrete]
  699. // CHECK:STDOUT: %bar.type: type = fn_type @bar [concrete]
  700. // CHECK:STDOUT: %bar: %bar.type = struct_value () [concrete]
  701. // CHECK:STDOUT: }
  702. // CHECK:STDOUT:
  703. // CHECK:STDOUT: imports {
  704. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  705. // CHECK:STDOUT: .Int = %Core.Int
  706. // CHECK:STDOUT: .As = %Core.As
  707. // CHECK:STDOUT: import Core//prelude
  708. // CHECK:STDOUT: import Core//prelude/...
  709. // CHECK:STDOUT: }
  710. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  711. // CHECK:STDOUT: .foo = %.a21
  712. // CHECK:STDOUT: .bar = %.146
  713. // CHECK:STDOUT: import Cpp//...
  714. // CHECK:STDOUT: }
  715. // CHECK:STDOUT: %.a21: %.c5d = cpp_overload_set_value @Core.IntLiteral.as.As.impl.Convert [concrete = constants.%empty_struct.109]
  716. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  717. // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic]
  718. // 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, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.d2c)]
  719. // CHECK:STDOUT: %As.impl_witness_table.5ad = impl_witness_table (%Core.import_ref.99c), @Core.IntLiteral.as.As.impl [concrete]
  720. // CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
  721. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete]
  722. // CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete]
  723. // CHECK:STDOUT: } {
  724. // CHECK:STDOUT: %a.param: %i32 = value_param call_param0
  725. // CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] {
  726. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  727. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  728. // CHECK:STDOUT: }
  729. // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
  730. // CHECK:STDOUT: }
  731. // CHECK:STDOUT: %.146: %.414 = cpp_overload_set_value @Int.as.As.impl.Convert [concrete = constants.%empty_struct.540]
  732. // CHECK:STDOUT: %bar.decl: %bar.type = fn_decl @bar [concrete = constants.%bar] {
  733. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete]
  734. // CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete]
  735. // CHECK:STDOUT: } {
  736. // CHECK:STDOUT: %a.param: %i32 = value_param call_param0
  737. // CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] {
  738. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  739. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  740. // CHECK:STDOUT: }
  741. // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
  742. // CHECK:STDOUT: }
  743. // CHECK:STDOUT: }
  744. // CHECK:STDOUT:
  745. // CHECK:STDOUT: file {
  746. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  747. // CHECK:STDOUT: .Core = imports.%Core
  748. // CHECK:STDOUT: .Cpp = imports.%Cpp
  749. // CHECK:STDOUT: .F = %F.decl
  750. // CHECK:STDOUT: }
  751. // CHECK:STDOUT: %Core.import = import Core
  752. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  753. // CHECK:STDOUT: import Cpp "multiple_overloaded_sets.h"
  754. // CHECK:STDOUT: }
  755. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  756. // CHECK:STDOUT: }
  757. // CHECK:STDOUT:
  758. // CHECK:STDOUT: fn @F() {
  759. // CHECK:STDOUT: !entry:
  760. // CHECK:STDOUT: %Cpp.ref.loc7: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  761. // CHECK:STDOUT: %foo.ref: %.c5d = name_ref foo, imports.%.a21 [concrete = constants.%empty_struct.109]
  762. // CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  763. // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  764. // CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  765. // CHECK:STDOUT: %impl.elem0.loc7: %.351 = impl_witness_access constants.%As.impl_witness.080, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.414]
  766. // CHECK:STDOUT: %bound_method.loc7_13.1: <bound method> = bound_method %int_1.loc7, %impl.elem0.loc7 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
  767. // CHECK:STDOUT: %specific_fn.loc7: <specific function> = specific_function %impl.elem0.loc7, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
  768. // CHECK:STDOUT: %bound_method.loc7_13.2: <bound method> = bound_method %int_1.loc7, %specific_fn.loc7 [concrete = constants.%bound_method]
  769. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc7: init %i32 = call %bound_method.loc7_13.2(%int_1.loc7) [concrete = constants.%int_1.5d2]
  770. // CHECK:STDOUT: %.loc7_13.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc7 [concrete = constants.%int_1.5d2]
  771. // CHECK:STDOUT: %.loc7_13.2: %i32 = converted %int_1.loc7, %.loc7_13.1 [concrete = constants.%int_1.5d2]
  772. // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc7_13.2)
  773. // CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  774. // CHECK:STDOUT: %bar.ref: %.414 = name_ref bar, imports.%.146 [concrete = constants.%empty_struct.540]
  775. // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  776. // CHECK:STDOUT: %int_32.loc8: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  777. // CHECK:STDOUT: %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  778. // CHECK:STDOUT: %impl.elem0.loc8: %.351 = impl_witness_access constants.%As.impl_witness.080, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.414]
  779. // CHECK:STDOUT: %bound_method.loc8_13.1: <bound method> = bound_method %int_1.loc8, %impl.elem0.loc8 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
  780. // CHECK:STDOUT: %specific_fn.loc8: <specific function> = specific_function %impl.elem0.loc8, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
  781. // CHECK:STDOUT: %bound_method.loc8_13.2: <bound method> = bound_method %int_1.loc8, %specific_fn.loc8 [concrete = constants.%bound_method]
  782. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc8: init %i32 = call %bound_method.loc8_13.2(%int_1.loc8) [concrete = constants.%int_1.5d2]
  783. // CHECK:STDOUT: %.loc8_13.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc8 [concrete = constants.%int_1.5d2]
  784. // CHECK:STDOUT: %.loc8_13.2: %i32 = converted %int_1.loc8, %.loc8_13.1 [concrete = constants.%int_1.5d2]
  785. // CHECK:STDOUT: %bar.call: init %empty_tuple.type = call imports.%bar.decl(%.loc8_13.2)
  786. // CHECK:STDOUT: return
  787. // CHECK:STDOUT: }
  788. // CHECK:STDOUT:
  789. // CHECK:STDOUT: fn @foo(%a.param: %i32);
  790. // CHECK:STDOUT:
  791. // CHECK:STDOUT: fn @bar(%a.param: %i32);
  792. // CHECK:STDOUT:
  793. // CHECK:STDOUT: --- import_int_i32_literal.carbon
  794. // CHECK:STDOUT:
  795. // CHECK:STDOUT: constants {
  796. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  797. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  798. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  799. // CHECK:STDOUT: %.c5d: type = cpp_overload_set_type @foo [concrete]
  800. // CHECK:STDOUT: %empty_struct: %.c5d = struct_value () [concrete]
  801. // CHECK:STDOUT: %int_32767.f4b: Core.IntLiteral = int_value 32767 [concrete]
  802. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  803. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  804. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  805. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  806. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  807. // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
  808. // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
  809. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  810. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  811. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  812. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  813. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  814. // 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]
  815. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340 = struct_value () [symbolic]
  816. // CHECK:STDOUT: %ImplicitAs.impl_witness.204: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.9e9, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  817. // 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]
  818. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584 = struct_value () [concrete]
  819. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.204) [concrete]
  820. // CHECK:STDOUT: %.1df: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  821. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_32767.f4b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [concrete]
  822. // 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]
  823. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_32767.f4b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  824. // CHECK:STDOUT: %int_32767.393: %i32 = int_value 32767 [concrete]
  825. // CHECK:STDOUT: }
  826. // CHECK:STDOUT:
  827. // CHECK:STDOUT: imports {
  828. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  829. // CHECK:STDOUT: .Int = %Core.Int
  830. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  831. // CHECK:STDOUT: import Core//prelude
  832. // CHECK:STDOUT: import Core//prelude/...
  833. // CHECK:STDOUT: }
  834. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  835. // CHECK:STDOUT: .foo = %.a21
  836. // CHECK:STDOUT: import Cpp//...
  837. // CHECK:STDOUT: }
  838. // CHECK:STDOUT: %.a21: %.c5d = cpp_overload_set_value @foo [concrete = constants.%empty_struct]
  839. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  840. // CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
  841. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete]
  842. // CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete]
  843. // CHECK:STDOUT: } {
  844. // CHECK:STDOUT: %a.param: %i32 = value_param call_param0
  845. // CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] {
  846. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  847. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  848. // CHECK:STDOUT: }
  849. // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
  850. // CHECK:STDOUT: }
  851. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  852. // 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, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0)]
  853. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.9e9 = impl_witness_table (%Core.import_ref.ee7), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  854. // CHECK:STDOUT: }
  855. // CHECK:STDOUT:
  856. // CHECK:STDOUT: file {
  857. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  858. // CHECK:STDOUT: .Core = imports.%Core
  859. // CHECK:STDOUT: .Cpp = imports.%Cpp
  860. // CHECK:STDOUT: .F = %F.decl
  861. // CHECK:STDOUT: }
  862. // CHECK:STDOUT: %Core.import = import Core
  863. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  864. // CHECK:STDOUT: import Cpp "int_i32_literal.h"
  865. // CHECK:STDOUT: }
  866. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  867. // CHECK:STDOUT: }
  868. // CHECK:STDOUT:
  869. // CHECK:STDOUT: fn @F() {
  870. // CHECK:STDOUT: !entry:
  871. // CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  872. // CHECK:STDOUT: %foo.ref: %.c5d = name_ref foo, imports.%.a21 [concrete = constants.%empty_struct]
  873. // CHECK:STDOUT: %int_32767: Core.IntLiteral = int_value 32767 [concrete = constants.%int_32767.f4b]
  874. // CHECK:STDOUT: %impl.elem0: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  875. // CHECK:STDOUT: %bound_method.loc7_11.1: <bound method> = bound_method %int_32767, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  876. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  877. // CHECK:STDOUT: %bound_method.loc7_11.2: <bound method> = bound_method %int_32767, %specific_fn [concrete = constants.%bound_method]
  878. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc7_11.2(%int_32767) [concrete = constants.%int_32767.393]
  879. // CHECK:STDOUT: %.loc7_11.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_32767.393]
  880. // CHECK:STDOUT: %.loc7_11.2: %i32 = converted %int_32767, %.loc7_11.1 [concrete = constants.%int_32767.393]
  881. // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc7_11.2)
  882. // CHECK:STDOUT: return
  883. // CHECK:STDOUT: }
  884. // CHECK:STDOUT:
  885. // CHECK:STDOUT: fn @foo(%a.param: %i32);
  886. // CHECK:STDOUT:
  887. // CHECK:STDOUT: --- import_int_i64_literal.carbon
  888. // CHECK:STDOUT:
  889. // CHECK:STDOUT: constants {
  890. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  891. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  892. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  893. // CHECK:STDOUT: %.c5d: type = cpp_overload_set_type @foo [concrete]
  894. // CHECK:STDOUT: %empty_struct: %.c5d = struct_value () [concrete]
  895. // CHECK:STDOUT: %int_9223372036854775807.e6f: Core.IntLiteral = int_value 9223372036854775807 [concrete]
  896. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete]
  897. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  898. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  899. // CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [concrete]
  900. // CHECK:STDOUT: %pattern_type.95b: type = pattern_type %i64 [concrete]
  901. // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
  902. // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
  903. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  904. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  905. // CHECK:STDOUT: %ImplicitAs.type.e50: type = facet_type <@ImplicitAs, @ImplicitAs(%i64)> [concrete]
  906. // CHECK:STDOUT: %ImplicitAs.Convert.type.94e: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i64) [concrete]
  907. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  908. // 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]
  909. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340 = struct_value () [symbolic]
  910. // CHECK:STDOUT: %ImplicitAs.impl_witness.830: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.9e9, @Core.IntLiteral.as.ImplicitAs.impl(%int_64) [concrete]
  911. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.685: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_64) [concrete]
  912. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.719: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.685 = struct_value () [concrete]
  913. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e50 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.830) [concrete]
  914. // CHECK:STDOUT: %.35c: type = fn_type_with_self_type %ImplicitAs.Convert.type.94e, %ImplicitAs.facet [concrete]
  915. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_9223372036854775807.e6f, %Core.IntLiteral.as.ImplicitAs.impl.Convert.719 [concrete]
  916. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.719, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_64) [concrete]
  917. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_9223372036854775807.e6f, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  918. // CHECK:STDOUT: %int_9223372036854775807.9c2: %i64 = int_value 9223372036854775807 [concrete]
  919. // CHECK:STDOUT: }
  920. // CHECK:STDOUT:
  921. // CHECK:STDOUT: imports {
  922. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  923. // CHECK:STDOUT: .Int = %Core.Int
  924. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  925. // CHECK:STDOUT: import Core//prelude
  926. // CHECK:STDOUT: import Core//prelude/...
  927. // CHECK:STDOUT: }
  928. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  929. // CHECK:STDOUT: .foo = %.a21
  930. // CHECK:STDOUT: import Cpp//...
  931. // CHECK:STDOUT: }
  932. // CHECK:STDOUT: %.a21: %.c5d = cpp_overload_set_value @foo [concrete = constants.%empty_struct]
  933. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  934. // CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
  935. // CHECK:STDOUT: %a.patt: %pattern_type.95b = binding_pattern a [concrete]
  936. // CHECK:STDOUT: %a.param_patt: %pattern_type.95b = value_param_pattern %a.patt, call_param0 [concrete]
  937. // CHECK:STDOUT: } {
  938. // CHECK:STDOUT: %a.param: %i64 = value_param call_param0
  939. // CHECK:STDOUT: %.1: type = splice_block %i64 [concrete = constants.%i64] {
  940. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
  941. // CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64]
  942. // CHECK:STDOUT: }
  943. // CHECK:STDOUT: %a: %i64 = bind_name a, %a.param
  944. // CHECK:STDOUT: }
  945. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  946. // 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, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0)]
  947. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.9e9 = impl_witness_table (%Core.import_ref.ee7), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  948. // CHECK:STDOUT: }
  949. // CHECK:STDOUT:
  950. // CHECK:STDOUT: file {
  951. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  952. // CHECK:STDOUT: .Core = imports.%Core
  953. // CHECK:STDOUT: .Cpp = imports.%Cpp
  954. // CHECK:STDOUT: .F = %F.decl
  955. // CHECK:STDOUT: }
  956. // CHECK:STDOUT: %Core.import = import Core
  957. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  958. // CHECK:STDOUT: import Cpp "int_i64_literal.h"
  959. // CHECK:STDOUT: }
  960. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  961. // CHECK:STDOUT: }
  962. // CHECK:STDOUT:
  963. // CHECK:STDOUT: fn @F() {
  964. // CHECK:STDOUT: !entry:
  965. // CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  966. // CHECK:STDOUT: %foo.ref: %.c5d = name_ref foo, imports.%.a21 [concrete = constants.%empty_struct]
  967. // CHECK:STDOUT: %int_9223372036854775807: Core.IntLiteral = int_value 9223372036854775807 [concrete = constants.%int_9223372036854775807.e6f]
  968. // CHECK:STDOUT: %impl.elem0: %.35c = impl_witness_access constants.%ImplicitAs.impl_witness.830, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.719]
  969. // CHECK:STDOUT: %bound_method.loc7_11.1: <bound method> = bound_method %int_9223372036854775807, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  970. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  971. // CHECK:STDOUT: %bound_method.loc7_11.2: <bound method> = bound_method %int_9223372036854775807, %specific_fn [concrete = constants.%bound_method]
  972. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i64 = call %bound_method.loc7_11.2(%int_9223372036854775807) [concrete = constants.%int_9223372036854775807.9c2]
  973. // CHECK:STDOUT: %.loc7_11.1: %i64 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_9223372036854775807.9c2]
  974. // CHECK:STDOUT: %.loc7_11.2: %i64 = converted %int_9223372036854775807, %.loc7_11.1 [concrete = constants.%int_9223372036854775807.9c2]
  975. // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc7_11.2)
  976. // CHECK:STDOUT: return
  977. // CHECK:STDOUT: }
  978. // CHECK:STDOUT:
  979. // CHECK:STDOUT: fn @foo(%a.param: %i64);
  980. // CHECK:STDOUT:
  981. // CHECK:STDOUT: --- fail_import_large_int_literal.carbon
  982. // CHECK:STDOUT:
  983. // CHECK:STDOUT: constants {
  984. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  985. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  986. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  987. // CHECK:STDOUT: %.c5d: type = cpp_overload_set_type @foo [concrete]
  988. // CHECK:STDOUT: %empty_struct: %.c5d = struct_value () [concrete]
  989. // CHECK:STDOUT: %int_9223372036854775808.293: Core.IntLiteral = int_value 9223372036854775808 [concrete]
  990. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete]
  991. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  992. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  993. // CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [concrete]
  994. // CHECK:STDOUT: %pattern_type.95b: type = pattern_type %i64 [concrete]
  995. // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
  996. // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
  997. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  998. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  999. // CHECK:STDOUT: %ImplicitAs.type.e50: type = facet_type <@ImplicitAs, @ImplicitAs(%i64)> [concrete]
  1000. // CHECK:STDOUT: %ImplicitAs.Convert.type.94e: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i64) [concrete]
  1001. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  1002. // 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]
  1003. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340 = struct_value () [symbolic]
  1004. // CHECK:STDOUT: %ImplicitAs.impl_witness.830: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.9e9, @Core.IntLiteral.as.ImplicitAs.impl(%int_64) [concrete]
  1005. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.685: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_64) [concrete]
  1006. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.719: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.685 = struct_value () [concrete]
  1007. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e50 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.830) [concrete]
  1008. // CHECK:STDOUT: %.35c: type = fn_type_with_self_type %ImplicitAs.Convert.type.94e, %ImplicitAs.facet [concrete]
  1009. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_9223372036854775808.293, %Core.IntLiteral.as.ImplicitAs.impl.Convert.719 [concrete]
  1010. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.719, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_64) [concrete]
  1011. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_9223372036854775808.293, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  1012. // CHECK:STDOUT: %int_9223372036854775808.b10: %i64 = int_value 9223372036854775808 [concrete]
  1013. // CHECK:STDOUT: }
  1014. // CHECK:STDOUT:
  1015. // CHECK:STDOUT: imports {
  1016. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1017. // CHECK:STDOUT: .Int = %Core.Int
  1018. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  1019. // CHECK:STDOUT: import Core//prelude
  1020. // CHECK:STDOUT: import Core//prelude/...
  1021. // CHECK:STDOUT: }
  1022. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  1023. // CHECK:STDOUT: .foo = %.a21
  1024. // CHECK:STDOUT: import Cpp//...
  1025. // CHECK:STDOUT: }
  1026. // CHECK:STDOUT: %.a21: %.c5d = cpp_overload_set_value @foo [concrete = constants.%empty_struct]
  1027. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1028. // CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
  1029. // CHECK:STDOUT: %a.patt: %pattern_type.95b = binding_pattern a [concrete]
  1030. // CHECK:STDOUT: %a.param_patt: %pattern_type.95b = value_param_pattern %a.patt, call_param0 [concrete]
  1031. // CHECK:STDOUT: } {
  1032. // CHECK:STDOUT: %a.param: %i64 = value_param call_param0
  1033. // CHECK:STDOUT: %.1: type = splice_block %i64 [concrete = constants.%i64] {
  1034. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
  1035. // CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64]
  1036. // CHECK:STDOUT: }
  1037. // CHECK:STDOUT: %a: %i64 = bind_name a, %a.param
  1038. // CHECK:STDOUT: }
  1039. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  1040. // 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, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0)]
  1041. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.9e9 = impl_witness_table (%Core.import_ref.ee7), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  1042. // CHECK:STDOUT: }
  1043. // CHECK:STDOUT:
  1044. // CHECK:STDOUT: file {
  1045. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1046. // CHECK:STDOUT: .Core = imports.%Core
  1047. // CHECK:STDOUT: .Cpp = imports.%Cpp
  1048. // CHECK:STDOUT: .F = %F.decl
  1049. // CHECK:STDOUT: }
  1050. // CHECK:STDOUT: %Core.import = import Core
  1051. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  1052. // CHECK:STDOUT: import Cpp "large_int_literal.h"
  1053. // CHECK:STDOUT: }
  1054. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  1055. // CHECK:STDOUT: }
  1056. // CHECK:STDOUT:
  1057. // CHECK:STDOUT: fn @F() {
  1058. // CHECK:STDOUT: !entry:
  1059. // CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1060. // CHECK:STDOUT: %foo.ref: %.c5d = name_ref foo, imports.%.a21 [concrete = constants.%empty_struct]
  1061. // CHECK:STDOUT: %int_9223372036854775808: Core.IntLiteral = int_value 9223372036854775808 [concrete = constants.%int_9223372036854775808.293]
  1062. // CHECK:STDOUT: %impl.elem0: %.35c = impl_witness_access constants.%ImplicitAs.impl_witness.830, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.719]
  1063. // CHECK:STDOUT: %bound_method.loc12_11.1: <bound method> = bound_method %int_9223372036854775808, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  1064. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  1065. // CHECK:STDOUT: %bound_method.loc12_11.2: <bound method> = bound_method %int_9223372036854775808, %specific_fn [concrete = constants.%bound_method]
  1066. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i64 = call %bound_method.loc12_11.2(%int_9223372036854775808) [concrete = constants.%int_9223372036854775808.b10]
  1067. // CHECK:STDOUT: %.loc12_11.1: %i64 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_9223372036854775808.b10]
  1068. // CHECK:STDOUT: %.loc12_11.2: %i64 = converted %int_9223372036854775808, %.loc12_11.1 [concrete = constants.%int_9223372036854775808.b10]
  1069. // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc12_11.2)
  1070. // CHECK:STDOUT: return
  1071. // CHECK:STDOUT: }
  1072. // CHECK:STDOUT:
  1073. // CHECK:STDOUT: fn @foo(%a.param: %i64);
  1074. // CHECK:STDOUT:
  1075. // CHECK:STDOUT: --- import_negative_int_literal.carbon
  1076. // CHECK:STDOUT:
  1077. // CHECK:STDOUT: constants {
  1078. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1079. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1080. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1081. // CHECK:STDOUT: %.c5d: type = cpp_overload_set_type @Negate.Op [concrete]
  1082. // CHECK:STDOUT: %empty_struct: %.c5d = struct_value () [concrete]
  1083. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  1084. // CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [concrete]
  1085. // CHECK:STDOUT: %Negate.Op.type: type = fn_type @Negate.Op [concrete]
  1086. // CHECK:STDOUT: %Negate.impl_witness: <witness> = impl_witness imports.%Negate.impl_witness_table [concrete]
  1087. // CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value Core.IntLiteral, (%Negate.impl_witness) [concrete]
  1088. // CHECK:STDOUT: %.a96: type = fn_type_with_self_type %Negate.Op.type, %Negate.facet [concrete]
  1089. // CHECK:STDOUT: %Core.IntLiteral.as.Negate.impl.Op.type: type = fn_type @Core.IntLiteral.as.Negate.impl.Op [concrete]
  1090. // CHECK:STDOUT: %Core.IntLiteral.as.Negate.impl.Op: %Core.IntLiteral.as.Negate.impl.Op.type = struct_value () [concrete]
  1091. // CHECK:STDOUT: %Core.IntLiteral.as.Negate.impl.Op.bound: <bound method> = bound_method %int_1, %Core.IntLiteral.as.Negate.impl.Op [concrete]
  1092. // CHECK:STDOUT: %int_-1.638: Core.IntLiteral = int_value -1 [concrete]
  1093. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1094. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1095. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1096. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1097. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  1098. // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
  1099. // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
  1100. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  1101. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  1102. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  1103. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  1104. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  1105. // 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]
  1106. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340 = struct_value () [symbolic]
  1107. // CHECK:STDOUT: %ImplicitAs.impl_witness.204: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.9e9, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  1108. // 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]
  1109. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584 = struct_value () [concrete]
  1110. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.204) [concrete]
  1111. // CHECK:STDOUT: %.1df: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  1112. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_-1.638, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [concrete]
  1113. // 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]
  1114. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_-1.638, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  1115. // CHECK:STDOUT: %int_-1.251: %i32 = int_value -1 [concrete]
  1116. // CHECK:STDOUT: }
  1117. // CHECK:STDOUT:
  1118. // CHECK:STDOUT: imports {
  1119. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1120. // CHECK:STDOUT: .Negate = %Core.Negate
  1121. // CHECK:STDOUT: .Int = %Core.Int
  1122. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  1123. // CHECK:STDOUT: import Core//prelude
  1124. // CHECK:STDOUT: import Core//prelude/...
  1125. // CHECK:STDOUT: }
  1126. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  1127. // CHECK:STDOUT: .foo = %.a21
  1128. // CHECK:STDOUT: import Cpp//...
  1129. // CHECK:STDOUT: }
  1130. // CHECK:STDOUT: %.a21: %.c5d = cpp_overload_set_value @Negate.Op [concrete = constants.%empty_struct]
  1131. // CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/parts/int_literal, Negate, loaded [concrete = constants.%Negate.type]
  1132. // CHECK:STDOUT: %Core.import_ref.abd = import_ref Core//prelude/parts/int_literal, loc13_50, unloaded
  1133. // CHECK:STDOUT: %Core.import_ref.3d9: %Core.IntLiteral.as.Negate.impl.Op.type = import_ref Core//prelude/parts/int_literal, loc14_31, loaded [concrete = constants.%Core.IntLiteral.as.Negate.impl.Op]
  1134. // CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.abd, %Core.import_ref.3d9), @Core.IntLiteral.as.Negate.impl [concrete]
  1135. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1136. // CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
  1137. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete]
  1138. // CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete]
  1139. // CHECK:STDOUT: } {
  1140. // CHECK:STDOUT: %a.param: %i32 = value_param call_param0
  1141. // CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] {
  1142. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1143. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1144. // CHECK:STDOUT: }
  1145. // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
  1146. // CHECK:STDOUT: }
  1147. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  1148. // 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, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0)]
  1149. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.9e9 = impl_witness_table (%Core.import_ref.ee7), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  1150. // CHECK:STDOUT: }
  1151. // CHECK:STDOUT:
  1152. // CHECK:STDOUT: file {
  1153. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1154. // CHECK:STDOUT: .Core = imports.%Core
  1155. // CHECK:STDOUT: .Cpp = imports.%Cpp
  1156. // CHECK:STDOUT: .F = %F.decl
  1157. // CHECK:STDOUT: }
  1158. // CHECK:STDOUT: %Core.import = import Core
  1159. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  1160. // CHECK:STDOUT: import Cpp "negative_int_literal.h"
  1161. // CHECK:STDOUT: }
  1162. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  1163. // CHECK:STDOUT: }
  1164. // CHECK:STDOUT:
  1165. // CHECK:STDOUT: fn @F() {
  1166. // CHECK:STDOUT: !entry:
  1167. // CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1168. // CHECK:STDOUT: %foo.ref: %.c5d = name_ref foo, imports.%.a21 [concrete = constants.%empty_struct]
  1169. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  1170. // CHECK:STDOUT: %impl.elem1: %.a96 = impl_witness_access constants.%Negate.impl_witness, element1 [concrete = constants.%Core.IntLiteral.as.Negate.impl.Op]
  1171. // CHECK:STDOUT: %bound_method.loc8_11.1: <bound method> = bound_method %int_1, %impl.elem1 [concrete = constants.%Core.IntLiteral.as.Negate.impl.Op.bound]
  1172. // CHECK:STDOUT: %Core.IntLiteral.as.Negate.impl.Op.call: init Core.IntLiteral = call %bound_method.loc8_11.1(%int_1) [concrete = constants.%int_-1.638]
  1173. // CHECK:STDOUT: %impl.elem0: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  1174. // CHECK:STDOUT: %bound_method.loc8_11.2: <bound method> = bound_method %Core.IntLiteral.as.Negate.impl.Op.call, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  1175. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  1176. // CHECK:STDOUT: %bound_method.loc8_11.3: <bound method> = bound_method %Core.IntLiteral.as.Negate.impl.Op.call, %specific_fn [concrete = constants.%bound_method]
  1177. // CHECK:STDOUT: %.loc8_11.1: Core.IntLiteral = value_of_initializer %Core.IntLiteral.as.Negate.impl.Op.call [concrete = constants.%int_-1.638]
  1178. // CHECK:STDOUT: %.loc8_11.2: Core.IntLiteral = converted %Core.IntLiteral.as.Negate.impl.Op.call, %.loc8_11.1 [concrete = constants.%int_-1.638]
  1179. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc8_11.3(%.loc8_11.2) [concrete = constants.%int_-1.251]
  1180. // CHECK:STDOUT: %.loc8_11.3: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_-1.251]
  1181. // CHECK:STDOUT: %.loc8_11.4: %i32 = converted %Core.IntLiteral.as.Negate.impl.Op.call, %.loc8_11.3 [concrete = constants.%int_-1.251]
  1182. // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc8_11.4)
  1183. // CHECK:STDOUT: return
  1184. // CHECK:STDOUT: }
  1185. // CHECK:STDOUT:
  1186. // CHECK:STDOUT: fn @foo(%a.param: %i32);
  1187. // CHECK:STDOUT:
  1188. // CHECK:STDOUT: --- fail_import_negative_literal_passed_to_unsigned.carbon
  1189. // CHECK:STDOUT:
  1190. // CHECK:STDOUT: constants {
  1191. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1192. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1193. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1194. // CHECK:STDOUT: %.c5d: type = cpp_overload_set_type @Negate.Op [concrete]
  1195. // CHECK:STDOUT: %empty_struct: %.c5d = struct_value () [concrete]
  1196. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  1197. // CHECK:STDOUT: %Negate.type: type = facet_type <@Negate> [concrete]
  1198. // CHECK:STDOUT: %Negate.Op.type: type = fn_type @Negate.Op [concrete]
  1199. // CHECK:STDOUT: %Negate.impl_witness: <witness> = impl_witness imports.%Negate.impl_witness_table [concrete]
  1200. // CHECK:STDOUT: %Negate.facet: %Negate.type = facet_value Core.IntLiteral, (%Negate.impl_witness) [concrete]
  1201. // CHECK:STDOUT: %.a96: type = fn_type_with_self_type %Negate.Op.type, %Negate.facet [concrete]
  1202. // CHECK:STDOUT: %Core.IntLiteral.as.Negate.impl.Op.type: type = fn_type @Core.IntLiteral.as.Negate.impl.Op [concrete]
  1203. // CHECK:STDOUT: %Core.IntLiteral.as.Negate.impl.Op: %Core.IntLiteral.as.Negate.impl.Op.type = struct_value () [concrete]
  1204. // CHECK:STDOUT: %Core.IntLiteral.as.Negate.impl.Op.bound: <bound method> = bound_method %int_1, %Core.IntLiteral.as.Negate.impl.Op [concrete]
  1205. // CHECK:STDOUT: %int_-1.638: Core.IntLiteral = int_value -1 [concrete]
  1206. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1207. // CHECK:STDOUT: %UInt.type: type = generic_class_type @UInt [concrete]
  1208. // CHECK:STDOUT: %UInt.generic: %UInt.type = struct_value () [concrete]
  1209. // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [concrete]
  1210. // CHECK:STDOUT: %pattern_type.4a9: type = pattern_type %u32 [concrete]
  1211. // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
  1212. // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
  1213. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  1214. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  1215. // CHECK:STDOUT: %ImplicitAs.type.9e2: type = facet_type <@ImplicitAs, @ImplicitAs(%u32)> [concrete]
  1216. // CHECK:STDOUT: %ImplicitAs.Convert.type.92a: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%u32) [concrete]
  1217. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  1218. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.3a3: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  1219. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.782: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.3a3 = struct_value () [symbolic]
  1220. // CHECK:STDOUT: %ImplicitAs.impl_witness.f1e: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.440, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  1221. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4a7: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  1222. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.d2b: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4a7 = struct_value () [concrete]
  1223. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.9e2 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.f1e) [concrete]
  1224. // CHECK:STDOUT: %.3db: type = fn_type_with_self_type %ImplicitAs.Convert.type.92a, %ImplicitAs.facet [concrete]
  1225. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_-1.638, %Core.IntLiteral.as.ImplicitAs.impl.Convert.d2b [concrete]
  1226. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.d2b, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  1227. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_-1.638, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  1228. // CHECK:STDOUT: %int_-1.311: %u32 = int_value 18446744073709551615 [concrete]
  1229. // CHECK:STDOUT: }
  1230. // CHECK:STDOUT:
  1231. // CHECK:STDOUT: imports {
  1232. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1233. // CHECK:STDOUT: .Negate = %Core.Negate
  1234. // CHECK:STDOUT: .UInt = %Core.UInt
  1235. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  1236. // CHECK:STDOUT: import Core//prelude
  1237. // CHECK:STDOUT: import Core//prelude/...
  1238. // CHECK:STDOUT: }
  1239. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  1240. // CHECK:STDOUT: .foo = %.a21
  1241. // CHECK:STDOUT: import Cpp//...
  1242. // CHECK:STDOUT: }
  1243. // CHECK:STDOUT: %.a21: %.c5d = cpp_overload_set_value @Negate.Op [concrete = constants.%empty_struct]
  1244. // CHECK:STDOUT: %Core.Negate: type = import_ref Core//prelude/parts/int_literal, Negate, loaded [concrete = constants.%Negate.type]
  1245. // CHECK:STDOUT: %Core.import_ref.abd = import_ref Core//prelude/parts/int_literal, loc13_50, unloaded
  1246. // CHECK:STDOUT: %Core.import_ref.3d9: %Core.IntLiteral.as.Negate.impl.Op.type = import_ref Core//prelude/parts/int_literal, loc14_31, loaded [concrete = constants.%Core.IntLiteral.as.Negate.impl.Op]
  1247. // CHECK:STDOUT: %Negate.impl_witness_table = impl_witness_table (%Core.import_ref.abd, %Core.import_ref.3d9), @Core.IntLiteral.as.Negate.impl [concrete]
  1248. // CHECK:STDOUT: %Core.UInt: %UInt.type = import_ref Core//prelude/parts/uint, UInt, loaded [concrete = constants.%UInt.generic]
  1249. // CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
  1250. // CHECK:STDOUT: %a.patt: %pattern_type.4a9 = binding_pattern a [concrete]
  1251. // CHECK:STDOUT: %a.param_patt: %pattern_type.4a9 = value_param_pattern %a.patt, call_param0 [concrete]
  1252. // CHECK:STDOUT: } {
  1253. // CHECK:STDOUT: %a.param: %u32 = value_param call_param0
  1254. // CHECK:STDOUT: %.1: type = splice_block %u32 [concrete = constants.%u32] {
  1255. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1256. // CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [concrete = constants.%u32]
  1257. // CHECK:STDOUT: }
  1258. // CHECK:STDOUT: %a: %u32 = bind_name a, %a.param
  1259. // CHECK:STDOUT: }
  1260. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  1261. // CHECK:STDOUT: %Core.import_ref.1c1: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.3a3) = import_ref Core//prelude/parts/uint, loc23_40, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.782)]
  1262. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.440 = impl_witness_table (%Core.import_ref.1c1), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  1263. // CHECK:STDOUT: }
  1264. // CHECK:STDOUT:
  1265. // CHECK:STDOUT: file {
  1266. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1267. // CHECK:STDOUT: .Core = imports.%Core
  1268. // CHECK:STDOUT: .Cpp = imports.%Cpp
  1269. // CHECK:STDOUT: .F = %F.decl
  1270. // CHECK:STDOUT: }
  1271. // CHECK:STDOUT: %Core.import = import Core
  1272. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  1273. // CHECK:STDOUT: import Cpp "negative_literal_passed_to_unsigned.h"
  1274. // CHECK:STDOUT: }
  1275. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  1276. // CHECK:STDOUT: }
  1277. // CHECK:STDOUT:
  1278. // CHECK:STDOUT: fn @F() {
  1279. // CHECK:STDOUT: !entry:
  1280. // CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1281. // CHECK:STDOUT: %foo.ref: %.c5d = name_ref foo, imports.%.a21 [concrete = constants.%empty_struct]
  1282. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  1283. // CHECK:STDOUT: %impl.elem1: %.a96 = impl_witness_access constants.%Negate.impl_witness, element1 [concrete = constants.%Core.IntLiteral.as.Negate.impl.Op]
  1284. // CHECK:STDOUT: %bound_method.loc12_11.1: <bound method> = bound_method %int_1, %impl.elem1 [concrete = constants.%Core.IntLiteral.as.Negate.impl.Op.bound]
  1285. // CHECK:STDOUT: %Core.IntLiteral.as.Negate.impl.Op.call: init Core.IntLiteral = call %bound_method.loc12_11.1(%int_1) [concrete = constants.%int_-1.638]
  1286. // CHECK:STDOUT: %impl.elem0: %.3db = impl_witness_access constants.%ImplicitAs.impl_witness.f1e, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.d2b]
  1287. // CHECK:STDOUT: %bound_method.loc12_11.2: <bound method> = bound_method %Core.IntLiteral.as.Negate.impl.Op.call, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  1288. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  1289. // CHECK:STDOUT: %bound_method.loc12_11.3: <bound method> = bound_method %Core.IntLiteral.as.Negate.impl.Op.call, %specific_fn [concrete = constants.%bound_method]
  1290. // CHECK:STDOUT: %.loc12_11.1: Core.IntLiteral = value_of_initializer %Core.IntLiteral.as.Negate.impl.Op.call [concrete = constants.%int_-1.638]
  1291. // CHECK:STDOUT: %.loc12_11.2: Core.IntLiteral = converted %Core.IntLiteral.as.Negate.impl.Op.call, %.loc12_11.1 [concrete = constants.%int_-1.638]
  1292. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %u32 = call %bound_method.loc12_11.3(%.loc12_11.2) [concrete = constants.%int_-1.311]
  1293. // CHECK:STDOUT: %.loc12_11.3: %u32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_-1.311]
  1294. // CHECK:STDOUT: %.loc12_11.4: %u32 = converted %Core.IntLiteral.as.Negate.impl.Op.call, %.loc12_11.3 [concrete = constants.%int_-1.311]
  1295. // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc12_11.4)
  1296. // CHECK:STDOUT: return
  1297. // CHECK:STDOUT: }
  1298. // CHECK:STDOUT:
  1299. // CHECK:STDOUT: fn @foo(%a.param: %u32);
  1300. // CHECK:STDOUT:
  1301. // CHECK:STDOUT: --- fail_todo_import_struct_literal_call_arg.carbon
  1302. // CHECK:STDOUT:
  1303. // CHECK:STDOUT: constants {
  1304. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1305. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1306. // CHECK:STDOUT: %.c5d: type = cpp_overload_set_type @<null name> [concrete]
  1307. // CHECK:STDOUT: %empty_struct: %.c5d = struct_value () [concrete]
  1308. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1309. // CHECK:STDOUT: }
  1310. // CHECK:STDOUT:
  1311. // CHECK:STDOUT: imports {
  1312. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1313. // CHECK:STDOUT: import Core//prelude
  1314. // CHECK:STDOUT: import Core//prelude/...
  1315. // CHECK:STDOUT: }
  1316. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  1317. // CHECK:STDOUT: .foo = %.a21
  1318. // CHECK:STDOUT: import Cpp//...
  1319. // CHECK:STDOUT: }
  1320. // CHECK:STDOUT: %.a21: %.c5d = cpp_overload_set_value @<null name> [concrete = constants.%empty_struct]
  1321. // CHECK:STDOUT: }
  1322. // CHECK:STDOUT:
  1323. // CHECK:STDOUT: file {
  1324. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1325. // CHECK:STDOUT: .Core = imports.%Core
  1326. // CHECK:STDOUT: .Cpp = imports.%Cpp
  1327. // CHECK:STDOUT: .F = %F.decl
  1328. // CHECK:STDOUT: }
  1329. // CHECK:STDOUT: %Core.import = import Core
  1330. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  1331. // CHECK:STDOUT: import Cpp "struct_literal_call_arg.h"
  1332. // CHECK:STDOUT: }
  1333. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  1334. // CHECK:STDOUT: }
  1335. // CHECK:STDOUT:
  1336. // CHECK:STDOUT: class @S {
  1337. // CHECK:STDOUT: complete_type_witness = invalid
  1338. // CHECK:STDOUT:
  1339. // CHECK:STDOUT: !members:
  1340. // CHECK:STDOUT: import Cpp//...
  1341. // CHECK:STDOUT: }
  1342. // CHECK:STDOUT:
  1343. // CHECK:STDOUT: fn @F() {
  1344. // CHECK:STDOUT: !entry:
  1345. // CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1346. // CHECK:STDOUT: %foo.ref: %.c5d = name_ref foo, imports.%.a21 [concrete = constants.%empty_struct]
  1347. // CHECK:STDOUT: %.loc14: %empty_struct_type = struct_literal ()
  1348. // CHECK:STDOUT: return
  1349. // CHECK:STDOUT: }
  1350. // CHECK:STDOUT:
  1351. // CHECK:STDOUT: --- fail_import_upsizing_rejected.carbon
  1352. // CHECK:STDOUT:
  1353. // CHECK:STDOUT: constants {
  1354. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1355. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1356. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1357. // CHECK:STDOUT: %.c5d: type = cpp_overload_set_type @As.Convert [concrete]
  1358. // CHECK:STDOUT: %empty_struct: %.c5d = struct_value () [concrete]
  1359. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  1360. // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete]
  1361. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1362. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1363. // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete]
  1364. // CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete]
  1365. // CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete]
  1366. // CHECK:STDOUT: %As.type.771: type = facet_type <@As, @As(%i16)> [concrete]
  1367. // CHECK:STDOUT: %As.Convert.type.be5: type = fn_type @As.Convert, @As(%i16) [concrete]
  1368. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  1369. // 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]
  1370. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.d2c: %Core.IntLiteral.as.As.impl.Convert.type.565 = struct_value () [symbolic]
  1371. // CHECK:STDOUT: %As.impl_witness.2d2: <witness> = impl_witness imports.%As.impl_witness_table.5ad, @Core.IntLiteral.as.As.impl(%int_16) [concrete]
  1372. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.38a: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_16) [concrete]
  1373. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.97a: %Core.IntLiteral.as.As.impl.Convert.type.38a = struct_value () [concrete]
  1374. // CHECK:STDOUT: %As.facet: %As.type.771 = facet_value Core.IntLiteral, (%As.impl_witness.2d2) [concrete]
  1375. // CHECK:STDOUT: %.026: type = fn_type_with_self_type %As.Convert.type.be5, %As.facet [concrete]
  1376. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.97a [concrete]
  1377. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.97a, @Core.IntLiteral.as.As.impl.Convert(%int_16) [concrete]
  1378. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
  1379. // CHECK:STDOUT: %int_1.f90: %i16 = int_value 1 [concrete]
  1380. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1381. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1382. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  1383. // CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
  1384. // CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
  1385. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  1386. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  1387. // CHECK:STDOUT: }
  1388. // CHECK:STDOUT:
  1389. // CHECK:STDOUT: imports {
  1390. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1391. // CHECK:STDOUT: .Int = %Core.Int
  1392. // CHECK:STDOUT: .As = %Core.As
  1393. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  1394. // CHECK:STDOUT: import Core//prelude
  1395. // CHECK:STDOUT: import Core//prelude/...
  1396. // CHECK:STDOUT: }
  1397. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  1398. // CHECK:STDOUT: .foo = %.a21
  1399. // CHECK:STDOUT: import Cpp//...
  1400. // CHECK:STDOUT: }
  1401. // CHECK:STDOUT: %.a21: %.c5d = cpp_overload_set_value @As.Convert [concrete = constants.%empty_struct]
  1402. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1403. // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic]
  1404. // 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, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.d2c)]
  1405. // CHECK:STDOUT: %As.impl_witness_table.5ad = impl_witness_table (%Core.import_ref.99c), @Core.IntLiteral.as.As.impl [concrete]
  1406. // CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
  1407. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete]
  1408. // CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete]
  1409. // CHECK:STDOUT: } {
  1410. // CHECK:STDOUT: %a.param: %i32 = value_param call_param0
  1411. // CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] {
  1412. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1413. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1414. // CHECK:STDOUT: }
  1415. // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
  1416. // CHECK:STDOUT: }
  1417. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  1418. // CHECK:STDOUT: }
  1419. // CHECK:STDOUT:
  1420. // CHECK:STDOUT: file {
  1421. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1422. // CHECK:STDOUT: .Core = imports.%Core
  1423. // CHECK:STDOUT: .Cpp = imports.%Cpp
  1424. // CHECK:STDOUT: .F = %F.decl
  1425. // CHECK:STDOUT: }
  1426. // CHECK:STDOUT: %Core.import = import Core
  1427. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  1428. // CHECK:STDOUT: import Cpp "upsizing_rejected.h"
  1429. // CHECK:STDOUT: }
  1430. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  1431. // CHECK:STDOUT: }
  1432. // CHECK:STDOUT:
  1433. // CHECK:STDOUT: fn @F() {
  1434. // CHECK:STDOUT: !entry:
  1435. // CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1436. // CHECK:STDOUT: %foo.ref: %.c5d = name_ref foo, imports.%.a21 [concrete = constants.%empty_struct]
  1437. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  1438. // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16]
  1439. // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16]
  1440. // CHECK:STDOUT: %impl.elem0: %.026 = impl_witness_access constants.%As.impl_witness.2d2, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.97a]
  1441. // CHECK:STDOUT: %bound_method.loc15_13.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
  1442. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_16) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
  1443. // CHECK:STDOUT: %bound_method.loc15_13.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
  1444. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i16 = call %bound_method.loc15_13.2(%int_1) [concrete = constants.%int_1.f90]
  1445. // CHECK:STDOUT: %.loc15_13.1: %i16 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.f90]
  1446. // CHECK:STDOUT: %.loc15_13.2: %i16 = converted %int_1, %.loc15_13.1 [concrete = constants.%int_1.f90]
  1447. // CHECK:STDOUT: %.loc15_13.3: %i32 = converted %.loc15_13.2, <error> [concrete = <error>]
  1448. // CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(<error>)
  1449. // CHECK:STDOUT: return
  1450. // CHECK:STDOUT: }
  1451. // CHECK:STDOUT:
  1452. // CHECK:STDOUT: fn @foo(%a.param: %i32);
  1453. // CHECK:STDOUT:
  1454. // CHECK:STDOUT: --- fail_import_downsizing_rejected.carbon
  1455. // CHECK:STDOUT:
  1456. // CHECK:STDOUT: constants {
  1457. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1458. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1459. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1460. // CHECK:STDOUT: %.c5d: type = cpp_overload_set_type @As.Convert [concrete]
  1461. // CHECK:STDOUT: %empty_struct: %.c5d = struct_value () [concrete]
  1462. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  1463. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1464. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1465. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1466. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1467. // CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete]
  1468. // CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete]
  1469. // CHECK:STDOUT: %As.type.dbd: type = facet_type <@As, @As(%i32)> [concrete]
  1470. // CHECK:STDOUT: %As.Convert.type.99b: type = fn_type @As.Convert, @As(%i32) [concrete]
  1471. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  1472. // 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]
  1473. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.d2c: %Core.IntLiteral.as.As.impl.Convert.type.565 = struct_value () [symbolic]
  1474. // CHECK:STDOUT: %As.impl_witness.080: <witness> = impl_witness imports.%As.impl_witness_table.5ad, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  1475. // 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]
  1476. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.414: %Core.IntLiteral.as.As.impl.Convert.type.aaf = struct_value () [concrete]
  1477. // CHECK:STDOUT: %As.facet: %As.type.dbd = facet_value Core.IntLiteral, (%As.impl_witness.080) [concrete]
  1478. // CHECK:STDOUT: %.351: type = fn_type_with_self_type %As.Convert.type.99b, %As.facet [concrete]
  1479. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.414 [concrete]
  1480. // 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]
  1481. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
  1482. // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
  1483. // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete]
  1484. // CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [concrete]
  1485. // CHECK:STDOUT: %ptr: type = ptr_type %i16 [concrete]
  1486. // CHECK:STDOUT: %pattern_type.54c: type = pattern_type %ptr [concrete]
  1487. // CHECK:STDOUT: %foo__carbon_thunk.type: type = fn_type @foo__carbon_thunk [concrete]
  1488. // CHECK:STDOUT: %foo__carbon_thunk: %foo__carbon_thunk.type = struct_value () [concrete]
  1489. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  1490. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  1491. // CHECK:STDOUT: }
  1492. // CHECK:STDOUT:
  1493. // CHECK:STDOUT: imports {
  1494. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1495. // CHECK:STDOUT: .Int = %Core.Int
  1496. // CHECK:STDOUT: .As = %Core.As
  1497. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  1498. // CHECK:STDOUT: import Core//prelude
  1499. // CHECK:STDOUT: import Core//prelude/...
  1500. // CHECK:STDOUT: }
  1501. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  1502. // CHECK:STDOUT: .foo = %.a21
  1503. // CHECK:STDOUT: import Cpp//...
  1504. // CHECK:STDOUT: }
  1505. // CHECK:STDOUT: %.a21: %.c5d = cpp_overload_set_value @As.Convert [concrete = constants.%empty_struct]
  1506. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1507. // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic]
  1508. // 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, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.d2c)]
  1509. // CHECK:STDOUT: %As.impl_witness_table.5ad = impl_witness_table (%Core.import_ref.99c), @Core.IntLiteral.as.As.impl [concrete]
  1510. // CHECK:STDOUT: %foo__carbon_thunk.decl: %foo__carbon_thunk.type = fn_decl @foo__carbon_thunk [concrete = constants.%foo__carbon_thunk] {
  1511. // CHECK:STDOUT: %a.patt: %pattern_type.54c = binding_pattern a [concrete]
  1512. // CHECK:STDOUT: %a.param_patt: %pattern_type.54c = value_param_pattern %a.patt, call_param0 [concrete]
  1513. // CHECK:STDOUT: } {
  1514. // CHECK:STDOUT: %a.param: %ptr = value_param call_param0
  1515. // CHECK:STDOUT: %.1: type = splice_block constants.%ptr [concrete = constants.%ptr] {
  1516. // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16]
  1517. // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16]
  1518. // CHECK:STDOUT: }
  1519. // CHECK:STDOUT: %a: %ptr = bind_name a, %a.param
  1520. // CHECK:STDOUT: }
  1521. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  1522. // CHECK:STDOUT: }
  1523. // CHECK:STDOUT:
  1524. // CHECK:STDOUT: file {
  1525. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1526. // CHECK:STDOUT: .Core = imports.%Core
  1527. // CHECK:STDOUT: .Cpp = imports.%Cpp
  1528. // CHECK:STDOUT: .F = %F.decl
  1529. // CHECK:STDOUT: }
  1530. // CHECK:STDOUT: %Core.import = import Core
  1531. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  1532. // CHECK:STDOUT: import Cpp "downsizing_rejected.h"
  1533. // CHECK:STDOUT: }
  1534. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  1535. // CHECK:STDOUT: }
  1536. // CHECK:STDOUT:
  1537. // CHECK:STDOUT: fn @F() {
  1538. // CHECK:STDOUT: !entry:
  1539. // CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1540. // CHECK:STDOUT: %foo.ref: %.c5d = name_ref foo, imports.%.a21 [concrete = constants.%empty_struct]
  1541. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  1542. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1543. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1544. // CHECK:STDOUT: %impl.elem0: %.351 = impl_witness_access constants.%As.impl_witness.080, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.414]
  1545. // CHECK:STDOUT: %bound_method.loc15_13.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
  1546. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
  1547. // CHECK:STDOUT: %bound_method.loc15_13.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
  1548. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc15_13.2(%int_1) [concrete = constants.%int_1.5d2]
  1549. // CHECK:STDOUT: %.loc15_13.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.5d2]
  1550. // CHECK:STDOUT: %.loc15_13.2: %i32 = converted %int_1, %.loc15_13.1 [concrete = constants.%int_1.5d2]
  1551. // CHECK:STDOUT: %.loc15_13.3: %i16 = converted %.loc15_13.2, <error> [concrete = <error>]
  1552. // CHECK:STDOUT: %addr: %ptr = addr_of <error> [concrete = <error>]
  1553. // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr)
  1554. // CHECK:STDOUT: return
  1555. // CHECK:STDOUT: }
  1556. // CHECK:STDOUT:
  1557. // CHECK:STDOUT: fn @foo(%a.param: %i16);
  1558. // CHECK:STDOUT:
  1559. // CHECK:STDOUT: fn @foo__carbon_thunk(%a.param: %ptr);
  1560. // CHECK:STDOUT:
  1561. // CHECK:STDOUT: --- import_same_access_level.carbon
  1562. // CHECK:STDOUT:
  1563. // CHECK:STDOUT: constants {
  1564. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1565. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1566. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1567. // CHECK:STDOUT: %S: type = class_type @S [concrete]
  1568. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1569. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  1570. // CHECK:STDOUT: %.177: type = cpp_overload_set_type @As.Convert [concrete]
  1571. // CHECK:STDOUT: %empty_struct: %.177 = struct_value () [concrete]
  1572. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  1573. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1574. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1575. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1576. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1577. // CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete]
  1578. // CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete]
  1579. // CHECK:STDOUT: %As.type.dbd: type = facet_type <@As, @As(%i32)> [concrete]
  1580. // CHECK:STDOUT: %As.Convert.type.99b: type = fn_type @As.Convert, @As(%i32) [concrete]
  1581. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  1582. // 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]
  1583. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.d2c: %Core.IntLiteral.as.As.impl.Convert.type.565 = struct_value () [symbolic]
  1584. // CHECK:STDOUT: %As.impl_witness.080: <witness> = impl_witness imports.%As.impl_witness_table.5ad, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  1585. // 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]
  1586. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.414: %Core.IntLiteral.as.As.impl.Convert.type.aaf = struct_value () [concrete]
  1587. // CHECK:STDOUT: %As.facet: %As.type.dbd = facet_value Core.IntLiteral, (%As.impl_witness.080) [concrete]
  1588. // CHECK:STDOUT: %.351: type = fn_type_with_self_type %As.Convert.type.99b, %As.facet [concrete]
  1589. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.414 [concrete]
  1590. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  1591. // 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]
  1592. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
  1593. // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
  1594. // CHECK:STDOUT: %S.foo.type: type = fn_type @S.foo [concrete]
  1595. // CHECK:STDOUT: %S.foo: %S.foo.type = struct_value () [concrete]
  1596. // CHECK:STDOUT: }
  1597. // CHECK:STDOUT:
  1598. // CHECK:STDOUT: imports {
  1599. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1600. // CHECK:STDOUT: .Int = %Core.Int
  1601. // CHECK:STDOUT: .As = %Core.As
  1602. // CHECK:STDOUT: import Core//prelude
  1603. // CHECK:STDOUT: import Core//prelude/...
  1604. // CHECK:STDOUT: }
  1605. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  1606. // CHECK:STDOUT: .S = %S.decl
  1607. // CHECK:STDOUT: import Cpp//...
  1608. // CHECK:STDOUT: }
  1609. // CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
  1610. // CHECK:STDOUT: %.dcb: %.177 = cpp_overload_set_value @As.Convert [concrete = constants.%empty_struct]
  1611. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1612. // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic]
  1613. // 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, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.d2c)]
  1614. // CHECK:STDOUT: %As.impl_witness_table.5ad = impl_witness_table (%Core.import_ref.99c), @Core.IntLiteral.as.As.impl [concrete]
  1615. // CHECK:STDOUT: %S.foo.decl: %S.foo.type = fn_decl @S.foo [concrete = constants.%S.foo] {
  1616. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = binding_pattern a [concrete]
  1617. // CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete]
  1618. // CHECK:STDOUT: } {
  1619. // CHECK:STDOUT: %a.param: %i32 = value_param call_param0
  1620. // CHECK:STDOUT: %.1: type = splice_block %i32 [concrete = constants.%i32] {
  1621. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1622. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1623. // CHECK:STDOUT: }
  1624. // CHECK:STDOUT: %a: %i32 = bind_name a, %a.param
  1625. // CHECK:STDOUT: }
  1626. // CHECK:STDOUT: }
  1627. // CHECK:STDOUT:
  1628. // CHECK:STDOUT: file {
  1629. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1630. // CHECK:STDOUT: .Core = imports.%Core
  1631. // CHECK:STDOUT: .Cpp = imports.%Cpp
  1632. // CHECK:STDOUT: .F = %F.decl
  1633. // CHECK:STDOUT: }
  1634. // CHECK:STDOUT: %Core.import = import Core
  1635. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  1636. // CHECK:STDOUT: import Cpp "same_access_level.h"
  1637. // CHECK:STDOUT: }
  1638. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  1639. // CHECK:STDOUT: }
  1640. // CHECK:STDOUT:
  1641. // CHECK:STDOUT: class @S {
  1642. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1643. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  1644. // CHECK:STDOUT: complete_type_witness = %complete_type
  1645. // CHECK:STDOUT:
  1646. // CHECK:STDOUT: !members:
  1647. // CHECK:STDOUT: .foo = imports.%.dcb
  1648. // CHECK:STDOUT: import Cpp//...
  1649. // CHECK:STDOUT: }
  1650. // CHECK:STDOUT:
  1651. // CHECK:STDOUT: fn @F() {
  1652. // CHECK:STDOUT: !entry:
  1653. // CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1654. // CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  1655. // CHECK:STDOUT: %foo.ref: %.177 = name_ref foo, imports.%.dcb [concrete = constants.%empty_struct]
  1656. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  1657. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1658. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1659. // CHECK:STDOUT: %impl.elem0: %.351 = impl_witness_access constants.%As.impl_witness.080, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.414]
  1660. // CHECK:STDOUT: %bound_method.loc7_15.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
  1661. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
  1662. // CHECK:STDOUT: %bound_method.loc7_15.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
  1663. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc7_15.2(%int_1) [concrete = constants.%int_1.5d2]
  1664. // CHECK:STDOUT: %.loc7_15.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.5d2]
  1665. // CHECK:STDOUT: %.loc7_15.2: %i32 = converted %int_1, %.loc7_15.1 [concrete = constants.%int_1.5d2]
  1666. // CHECK:STDOUT: %S.foo.call: init %empty_tuple.type = call imports.%S.foo.decl(%.loc7_15.2)
  1667. // CHECK:STDOUT: return
  1668. // CHECK:STDOUT: }
  1669. // CHECK:STDOUT:
  1670. // CHECK:STDOUT: fn @S.foo(%a.param: %i32);
  1671. // CHECK:STDOUT:
  1672. // CHECK:STDOUT: --- fail_todo_import_mixed_access_level.carbon
  1673. // CHECK:STDOUT:
  1674. // CHECK:STDOUT: constants {
  1675. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1676. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1677. // CHECK:STDOUT: %S: type = class_type @S [concrete]
  1678. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1679. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  1680. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  1681. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1682. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1683. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1684. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1685. // CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete]
  1686. // CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete]
  1687. // CHECK:STDOUT: %As.type.dbd: type = facet_type <@As, @As(%i32)> [concrete]
  1688. // CHECK:STDOUT: %As.Convert.type.99b: type = fn_type @As.Convert, @As(%i32) [concrete]
  1689. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  1690. // 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]
  1691. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.d2c: %Core.IntLiteral.as.As.impl.Convert.type.565 = struct_value () [symbolic]
  1692. // CHECK:STDOUT: %As.impl_witness.080: <witness> = impl_witness imports.%As.impl_witness_table.5ad, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  1693. // 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]
  1694. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.414: %Core.IntLiteral.as.As.impl.Convert.type.aaf = struct_value () [concrete]
  1695. // CHECK:STDOUT: %As.facet: %As.type.dbd = facet_value Core.IntLiteral, (%As.impl_witness.080) [concrete]
  1696. // CHECK:STDOUT: %.351: type = fn_type_with_self_type %As.Convert.type.99b, %As.facet [concrete]
  1697. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.414 [concrete]
  1698. // 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]
  1699. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
  1700. // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
  1701. // CHECK:STDOUT: }
  1702. // CHECK:STDOUT:
  1703. // CHECK:STDOUT: imports {
  1704. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1705. // CHECK:STDOUT: .Int = %Core.Int
  1706. // CHECK:STDOUT: .As = %Core.As
  1707. // CHECK:STDOUT: import Core//prelude
  1708. // CHECK:STDOUT: import Core//prelude/...
  1709. // CHECK:STDOUT: }
  1710. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  1711. // CHECK:STDOUT: .S = %S.decl
  1712. // CHECK:STDOUT: import Cpp//...
  1713. // CHECK:STDOUT: }
  1714. // CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
  1715. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1716. // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic]
  1717. // 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, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.d2c)]
  1718. // CHECK:STDOUT: %As.impl_witness_table.5ad = impl_witness_table (%Core.import_ref.99c), @Core.IntLiteral.as.As.impl [concrete]
  1719. // CHECK:STDOUT: }
  1720. // CHECK:STDOUT:
  1721. // CHECK:STDOUT: file {
  1722. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1723. // CHECK:STDOUT: .Core = imports.%Core
  1724. // CHECK:STDOUT: .Cpp = imports.%Cpp
  1725. // CHECK:STDOUT: .F = %F.decl
  1726. // CHECK:STDOUT: }
  1727. // CHECK:STDOUT: %Core.import = import Core
  1728. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  1729. // CHECK:STDOUT: import Cpp "mixed_access_level.h"
  1730. // CHECK:STDOUT: }
  1731. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  1732. // CHECK:STDOUT: }
  1733. // CHECK:STDOUT:
  1734. // CHECK:STDOUT: class @S {
  1735. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  1736. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  1737. // CHECK:STDOUT: complete_type_witness = %complete_type
  1738. // CHECK:STDOUT:
  1739. // CHECK:STDOUT: !members:
  1740. // CHECK:STDOUT: .foo = <poisoned>
  1741. // CHECK:STDOUT: import Cpp//...
  1742. // CHECK:STDOUT: }
  1743. // CHECK:STDOUT:
  1744. // CHECK:STDOUT: fn @F() {
  1745. // CHECK:STDOUT: !entry:
  1746. // CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1747. // CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  1748. // CHECK:STDOUT: %foo.ref: <error> = name_ref foo, <error> [concrete = <error>]
  1749. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  1750. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1751. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1752. // CHECK:STDOUT: %impl.elem0: %.351 = impl_witness_access constants.%As.impl_witness.080, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.414]
  1753. // CHECK:STDOUT: %bound_method.loc14_15.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
  1754. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
  1755. // CHECK:STDOUT: %bound_method.loc14_15.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
  1756. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc14_15.2(%int_1) [concrete = constants.%int_1.5d2]
  1757. // CHECK:STDOUT: %.loc14_15.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.5d2]
  1758. // CHECK:STDOUT: %.loc14_15.2: %i32 = converted %int_1, %.loc14_15.1 [concrete = constants.%int_1.5d2]
  1759. // CHECK:STDOUT: return
  1760. // CHECK:STDOUT: }
  1761. // CHECK:STDOUT:
  1762. // CHECK:STDOUT: --- fail_import_no_viable_function.carbon
  1763. // CHECK:STDOUT:
  1764. // CHECK:STDOUT: constants {
  1765. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1766. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1767. // CHECK:STDOUT: %.c5d: type = cpp_overload_set_type @As.Convert [concrete]
  1768. // CHECK:STDOUT: %empty_struct: %.c5d = struct_value () [concrete]
  1769. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  1770. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete]
  1771. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1772. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1773. // CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [concrete]
  1774. // CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete]
  1775. // CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete]
  1776. // CHECK:STDOUT: %As.type.bbb: type = facet_type <@As, @As(%i64)> [concrete]
  1777. // CHECK:STDOUT: %As.Convert.type.d57: type = fn_type @As.Convert, @As(%i64) [concrete]
  1778. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  1779. // 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]
  1780. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.d2c: %Core.IntLiteral.as.As.impl.Convert.type.565 = struct_value () [symbolic]
  1781. // CHECK:STDOUT: %As.impl_witness.4f1: <witness> = impl_witness imports.%As.impl_witness_table.5ad, @Core.IntLiteral.as.As.impl(%int_64) [concrete]
  1782. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.9ac: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_64) [concrete]
  1783. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.fe2: %Core.IntLiteral.as.As.impl.Convert.type.9ac = struct_value () [concrete]
  1784. // CHECK:STDOUT: %As.facet: %As.type.bbb = facet_value Core.IntLiteral, (%As.impl_witness.4f1) [concrete]
  1785. // CHECK:STDOUT: %.b12: type = fn_type_with_self_type %As.Convert.type.d57, %As.facet [concrete]
  1786. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.fe2 [concrete]
  1787. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.fe2, @Core.IntLiteral.as.As.impl.Convert(%int_64) [concrete]
  1788. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
  1789. // CHECK:STDOUT: %int_1.41a: %i64 = int_value 1 [concrete]
  1790. // CHECK:STDOUT: }
  1791. // CHECK:STDOUT:
  1792. // CHECK:STDOUT: imports {
  1793. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1794. // CHECK:STDOUT: .Int = %Core.Int
  1795. // CHECK:STDOUT: .As = %Core.As
  1796. // CHECK:STDOUT: import Core//prelude
  1797. // CHECK:STDOUT: import Core//prelude/...
  1798. // CHECK:STDOUT: }
  1799. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  1800. // CHECK:STDOUT: .foo = %.a21
  1801. // CHECK:STDOUT: import Cpp//...
  1802. // CHECK:STDOUT: }
  1803. // CHECK:STDOUT: %.a21: %.c5d = cpp_overload_set_value @As.Convert [concrete = constants.%empty_struct]
  1804. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1805. // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic]
  1806. // 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, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.d2c)]
  1807. // CHECK:STDOUT: %As.impl_witness_table.5ad = impl_witness_table (%Core.import_ref.99c), @Core.IntLiteral.as.As.impl [concrete]
  1808. // CHECK:STDOUT: }
  1809. // CHECK:STDOUT:
  1810. // CHECK:STDOUT: file {
  1811. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1812. // CHECK:STDOUT: .Core = imports.%Core
  1813. // CHECK:STDOUT: .Cpp = imports.%Cpp
  1814. // CHECK:STDOUT: .F = %F.decl
  1815. // CHECK:STDOUT: }
  1816. // CHECK:STDOUT: %Core.import = import Core
  1817. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  1818. // CHECK:STDOUT: import Cpp "no_viable_function.h"
  1819. // CHECK:STDOUT: }
  1820. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  1821. // CHECK:STDOUT: }
  1822. // CHECK:STDOUT:
  1823. // CHECK:STDOUT: fn @F() {
  1824. // CHECK:STDOUT: !entry:
  1825. // CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1826. // CHECK:STDOUT: %foo.ref: %.c5d = name_ref foo, imports.%.a21 [concrete = constants.%empty_struct]
  1827. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  1828. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
  1829. // CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64]
  1830. // CHECK:STDOUT: %impl.elem0: %.b12 = impl_witness_access constants.%As.impl_witness.4f1, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.fe2]
  1831. // CHECK:STDOUT: %bound_method.loc14_13.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
  1832. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
  1833. // CHECK:STDOUT: %bound_method.loc14_13.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
  1834. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i64 = call %bound_method.loc14_13.2(%int_1) [concrete = constants.%int_1.41a]
  1835. // CHECK:STDOUT: %.loc14_13.1: %i64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.41a]
  1836. // CHECK:STDOUT: %.loc14_13.2: %i64 = converted %int_1, %.loc14_13.1 [concrete = constants.%int_1.41a]
  1837. // CHECK:STDOUT: return
  1838. // CHECK:STDOUT: }
  1839. // CHECK:STDOUT:
  1840. // CHECK:STDOUT: --- fail_import_ambiguous_overload.carbon
  1841. // CHECK:STDOUT:
  1842. // CHECK:STDOUT: constants {
  1843. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1844. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1845. // CHECK:STDOUT: %.c5d: type = cpp_overload_set_type @As.Convert [concrete]
  1846. // CHECK:STDOUT: %empty_struct: %.c5d = struct_value () [concrete]
  1847. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  1848. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete]
  1849. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1850. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1851. // CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [concrete]
  1852. // CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete]
  1853. // CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete]
  1854. // CHECK:STDOUT: %As.type.bbb: type = facet_type <@As, @As(%i64)> [concrete]
  1855. // CHECK:STDOUT: %As.Convert.type.d57: type = fn_type @As.Convert, @As(%i64) [concrete]
  1856. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  1857. // 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]
  1858. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.d2c: %Core.IntLiteral.as.As.impl.Convert.type.565 = struct_value () [symbolic]
  1859. // CHECK:STDOUT: %As.impl_witness.4f1: <witness> = impl_witness imports.%As.impl_witness_table.5ad, @Core.IntLiteral.as.As.impl(%int_64) [concrete]
  1860. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.9ac: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_64) [concrete]
  1861. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.fe2: %Core.IntLiteral.as.As.impl.Convert.type.9ac = struct_value () [concrete]
  1862. // CHECK:STDOUT: %As.facet: %As.type.bbb = facet_value Core.IntLiteral, (%As.impl_witness.4f1) [concrete]
  1863. // CHECK:STDOUT: %.b12: type = fn_type_with_self_type %As.Convert.type.d57, %As.facet [concrete]
  1864. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.fe2 [concrete]
  1865. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.fe2, @Core.IntLiteral.as.As.impl.Convert(%int_64) [concrete]
  1866. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
  1867. // CHECK:STDOUT: %int_1.41a: %i64 = int_value 1 [concrete]
  1868. // CHECK:STDOUT: }
  1869. // CHECK:STDOUT:
  1870. // CHECK:STDOUT: imports {
  1871. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1872. // CHECK:STDOUT: .Int = %Core.Int
  1873. // CHECK:STDOUT: .As = %Core.As
  1874. // CHECK:STDOUT: import Core//prelude
  1875. // CHECK:STDOUT: import Core//prelude/...
  1876. // CHECK:STDOUT: }
  1877. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  1878. // CHECK:STDOUT: .foo = %.a21
  1879. // CHECK:STDOUT: import Cpp//...
  1880. // CHECK:STDOUT: }
  1881. // CHECK:STDOUT: %.a21: %.c5d = cpp_overload_set_value @As.Convert [concrete = constants.%empty_struct]
  1882. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1883. // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic]
  1884. // 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, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.d2c)]
  1885. // CHECK:STDOUT: %As.impl_witness_table.5ad = impl_witness_table (%Core.import_ref.99c), @Core.IntLiteral.as.As.impl [concrete]
  1886. // CHECK:STDOUT: }
  1887. // CHECK:STDOUT:
  1888. // CHECK:STDOUT: file {
  1889. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1890. // CHECK:STDOUT: .Core = imports.%Core
  1891. // CHECK:STDOUT: .Cpp = imports.%Cpp
  1892. // CHECK:STDOUT: .F = %F.decl
  1893. // CHECK:STDOUT: }
  1894. // CHECK:STDOUT: %Core.import = import Core
  1895. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  1896. // CHECK:STDOUT: import Cpp "ambiguous_overload.h"
  1897. // CHECK:STDOUT: }
  1898. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  1899. // CHECK:STDOUT: }
  1900. // CHECK:STDOUT:
  1901. // CHECK:STDOUT: fn @F() {
  1902. // CHECK:STDOUT: !entry:
  1903. // CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1904. // CHECK:STDOUT: %foo.ref: %.c5d = name_ref foo, imports.%.a21 [concrete = constants.%empty_struct]
  1905. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  1906. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
  1907. // CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64]
  1908. // CHECK:STDOUT: %impl.elem0: %.b12 = impl_witness_access constants.%As.impl_witness.4f1, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.fe2]
  1909. // CHECK:STDOUT: %bound_method.loc14_13.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
  1910. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
  1911. // CHECK:STDOUT: %bound_method.loc14_13.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
  1912. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i64 = call %bound_method.loc14_13.2(%int_1) [concrete = constants.%int_1.41a]
  1913. // CHECK:STDOUT: %.loc14_13.1: %i64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.41a]
  1914. // CHECK:STDOUT: %.loc14_13.2: %i64 = converted %int_1, %.loc14_13.1 [concrete = constants.%int_1.41a]
  1915. // CHECK:STDOUT: return
  1916. // CHECK:STDOUT: }
  1917. // CHECK:STDOUT:
  1918. // CHECK:STDOUT: --- fail_import_deleted_function.carbon
  1919. // CHECK:STDOUT:
  1920. // CHECK:STDOUT: constants {
  1921. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1922. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1923. // CHECK:STDOUT: %.c5d: type = cpp_overload_set_type @As.Convert [concrete]
  1924. // CHECK:STDOUT: %empty_struct: %.c5d = struct_value () [concrete]
  1925. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  1926. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1927. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1928. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1929. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1930. // CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete]
  1931. // CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete]
  1932. // CHECK:STDOUT: %As.type.dbd: type = facet_type <@As, @As(%i32)> [concrete]
  1933. // CHECK:STDOUT: %As.Convert.type.99b: type = fn_type @As.Convert, @As(%i32) [concrete]
  1934. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  1935. // 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]
  1936. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.d2c: %Core.IntLiteral.as.As.impl.Convert.type.565 = struct_value () [symbolic]
  1937. // CHECK:STDOUT: %As.impl_witness.080: <witness> = impl_witness imports.%As.impl_witness_table.5ad, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  1938. // 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]
  1939. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.414: %Core.IntLiteral.as.As.impl.Convert.type.aaf = struct_value () [concrete]
  1940. // CHECK:STDOUT: %As.facet: %As.type.dbd = facet_value Core.IntLiteral, (%As.impl_witness.080) [concrete]
  1941. // CHECK:STDOUT: %.351: type = fn_type_with_self_type %As.Convert.type.99b, %As.facet [concrete]
  1942. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.414 [concrete]
  1943. // 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]
  1944. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
  1945. // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
  1946. // CHECK:STDOUT: }
  1947. // CHECK:STDOUT:
  1948. // CHECK:STDOUT: imports {
  1949. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1950. // CHECK:STDOUT: .Int = %Core.Int
  1951. // CHECK:STDOUT: .As = %Core.As
  1952. // CHECK:STDOUT: import Core//prelude
  1953. // CHECK:STDOUT: import Core//prelude/...
  1954. // CHECK:STDOUT: }
  1955. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  1956. // CHECK:STDOUT: .foo = %.a21
  1957. // CHECK:STDOUT: import Cpp//...
  1958. // CHECK:STDOUT: }
  1959. // CHECK:STDOUT: %.a21: %.c5d = cpp_overload_set_value @As.Convert [concrete = constants.%empty_struct]
  1960. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1961. // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic]
  1962. // 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, loc32_39, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.d2c)]
  1963. // CHECK:STDOUT: %As.impl_witness_table.5ad = impl_witness_table (%Core.import_ref.99c), @Core.IntLiteral.as.As.impl [concrete]
  1964. // CHECK:STDOUT: }
  1965. // CHECK:STDOUT:
  1966. // CHECK:STDOUT: file {
  1967. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1968. // CHECK:STDOUT: .Core = imports.%Core
  1969. // CHECK:STDOUT: .Cpp = imports.%Cpp
  1970. // CHECK:STDOUT: .F = %F.decl
  1971. // CHECK:STDOUT: }
  1972. // CHECK:STDOUT: %Core.import = import Core
  1973. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  1974. // CHECK:STDOUT: import Cpp "deleted_function.h"
  1975. // CHECK:STDOUT: }
  1976. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  1977. // CHECK:STDOUT: }
  1978. // CHECK:STDOUT:
  1979. // CHECK:STDOUT: fn @F() {
  1980. // CHECK:STDOUT: !entry:
  1981. // CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1982. // CHECK:STDOUT: %foo.ref: %.c5d = name_ref foo, imports.%.a21 [concrete = constants.%empty_struct]
  1983. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  1984. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1985. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1986. // CHECK:STDOUT: %impl.elem0: %.351 = impl_witness_access constants.%As.impl_witness.080, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.414]
  1987. // CHECK:STDOUT: %bound_method.loc14_13.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
  1988. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
  1989. // CHECK:STDOUT: %bound_method.loc14_13.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
  1990. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc14_13.2(%int_1) [concrete = constants.%int_1.5d2]
  1991. // CHECK:STDOUT: %.loc14_13.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.5d2]
  1992. // CHECK:STDOUT: %.loc14_13.2: %i32 = converted %int_1, %.loc14_13.1 [concrete = constants.%int_1.5d2]
  1993. // CHECK:STDOUT: return
  1994. // CHECK:STDOUT: }
  1995. // CHECK:STDOUT: