overloads.carbon 173 KB

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