overloads.carbon 205 KB

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