overloads.carbon 199 KB

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