overloads.carbon 205 KB

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