overloads.carbon 149 KB

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