overloads.carbon 134 KB

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