import.carbon 151 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603
  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. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/tuple/import.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/import.carbon
  10. // --- implicit.carbon
  11. package Implicit;
  12. var a_ref: (i32,) = (0,);
  13. var b_ref: (((i32,), i32), (i32, i32)) = (((0,), 1), (2, 3));
  14. class C(X:! (i32, i32)) {}
  15. fn F() -> C((1, 2));
  16. // --- implicit.impl.carbon
  17. impl package Implicit;
  18. var a: (i32,) = a_ref;
  19. var b: (((i32,), i32), (i32, i32)) = b_ref;
  20. var c: C((1, 2)) = F();
  21. // --- fail_bad_type.impl.carbon
  22. impl package Implicit;
  23. // CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+8]]:14: error: cannot initialize tuple of 2 elements from tuple with 3 elements [TupleInitElementCountMismatch]
  24. // CHECK:STDERR: var c_bad: C((1, 2, 3)) = F();
  25. // CHECK:STDERR: ^~~~~~~~~
  26. // CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE-5]]:6: in import [InImport]
  27. // CHECK:STDERR: implicit.carbon:7:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  28. // CHECK:STDERR: class C(X:! (i32, i32)) {}
  29. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
  30. // CHECK:STDERR:
  31. var c_bad: C((1, 2, 3)) = F();
  32. // --- fail_bad_value.impl.carbon
  33. impl package Implicit;
  34. // CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C(<cannot stringify inst+394>)` to `C(<cannot stringify inst+382>)` [ImplicitAsConversionFailure]
  35. // CHECK:STDERR: var c_bad: C((3, 4)) = F();
  36. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  37. // CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C(<cannot stringify inst+394>)` does not implement interface `ImplicitAs(C(<cannot stringify inst+382>))` [MissingImplInMemberAccessNote]
  38. // CHECK:STDERR: var c_bad: C((3, 4)) = F();
  39. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  40. var c_bad: C((3, 4)) = F();
  41. // CHECK:STDOUT: --- implicit.carbon
  42. // CHECK:STDOUT:
  43. // CHECK:STDOUT: constants {
  44. // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template]
  45. // CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
  46. // CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
  47. // CHECK:STDOUT: %i32: type = int_type signed, %.1 [template]
  48. // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template]
  49. // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template]
  50. // CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template]
  51. // CHECK:STDOUT: %tuple.type.3: type = tuple_type (Core.IntLiteral) [template]
  52. // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
  53. // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template]
  54. // CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template]
  55. // CHECK:STDOUT: %.22: <witness> = interface_witness (%Convert.14) [template]
  56. // CHECK:STDOUT: %.23: <bound method> = bound_method %.2, %Convert.14 [template]
  57. // CHECK:STDOUT: %.24: <specific function> = specific_function %.23, @Convert.2(%.1) [template]
  58. // CHECK:STDOUT: %.25: %i32 = int_value 0 [template]
  59. // CHECK:STDOUT: %tuple.1: %tuple.type.2 = tuple_value (%.25) [template]
  60. // CHECK:STDOUT: %tuple.type.4: type = tuple_type (%tuple.type.1, type) [template]
  61. // CHECK:STDOUT: %tuple.type.5: type = tuple_type (type, type) [template]
  62. // CHECK:STDOUT: %tuple.type.6: type = tuple_type (%tuple.type.4, %tuple.type.5) [template]
  63. // CHECK:STDOUT: %tuple.type.7: type = tuple_type (%tuple.type.2, %i32) [template]
  64. // CHECK:STDOUT: %tuple.type.8: type = tuple_type (%i32, %i32) [template]
  65. // CHECK:STDOUT: %tuple.type.9: type = tuple_type (%tuple.type.7, %tuple.type.8) [template]
  66. // CHECK:STDOUT: %.29: Core.IntLiteral = int_value 1 [template]
  67. // CHECK:STDOUT: %tuple.type.11: type = tuple_type (%tuple.type.3, Core.IntLiteral) [template]
  68. // CHECK:STDOUT: %.30: Core.IntLiteral = int_value 2 [template]
  69. // CHECK:STDOUT: %.31: Core.IntLiteral = int_value 3 [template]
  70. // CHECK:STDOUT: %tuple.type.12: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template]
  71. // CHECK:STDOUT: %tuple.type.13: type = tuple_type (%tuple.type.11, %tuple.type.12) [template]
  72. // CHECK:STDOUT: %.32: <bound method> = bound_method %.29, %Convert.14 [template]
  73. // CHECK:STDOUT: %.33: <specific function> = specific_function %.32, @Convert.2(%.1) [template]
  74. // CHECK:STDOUT: %.34: %i32 = int_value 1 [template]
  75. // CHECK:STDOUT: %tuple.2: %tuple.type.7 = tuple_value (%tuple.1, %.34) [template]
  76. // CHECK:STDOUT: %.35: <bound method> = bound_method %.30, %Convert.14 [template]
  77. // CHECK:STDOUT: %.36: <specific function> = specific_function %.35, @Convert.2(%.1) [template]
  78. // CHECK:STDOUT: %.37: %i32 = int_value 2 [template]
  79. // CHECK:STDOUT: %.38: <bound method> = bound_method %.31, %Convert.14 [template]
  80. // CHECK:STDOUT: %.39: <specific function> = specific_function %.38, @Convert.2(%.1) [template]
  81. // CHECK:STDOUT: %.40: %i32 = int_value 3 [template]
  82. // CHECK:STDOUT: %tuple.3: %tuple.type.8 = tuple_value (%.37, %.40) [template]
  83. // CHECK:STDOUT: %tuple.4: %tuple.type.9 = tuple_value (%tuple.2, %tuple.3) [template]
  84. // CHECK:STDOUT: %X: %tuple.type.8 = bind_symbolic_name X, 0 [symbolic]
  85. // CHECK:STDOUT: %X.patt: %tuple.type.8 = symbolic_binding_pattern X, 0 [symbolic]
  86. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  87. // CHECK:STDOUT: %C.1: %C.type = struct_value () [template]
  88. // CHECK:STDOUT: %C.2: type = class_type @C, @C(%X) [symbolic]
  89. // CHECK:STDOUT: %.41: type = struct_type {} [template]
  90. // CHECK:STDOUT: %.42: <witness> = complete_type_witness %.41 [template]
  91. // CHECK:STDOUT: %tuple.5: %tuple.type.8 = tuple_value (%.34, %.37) [template]
  92. // CHECK:STDOUT: %C.3: type = class_type @C, @C(%tuple.5) [template]
  93. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  94. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  95. // CHECK:STDOUT: }
  96. // CHECK:STDOUT:
  97. // CHECK:STDOUT: imports {
  98. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  99. // CHECK:STDOUT: .Int = %import_ref.1
  100. // CHECK:STDOUT: .ImplicitAs = %import_ref.2
  101. // CHECK:STDOUT: import Core//prelude
  102. // CHECK:STDOUT: import Core//prelude/...
  103. // CHECK:STDOUT: }
  104. // CHECK:STDOUT: }
  105. // CHECK:STDOUT:
  106. // CHECK:STDOUT: file {
  107. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  108. // CHECK:STDOUT: .Core = imports.%Core
  109. // CHECK:STDOUT: .a_ref = %a_ref
  110. // CHECK:STDOUT: .b_ref = %b_ref
  111. // CHECK:STDOUT: .C = %C.decl
  112. // CHECK:STDOUT: .F = %F.decl
  113. // CHECK:STDOUT: }
  114. // CHECK:STDOUT: %Core.import = import Core
  115. // CHECK:STDOUT: %.loc4_13: Core.IntLiteral = int_value 32 [template = constants.%.1]
  116. // CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_13) [template = constants.%i32]
  117. // CHECK:STDOUT: %.loc4_17.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc4)
  118. // CHECK:STDOUT: %.loc4_17.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32]
  119. // CHECK:STDOUT: %.loc4_17.3: type = converted %int.make_type_signed.loc4, %.loc4_17.2 [template = constants.%i32]
  120. // CHECK:STDOUT: %.loc4_17.4: type = converted %.loc4_17.1, constants.%tuple.type.2 [template = constants.%tuple.type.2]
  121. // CHECK:STDOUT: %a_ref.var: ref %tuple.type.2 = var a_ref
  122. // CHECK:STDOUT: %a_ref: ref %tuple.type.2 = bind_name a_ref, %a_ref.var
  123. // CHECK:STDOUT: %.loc5_15: Core.IntLiteral = int_value 32 [template = constants.%.1]
  124. // CHECK:STDOUT: %int.make_type_signed.loc5_15: init type = call constants.%Int(%.loc5_15) [template = constants.%i32]
  125. // CHECK:STDOUT: %.loc5_19: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc5_15)
  126. // CHECK:STDOUT: %.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%.1]
  127. // CHECK:STDOUT: %int.make_type_signed.loc5_22: init type = call constants.%Int(%.loc5_22) [template = constants.%i32]
  128. // CHECK:STDOUT: %.loc5_25: %tuple.type.4 = tuple_literal (%.loc5_19, %int.make_type_signed.loc5_22)
  129. // CHECK:STDOUT: %.loc5_29: Core.IntLiteral = int_value 32 [template = constants.%.1]
  130. // CHECK:STDOUT: %int.make_type_signed.loc5_29: init type = call constants.%Int(%.loc5_29) [template = constants.%i32]
  131. // CHECK:STDOUT: %.loc5_34: Core.IntLiteral = int_value 32 [template = constants.%.1]
  132. // CHECK:STDOUT: %int.make_type_signed.loc5_34: init type = call constants.%Int(%.loc5_34) [template = constants.%i32]
  133. // CHECK:STDOUT: %.loc5_37: %tuple.type.5 = tuple_literal (%int.make_type_signed.loc5_29, %int.make_type_signed.loc5_34)
  134. // CHECK:STDOUT: %.loc5_38.1: %tuple.type.6 = tuple_literal (%.loc5_25, %.loc5_37)
  135. // CHECK:STDOUT: %.loc5_38.2: type = value_of_initializer %int.make_type_signed.loc5_15 [template = constants.%i32]
  136. // CHECK:STDOUT: %.loc5_38.3: type = converted %int.make_type_signed.loc5_15, %.loc5_38.2 [template = constants.%i32]
  137. // CHECK:STDOUT: %.loc5_38.4: type = converted %.loc5_19, constants.%tuple.type.2 [template = constants.%tuple.type.2]
  138. // CHECK:STDOUT: %.loc5_38.5: type = value_of_initializer %int.make_type_signed.loc5_22 [template = constants.%i32]
  139. // CHECK:STDOUT: %.loc5_38.6: type = converted %int.make_type_signed.loc5_22, %.loc5_38.5 [template = constants.%i32]
  140. // CHECK:STDOUT: %.loc5_38.7: type = converted %.loc5_25, constants.%tuple.type.7 [template = constants.%tuple.type.7]
  141. // CHECK:STDOUT: %.loc5_38.8: type = value_of_initializer %int.make_type_signed.loc5_29 [template = constants.%i32]
  142. // CHECK:STDOUT: %.loc5_38.9: type = converted %int.make_type_signed.loc5_29, %.loc5_38.8 [template = constants.%i32]
  143. // CHECK:STDOUT: %.loc5_38.10: type = value_of_initializer %int.make_type_signed.loc5_34 [template = constants.%i32]
  144. // CHECK:STDOUT: %.loc5_38.11: type = converted %int.make_type_signed.loc5_34, %.loc5_38.10 [template = constants.%i32]
  145. // CHECK:STDOUT: %.loc5_38.12: type = converted %.loc5_37, constants.%tuple.type.8 [template = constants.%tuple.type.8]
  146. // CHECK:STDOUT: %.loc5_38.13: type = converted %.loc5_38.1, constants.%tuple.type.9 [template = constants.%tuple.type.9]
  147. // CHECK:STDOUT: %b_ref.var: ref %tuple.type.9 = var b_ref
  148. // CHECK:STDOUT: %b_ref: ref %tuple.type.9 = bind_name b_ref, %b_ref.var
  149. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] {
  150. // CHECK:STDOUT: %X.patt.loc7_9.1: %tuple.type.8 = symbolic_binding_pattern X, 0 [symbolic = %X.patt.loc7_9.2 (constants.%X.patt)]
  151. // CHECK:STDOUT: %X.param_patt: %tuple.type.8 = value_param_pattern %X.patt.loc7_9.1, runtime_param<invalid> [symbolic = %X.patt.loc7_9.2 (constants.%X.patt)]
  152. // CHECK:STDOUT: } {
  153. // CHECK:STDOUT: %.loc7_14: Core.IntLiteral = int_value 32 [template = constants.%.1]
  154. // CHECK:STDOUT: %int.make_type_signed.loc7_14: init type = call constants.%Int(%.loc7_14) [template = constants.%i32]
  155. // CHECK:STDOUT: %.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%.1]
  156. // CHECK:STDOUT: %int.make_type_signed.loc7_19: init type = call constants.%Int(%.loc7_19) [template = constants.%i32]
  157. // CHECK:STDOUT: %.loc7_22.1: %tuple.type.5 = tuple_literal (%int.make_type_signed.loc7_14, %int.make_type_signed.loc7_19)
  158. // CHECK:STDOUT: %.loc7_22.2: type = value_of_initializer %int.make_type_signed.loc7_14 [template = constants.%i32]
  159. // CHECK:STDOUT: %.loc7_22.3: type = converted %int.make_type_signed.loc7_14, %.loc7_22.2 [template = constants.%i32]
  160. // CHECK:STDOUT: %.loc7_22.4: type = value_of_initializer %int.make_type_signed.loc7_19 [template = constants.%i32]
  161. // CHECK:STDOUT: %.loc7_22.5: type = converted %int.make_type_signed.loc7_19, %.loc7_22.4 [template = constants.%i32]
  162. // CHECK:STDOUT: %.loc7_22.6: type = converted %.loc7_22.1, constants.%tuple.type.8 [template = constants.%tuple.type.8]
  163. // CHECK:STDOUT: %X.param: %tuple.type.8 = value_param runtime_param<invalid>
  164. // CHECK:STDOUT: %X.loc7_9.1: %tuple.type.8 = bind_symbolic_name X, 0, %X.param [symbolic = %X.loc7_9.2 (constants.%X)]
  165. // CHECK:STDOUT: }
  166. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
  167. // CHECK:STDOUT: %return.patt: %C.3 = return_slot_pattern
  168. // CHECK:STDOUT: %return.param_patt: %C.3 = out_param_pattern %return.patt, runtime_param0
  169. // CHECK:STDOUT: } {
  170. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.1]
  171. // CHECK:STDOUT: %.loc9_14: Core.IntLiteral = int_value 1 [template = constants.%.29]
  172. // CHECK:STDOUT: %.loc9_17: Core.IntLiteral = int_value 2 [template = constants.%.30]
  173. // CHECK:STDOUT: %.loc9_18.1: %tuple.type.12 = tuple_literal (%.loc9_14, %.loc9_17)
  174. // CHECK:STDOUT: %.loc9_18.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14]
  175. // CHECK:STDOUT: %.loc9_18.3: <bound method> = bound_method %.loc9_14, %.loc9_18.2 [template = constants.%.32]
  176. // CHECK:STDOUT: %.loc9_18.4: <specific function> = specific_function %.loc9_18.3, @Convert.2(constants.%.1) [template = constants.%.33]
  177. // CHECK:STDOUT: %int.convert_checked.loc9_18.1: init %i32 = call %.loc9_18.4(%.loc9_14) [template = constants.%.34]
  178. // CHECK:STDOUT: %.loc9_18.5: %i32 = value_of_initializer %int.convert_checked.loc9_18.1 [template = constants.%.34]
  179. // CHECK:STDOUT: %.loc9_18.6: %i32 = converted %.loc9_14, %.loc9_18.5 [template = constants.%.34]
  180. // CHECK:STDOUT: %.loc9_18.7: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14]
  181. // CHECK:STDOUT: %.loc9_18.8: <bound method> = bound_method %.loc9_17, %.loc9_18.7 [template = constants.%.35]
  182. // CHECK:STDOUT: %.loc9_18.9: <specific function> = specific_function %.loc9_18.8, @Convert.2(constants.%.1) [template = constants.%.36]
  183. // CHECK:STDOUT: %int.convert_checked.loc9_18.2: init %i32 = call %.loc9_18.9(%.loc9_17) [template = constants.%.37]
  184. // CHECK:STDOUT: %.loc9_18.10: %i32 = value_of_initializer %int.convert_checked.loc9_18.2 [template = constants.%.37]
  185. // CHECK:STDOUT: %.loc9_18.11: %i32 = converted %.loc9_17, %.loc9_18.10 [template = constants.%.37]
  186. // CHECK:STDOUT: %tuple: %tuple.type.8 = tuple_value (%.loc9_18.6, %.loc9_18.11) [template = constants.%tuple.5]
  187. // CHECK:STDOUT: %.loc9_12: %tuple.type.8 = converted %.loc9_18.1, %tuple [template = constants.%tuple.5]
  188. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple.5) [template = constants.%C.3]
  189. // CHECK:STDOUT: %return.param: ref %C.3 = out_param runtime_param0
  190. // CHECK:STDOUT: %return: ref %C.3 = return_slot %return.param
  191. // CHECK:STDOUT: }
  192. // CHECK:STDOUT: }
  193. // CHECK:STDOUT:
  194. // CHECK:STDOUT: generic class @C(%X.loc7_9.1: %tuple.type.8) {
  195. // CHECK:STDOUT: %X.loc7_9.2: %tuple.type.8 = bind_symbolic_name X, 0 [symbolic = %X.loc7_9.2 (constants.%X)]
  196. // CHECK:STDOUT: %X.patt.loc7_9.2: %tuple.type.8 = symbolic_binding_pattern X, 0 [symbolic = %X.patt.loc7_9.2 (constants.%X.patt)]
  197. // CHECK:STDOUT:
  198. // CHECK:STDOUT: !definition:
  199. // CHECK:STDOUT:
  200. // CHECK:STDOUT: class {
  201. // CHECK:STDOUT: %.loc7_26: <witness> = complete_type_witness %.41 [template = constants.%.42]
  202. // CHECK:STDOUT:
  203. // CHECK:STDOUT: !members:
  204. // CHECK:STDOUT: .Self = constants.%C.2
  205. // CHECK:STDOUT: }
  206. // CHECK:STDOUT: }
  207. // CHECK:STDOUT:
  208. // CHECK:STDOUT: fn @F() -> %C.3;
  209. // CHECK:STDOUT:
  210. // CHECK:STDOUT: fn @__global_init() {
  211. // CHECK:STDOUT: !entry:
  212. // CHECK:STDOUT: %.loc4_22: Core.IntLiteral = int_value 0 [template = constants.%.2]
  213. // CHECK:STDOUT: %.loc4_24.1: %tuple.type.3 = tuple_literal (%.loc4_22)
  214. // CHECK:STDOUT: %.loc4_24.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14]
  215. // CHECK:STDOUT: %.loc4_24.3: <bound method> = bound_method %.loc4_22, %.loc4_24.2 [template = constants.%.23]
  216. // CHECK:STDOUT: %.loc4_24.4: <specific function> = specific_function %.loc4_24.3, @Convert.2(constants.%.1) [template = constants.%.24]
  217. // CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %.loc4_24.4(%.loc4_22) [template = constants.%.25]
  218. // CHECK:STDOUT: %.loc4_24.5: init %i32 = converted %.loc4_22, %int.convert_checked.loc4 [template = constants.%.25]
  219. // CHECK:STDOUT: %.loc4_24.6: init %tuple.type.2 = tuple_init (%.loc4_24.5) to file.%a_ref.var [template = constants.%tuple.1]
  220. // CHECK:STDOUT: %.loc4_25: init %tuple.type.2 = converted %.loc4_24.1, %.loc4_24.6 [template = constants.%tuple.1]
  221. // CHECK:STDOUT: assign file.%a_ref.var, %.loc4_25
  222. // CHECK:STDOUT: %.loc5_45: Core.IntLiteral = int_value 0 [template = constants.%.2]
  223. // CHECK:STDOUT: %.loc5_47.1: %tuple.type.3 = tuple_literal (%.loc5_45)
  224. // CHECK:STDOUT: %.loc5_50: Core.IntLiteral = int_value 1 [template = constants.%.29]
  225. // CHECK:STDOUT: %.loc5_51.1: %tuple.type.11 = tuple_literal (%.loc5_47.1, %.loc5_50)
  226. // CHECK:STDOUT: %.loc5_55: Core.IntLiteral = int_value 2 [template = constants.%.30]
  227. // CHECK:STDOUT: %.loc5_58: Core.IntLiteral = int_value 3 [template = constants.%.31]
  228. // CHECK:STDOUT: %.loc5_59.1: %tuple.type.12 = tuple_literal (%.loc5_55, %.loc5_58)
  229. // CHECK:STDOUT: %.loc5_60.1: %tuple.type.13 = tuple_literal (%.loc5_51.1, %.loc5_59.1)
  230. // CHECK:STDOUT: %.loc5_47.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14]
  231. // CHECK:STDOUT: %.loc5_47.3: <bound method> = bound_method %.loc5_45, %.loc5_47.2 [template = constants.%.23]
  232. // CHECK:STDOUT: %.loc5_47.4: <specific function> = specific_function %.loc5_47.3, @Convert.2(constants.%.1) [template = constants.%.24]
  233. // CHECK:STDOUT: %int.convert_checked.loc5_47: init %i32 = call %.loc5_47.4(%.loc5_45) [template = constants.%.25]
  234. // CHECK:STDOUT: %.loc5_47.5: init %i32 = converted %.loc5_45, %int.convert_checked.loc5_47 [template = constants.%.25]
  235. // CHECK:STDOUT: %.loc5_60.2: ref %tuple.type.7 = tuple_access file.%b_ref.var, element0
  236. // CHECK:STDOUT: %.loc5_51.2: ref %tuple.type.2 = tuple_access %.loc5_60.2, element0
  237. // CHECK:STDOUT: %.loc5_47.6: init %tuple.type.2 = tuple_init (%.loc5_47.5) to %.loc5_51.2 [template = constants.%tuple.1]
  238. // CHECK:STDOUT: %.loc5_51.3: init %tuple.type.2 = converted %.loc5_47.1, %.loc5_47.6 [template = constants.%tuple.1]
  239. // CHECK:STDOUT: %.loc5_51.4: init %tuple.type.2 = initialize_from %.loc5_51.3 to %.loc5_51.2 [template = constants.%tuple.1]
  240. // CHECK:STDOUT: %.loc5_51.5: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14]
  241. // CHECK:STDOUT: %.loc5_51.6: <bound method> = bound_method %.loc5_50, %.loc5_51.5 [template = constants.%.32]
  242. // CHECK:STDOUT: %.loc5_51.7: <specific function> = specific_function %.loc5_51.6, @Convert.2(constants.%.1) [template = constants.%.33]
  243. // CHECK:STDOUT: %int.convert_checked.loc5_51: init %i32 = call %.loc5_51.7(%.loc5_50) [template = constants.%.34]
  244. // CHECK:STDOUT: %.loc5_51.8: init %i32 = converted %.loc5_50, %int.convert_checked.loc5_51 [template = constants.%.34]
  245. // CHECK:STDOUT: %.loc5_51.9: ref %i32 = tuple_access %.loc5_60.2, element1
  246. // CHECK:STDOUT: %.loc5_51.10: init %i32 = initialize_from %.loc5_51.8 to %.loc5_51.9 [template = constants.%.34]
  247. // CHECK:STDOUT: %.loc5_51.11: init %tuple.type.7 = tuple_init (%.loc5_51.4, %.loc5_51.10) to %.loc5_60.2 [template = constants.%tuple.2]
  248. // CHECK:STDOUT: %.loc5_60.3: init %tuple.type.7 = converted %.loc5_51.1, %.loc5_51.11 [template = constants.%tuple.2]
  249. // CHECK:STDOUT: %.loc5_59.2: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14]
  250. // CHECK:STDOUT: %.loc5_59.3: <bound method> = bound_method %.loc5_55, %.loc5_59.2 [template = constants.%.35]
  251. // CHECK:STDOUT: %.loc5_59.4: <specific function> = specific_function %.loc5_59.3, @Convert.2(constants.%.1) [template = constants.%.36]
  252. // CHECK:STDOUT: %int.convert_checked.loc5_59.1: init %i32 = call %.loc5_59.4(%.loc5_55) [template = constants.%.37]
  253. // CHECK:STDOUT: %.loc5_59.5: init %i32 = converted %.loc5_55, %int.convert_checked.loc5_59.1 [template = constants.%.37]
  254. // CHECK:STDOUT: %.loc5_60.4: ref %tuple.type.8 = tuple_access file.%b_ref.var, element1
  255. // CHECK:STDOUT: %.loc5_59.6: ref %i32 = tuple_access %.loc5_60.4, element0
  256. // CHECK:STDOUT: %.loc5_59.7: init %i32 = initialize_from %.loc5_59.5 to %.loc5_59.6 [template = constants.%.37]
  257. // CHECK:STDOUT: %.loc5_59.8: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14]
  258. // CHECK:STDOUT: %.loc5_59.9: <bound method> = bound_method %.loc5_58, %.loc5_59.8 [template = constants.%.38]
  259. // CHECK:STDOUT: %.loc5_59.10: <specific function> = specific_function %.loc5_59.9, @Convert.2(constants.%.1) [template = constants.%.39]
  260. // CHECK:STDOUT: %int.convert_checked.loc5_59.2: init %i32 = call %.loc5_59.10(%.loc5_58) [template = constants.%.40]
  261. // CHECK:STDOUT: %.loc5_59.11: init %i32 = converted %.loc5_58, %int.convert_checked.loc5_59.2 [template = constants.%.40]
  262. // CHECK:STDOUT: %.loc5_59.12: ref %i32 = tuple_access %.loc5_60.4, element1
  263. // CHECK:STDOUT: %.loc5_59.13: init %i32 = initialize_from %.loc5_59.11 to %.loc5_59.12 [template = constants.%.40]
  264. // CHECK:STDOUT: %.loc5_59.14: init %tuple.type.8 = tuple_init (%.loc5_59.7, %.loc5_59.13) to %.loc5_60.4 [template = constants.%tuple.3]
  265. // CHECK:STDOUT: %.loc5_60.5: init %tuple.type.8 = converted %.loc5_59.1, %.loc5_59.14 [template = constants.%tuple.3]
  266. // CHECK:STDOUT: %.loc5_60.6: init %tuple.type.9 = tuple_init (%.loc5_60.3, %.loc5_60.5) to file.%b_ref.var [template = constants.%tuple.4]
  267. // CHECK:STDOUT: %.loc5_61: init %tuple.type.9 = converted %.loc5_60.1, %.loc5_60.6 [template = constants.%tuple.4]
  268. // CHECK:STDOUT: assign file.%b_ref.var, %.loc5_61
  269. // CHECK:STDOUT: return
  270. // CHECK:STDOUT: }
  271. // CHECK:STDOUT:
  272. // CHECK:STDOUT: specific @C(constants.%X) {
  273. // CHECK:STDOUT: %X.loc7_9.2 => constants.%X
  274. // CHECK:STDOUT: %X.patt.loc7_9.2 => constants.%X
  275. // CHECK:STDOUT: }
  276. // CHECK:STDOUT:
  277. // CHECK:STDOUT: specific @C(constants.%tuple.5) {
  278. // CHECK:STDOUT: %X.loc7_9.2 => constants.%tuple.5
  279. // CHECK:STDOUT: %X.patt.loc7_9.2 => constants.%tuple.5
  280. // CHECK:STDOUT: }
  281. // CHECK:STDOUT:
  282. // CHECK:STDOUT: --- implicit.impl.carbon
  283. // CHECK:STDOUT:
  284. // CHECK:STDOUT: constants {
  285. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  286. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic]
  287. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
  288. // CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
  289. // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic]
  290. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic]
  291. // CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic]
  292. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic]
  293. // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic]
  294. // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic]
  295. // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic]
  296. // CHECK:STDOUT: %.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic]
  297. // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, imports.%import_ref.11 [symbolic]
  298. // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic]
  299. // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic]
  300. // CHECK:STDOUT: %.3: <witness> = interface_witness (%Convert.2) [symbolic]
  301. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic]
  302. // CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic]
  303. // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.3, @impl.2(%N) [symbolic]
  304. // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic]
  305. // CHECK:STDOUT: %.4: <witness> = interface_witness (%Convert.3) [symbolic]
  306. // CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template]
  307. // CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.4, @impl.3(%N) [symbolic]
  308. // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic]
  309. // CHECK:STDOUT: %.5: <witness> = interface_witness (%Convert.4) [symbolic]
  310. // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template]
  311. // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template]
  312. // CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.5, %Convert.type.5 [template]
  313. // CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.18 [template]
  314. // CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.5, @impl.4(%N) [symbolic]
  315. // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic]
  316. // CHECK:STDOUT: %.8: <witness> = interface_witness (%Convert.6) [symbolic]
  317. // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic]
  318. // CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic]
  319. // CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%iN)> [symbolic]
  320. // CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic]
  321. // CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.6, @As(%Dest) [symbolic]
  322. // CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic]
  323. // CHECK:STDOUT: %.9: type = assoc_entity_type %As.type.2, %Convert.type.7 [symbolic]
  324. // CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.28 [symbolic]
  325. // CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.7, @impl.5(%N) [symbolic]
  326. // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic]
  327. // CHECK:STDOUT: %.11: <witness> = interface_witness (%Convert.8) [symbolic]
  328. // CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%uN)> [symbolic]
  329. // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.8, @impl.6(%N) [symbolic]
  330. // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [symbolic]
  331. // CHECK:STDOUT: %.12: <witness> = interface_witness (%Convert.9) [symbolic]
  332. // CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(Core.IntLiteral)> [template]
  333. // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.9, @impl.7(%N) [symbolic]
  334. // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic]
  335. // CHECK:STDOUT: %.13: <witness> = interface_witness (%Convert.10) [symbolic]
  336. // CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.6, @As(Core.IntLiteral) [template]
  337. // CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template]
  338. // CHECK:STDOUT: %.14: type = assoc_entity_type %As.type.5, %Convert.type.11 [template]
  339. // CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.35 [template]
  340. // CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10, @impl.8(%N) [symbolic]
  341. // CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [symbolic]
  342. // CHECK:STDOUT: %.16: <witness> = interface_witness (%Convert.12) [symbolic]
  343. // CHECK:STDOUT: %.17: Core.IntLiteral = int_value 32 [template]
  344. // CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
  345. // CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
  346. // CHECK:STDOUT: %i32: type = int_type signed, %.17 [template]
  347. // CHECK:STDOUT: %tuple.type.1: type = tuple_type (type) [template]
  348. // CHECK:STDOUT: %tuple.type.2: type = tuple_type (%i32) [template]
  349. // CHECK:STDOUT: %tuple.type.3: type = tuple_type (%tuple.type.1, type) [template]
  350. // CHECK:STDOUT: %tuple.type.4: type = tuple_type (type, type) [template]
  351. // CHECK:STDOUT: %tuple.type.5: type = tuple_type (%tuple.type.3, %tuple.type.4) [template]
  352. // CHECK:STDOUT: %tuple.type.6: type = tuple_type (%tuple.type.2, %i32) [template]
  353. // CHECK:STDOUT: %tuple.type.7: type = tuple_type (%i32, %i32) [template]
  354. // CHECK:STDOUT: %tuple.type.8: type = tuple_type (%tuple.type.6, %tuple.type.7) [template]
  355. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  356. // CHECK:STDOUT: %C.1: %C.type = struct_value () [template]
  357. // CHECK:STDOUT: %X: %tuple.type.7 = bind_symbolic_name X, 0 [symbolic]
  358. // CHECK:STDOUT: %X.patt: %tuple.type.7 = symbolic_binding_pattern X, 0 [symbolic]
  359. // CHECK:STDOUT: %.23: Core.IntLiteral = int_value 1 [template]
  360. // CHECK:STDOUT: %.24: Core.IntLiteral = int_value 2 [template]
  361. // CHECK:STDOUT: %tuple.type.10: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template]
  362. // CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
  363. // CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
  364. // CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template]
  365. // CHECK:STDOUT: %.25: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.13 [template]
  366. // CHECK:STDOUT: %.26: %.25 = assoc_entity element0, imports.%import_ref.11 [template]
  367. // CHECK:STDOUT: %.27: %.1 = assoc_entity element0, imports.%import_ref.42 [symbolic]
  368. // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.17) [template]
  369. // CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template]
  370. // CHECK:STDOUT: %.28: <witness> = interface_witness (%Convert.14) [template]
  371. // CHECK:STDOUT: %.29: <bound method> = bound_method %.23, %Convert.14 [template]
  372. // CHECK:STDOUT: %.30: <specific function> = specific_function %.29, @Convert.2(%.17) [template]
  373. // CHECK:STDOUT: %.31: %i32 = int_value 1 [template]
  374. // CHECK:STDOUT: %.32: <bound method> = bound_method %.24, %Convert.14 [template]
  375. // CHECK:STDOUT: %.33: <specific function> = specific_function %.32, @Convert.2(%.17) [template]
  376. // CHECK:STDOUT: %.34: %i32 = int_value 2 [template]
  377. // CHECK:STDOUT: %tuple: %tuple.type.7 = tuple_value (%.31, %.34) [template]
  378. // CHECK:STDOUT: %C.3: type = class_type @C, @C(%tuple) [template]
  379. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  380. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  381. // CHECK:STDOUT: }
  382. // CHECK:STDOUT:
  383. // CHECK:STDOUT: imports {
  384. // CHECK:STDOUT: %import_ref.1: ref %tuple.type.2 = import_ref Implicit//default, inst+26, loaded
  385. // CHECK:STDOUT: %import_ref.2: ref %tuple.type.8 = import_ref Implicit//default, inst+406, loaded
  386. // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+489, loaded [template = constants.%C.1]
  387. // CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+523, loaded [template = constants.%F]
  388. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  389. // CHECK:STDOUT: .Int = %import_ref.39
  390. // CHECK:STDOUT: .ImplicitAs = %import_ref.41
  391. // CHECK:STDOUT: import Core//prelude
  392. // CHECK:STDOUT: import Core//prelude/...
  393. // CHECK:STDOUT: }
  394. // CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+44, unloaded
  395. // CHECK:STDOUT: %import_ref.6: @ImplicitAs.%.1 (%.1) = import_ref Implicit//default, inst+45, loaded [symbolic = @ImplicitAs.%.2 (constants.%.27)]
  396. // CHECK:STDOUT: %import_ref.7 = import_ref Implicit//default, inst+46, unloaded
  397. // CHECK:STDOUT: %import_ref.8: type = import_ref Implicit//default, inst+88, loaded [template = Core.IntLiteral]
  398. // CHECK:STDOUT: %import_ref.9: type = import_ref Implicit//default, inst+89, loaded [symbolic = @impl.1.%ImplicitAs.type (constants.%ImplicitAs.type.3)]
  399. // CHECK:STDOUT: %import_ref.10: <witness> = import_ref Implicit//default, inst+90, loaded [symbolic = @impl.1.%.1 (constants.%.3)]
  400. // CHECK:STDOUT: %import_ref.11 = import_ref Implicit//default, inst+61, unloaded
  401. // CHECK:STDOUT: %import_ref.12: type = import_ref Implicit//default, inst+118, loaded [template = Core.IntLiteral]
  402. // CHECK:STDOUT: %import_ref.13: type = import_ref Implicit//default, inst+119, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)]
  403. // CHECK:STDOUT: %import_ref.14 = import_ref Implicit//default, inst+120, unloaded
  404. // CHECK:STDOUT: %import_ref.15: type = import_ref Implicit//default, inst+147, loaded [symbolic = @impl.3.%iN (constants.%iN)]
  405. // CHECK:STDOUT: %import_ref.16: type = import_ref Implicit//default, inst+148, loaded [template = constants.%ImplicitAs.type.5]
  406. // CHECK:STDOUT: %import_ref.17 = import_ref Implicit//default, inst+149, unloaded
  407. // CHECK:STDOUT: %import_ref.19: type = import_ref Implicit//default, inst+179, loaded [symbolic = @impl.4.%uN (constants.%uN)]
  408. // CHECK:STDOUT: %import_ref.20: type = import_ref Implicit//default, inst+180, loaded [template = constants.%ImplicitAs.type.5]
  409. // CHECK:STDOUT: %import_ref.21 = import_ref Implicit//default, inst+181, unloaded
  410. // CHECK:STDOUT: %import_ref.22 = import_ref Implicit//default, inst+211, unloaded
  411. // CHECK:STDOUT: %import_ref.23 = import_ref Implicit//default, inst+212, unloaded
  412. // CHECK:STDOUT: %import_ref.24 = import_ref Implicit//default, inst+213, unloaded
  413. // CHECK:STDOUT: %import_ref.25: type = import_ref Implicit//default, inst+219, loaded [template = Core.IntLiteral]
  414. // CHECK:STDOUT: %import_ref.26: type = import_ref Implicit//default, inst+220, loaded [symbolic = @impl.5.%As.type (constants.%As.type.3)]
  415. // CHECK:STDOUT: %import_ref.27 = import_ref Implicit//default, inst+221, unloaded
  416. // CHECK:STDOUT: %import_ref.28 = import_ref Implicit//default, inst+236, unloaded
  417. // CHECK:STDOUT: %import_ref.29: type = import_ref Implicit//default, inst+273, loaded [template = Core.IntLiteral]
  418. // CHECK:STDOUT: %import_ref.30: type = import_ref Implicit//default, inst+274, loaded [symbolic = @impl.6.%As.type (constants.%As.type.4)]
  419. // CHECK:STDOUT: %import_ref.31 = import_ref Implicit//default, inst+275, unloaded
  420. // CHECK:STDOUT: %import_ref.32: type = import_ref Implicit//default, inst+302, loaded [symbolic = @impl.7.%iN (constants.%iN)]
  421. // CHECK:STDOUT: %import_ref.33: type = import_ref Implicit//default, inst+303, loaded [template = constants.%As.type.5]
  422. // CHECK:STDOUT: %import_ref.34 = import_ref Implicit//default, inst+304, unloaded
  423. // CHECK:STDOUT: %import_ref.36: type = import_ref Implicit//default, inst+334, loaded [symbolic = @impl.8.%uN (constants.%uN)]
  424. // CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+335, loaded [template = constants.%As.type.5]
  425. // CHECK:STDOUT: %import_ref.38 = import_ref Implicit//default, inst+336, unloaded
  426. // CHECK:STDOUT: %import_ref.40 = import_ref Implicit//default, inst+494, unloaded
  427. // CHECK:STDOUT: }
  428. // CHECK:STDOUT:
  429. // CHECK:STDOUT: file {
  430. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  431. // CHECK:STDOUT: .a_ref = imports.%import_ref.1
  432. // CHECK:STDOUT: .b_ref = imports.%import_ref.2
  433. // CHECK:STDOUT: .C = imports.%import_ref.3
  434. // CHECK:STDOUT: .F = imports.%import_ref.4
  435. // CHECK:STDOUT: .Core = imports.%Core
  436. // CHECK:STDOUT: .a = %a
  437. // CHECK:STDOUT: .b = %b
  438. // CHECK:STDOUT: .c = %c
  439. // CHECK:STDOUT: }
  440. // CHECK:STDOUT: %Implicit.import = import Implicit
  441. // CHECK:STDOUT: %default.import = import <invalid>
  442. // CHECK:STDOUT: %Core.import = import Core
  443. // CHECK:STDOUT: %.loc4_9: Core.IntLiteral = int_value 32 [template = constants.%.17]
  444. // CHECK:STDOUT: %int.make_type_signed.loc4: init type = call constants.%Int(%.loc4_9) [template = constants.%i32]
  445. // CHECK:STDOUT: %.loc4_13.1: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc4)
  446. // CHECK:STDOUT: %.loc4_13.2: type = value_of_initializer %int.make_type_signed.loc4 [template = constants.%i32]
  447. // CHECK:STDOUT: %.loc4_13.3: type = converted %int.make_type_signed.loc4, %.loc4_13.2 [template = constants.%i32]
  448. // CHECK:STDOUT: %.loc4_13.4: type = converted %.loc4_13.1, constants.%tuple.type.2 [template = constants.%tuple.type.2]
  449. // CHECK:STDOUT: %a.var: ref %tuple.type.2 = var a
  450. // CHECK:STDOUT: %a: ref %tuple.type.2 = bind_name a, %a.var
  451. // CHECK:STDOUT: %.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%.17]
  452. // CHECK:STDOUT: %int.make_type_signed.loc5_11: init type = call constants.%Int(%.loc5_11) [template = constants.%i32]
  453. // CHECK:STDOUT: %.loc5_15: %tuple.type.1 = tuple_literal (%int.make_type_signed.loc5_11)
  454. // CHECK:STDOUT: %.loc5_18: Core.IntLiteral = int_value 32 [template = constants.%.17]
  455. // CHECK:STDOUT: %int.make_type_signed.loc5_18: init type = call constants.%Int(%.loc5_18) [template = constants.%i32]
  456. // CHECK:STDOUT: %.loc5_21: %tuple.type.3 = tuple_literal (%.loc5_15, %int.make_type_signed.loc5_18)
  457. // CHECK:STDOUT: %.loc5_25: Core.IntLiteral = int_value 32 [template = constants.%.17]
  458. // CHECK:STDOUT: %int.make_type_signed.loc5_25: init type = call constants.%Int(%.loc5_25) [template = constants.%i32]
  459. // CHECK:STDOUT: %.loc5_30: Core.IntLiteral = int_value 32 [template = constants.%.17]
  460. // CHECK:STDOUT: %int.make_type_signed.loc5_30: init type = call constants.%Int(%.loc5_30) [template = constants.%i32]
  461. // CHECK:STDOUT: %.loc5_33: %tuple.type.4 = tuple_literal (%int.make_type_signed.loc5_25, %int.make_type_signed.loc5_30)
  462. // CHECK:STDOUT: %.loc5_34.1: %tuple.type.5 = tuple_literal (%.loc5_21, %.loc5_33)
  463. // CHECK:STDOUT: %.loc5_34.2: type = value_of_initializer %int.make_type_signed.loc5_11 [template = constants.%i32]
  464. // CHECK:STDOUT: %.loc5_34.3: type = converted %int.make_type_signed.loc5_11, %.loc5_34.2 [template = constants.%i32]
  465. // CHECK:STDOUT: %.loc5_34.4: type = converted %.loc5_15, constants.%tuple.type.2 [template = constants.%tuple.type.2]
  466. // CHECK:STDOUT: %.loc5_34.5: type = value_of_initializer %int.make_type_signed.loc5_18 [template = constants.%i32]
  467. // CHECK:STDOUT: %.loc5_34.6: type = converted %int.make_type_signed.loc5_18, %.loc5_34.5 [template = constants.%i32]
  468. // CHECK:STDOUT: %.loc5_34.7: type = converted %.loc5_21, constants.%tuple.type.6 [template = constants.%tuple.type.6]
  469. // CHECK:STDOUT: %.loc5_34.8: type = value_of_initializer %int.make_type_signed.loc5_25 [template = constants.%i32]
  470. // CHECK:STDOUT: %.loc5_34.9: type = converted %int.make_type_signed.loc5_25, %.loc5_34.8 [template = constants.%i32]
  471. // CHECK:STDOUT: %.loc5_34.10: type = value_of_initializer %int.make_type_signed.loc5_30 [template = constants.%i32]
  472. // CHECK:STDOUT: %.loc5_34.11: type = converted %int.make_type_signed.loc5_30, %.loc5_34.10 [template = constants.%i32]
  473. // CHECK:STDOUT: %.loc5_34.12: type = converted %.loc5_33, constants.%tuple.type.7 [template = constants.%tuple.type.7]
  474. // CHECK:STDOUT: %.loc5_34.13: type = converted %.loc5_34.1, constants.%tuple.type.8 [template = constants.%tuple.type.8]
  475. // CHECK:STDOUT: %b.var: ref %tuple.type.8 = var b
  476. // CHECK:STDOUT: %b: ref %tuple.type.8 = bind_name b, %b.var
  477. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1]
  478. // CHECK:STDOUT: %.loc6_11: Core.IntLiteral = int_value 1 [template = constants.%.23]
  479. // CHECK:STDOUT: %.loc6_14: Core.IntLiteral = int_value 2 [template = constants.%.24]
  480. // CHECK:STDOUT: %.loc6_15.1: %tuple.type.10 = tuple_literal (%.loc6_11, %.loc6_14)
  481. // CHECK:STDOUT: %.loc6_15.2: %Convert.type.13 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14]
  482. // CHECK:STDOUT: %.loc6_15.3: <bound method> = bound_method %.loc6_11, %.loc6_15.2 [template = constants.%.29]
  483. // CHECK:STDOUT: %.loc6_15.4: <specific function> = specific_function %.loc6_15.3, @Convert.2(constants.%.17) [template = constants.%.30]
  484. // CHECK:STDOUT: %int.convert_checked.loc6_15.1: init %i32 = call %.loc6_15.4(%.loc6_11) [template = constants.%.31]
  485. // CHECK:STDOUT: %.loc6_15.5: %i32 = value_of_initializer %int.convert_checked.loc6_15.1 [template = constants.%.31]
  486. // CHECK:STDOUT: %.loc6_15.6: %i32 = converted %.loc6_11, %.loc6_15.5 [template = constants.%.31]
  487. // CHECK:STDOUT: %.loc6_15.7: %Convert.type.13 = interface_witness_access constants.%.28, element0 [template = constants.%Convert.14]
  488. // CHECK:STDOUT: %.loc6_15.8: <bound method> = bound_method %.loc6_14, %.loc6_15.7 [template = constants.%.32]
  489. // CHECK:STDOUT: %.loc6_15.9: <specific function> = specific_function %.loc6_15.8, @Convert.2(constants.%.17) [template = constants.%.33]
  490. // CHECK:STDOUT: %int.convert_checked.loc6_15.2: init %i32 = call %.loc6_15.9(%.loc6_14) [template = constants.%.34]
  491. // CHECK:STDOUT: %.loc6_15.10: %i32 = value_of_initializer %int.convert_checked.loc6_15.2 [template = constants.%.34]
  492. // CHECK:STDOUT: %.loc6_15.11: %i32 = converted %.loc6_14, %.loc6_15.10 [template = constants.%.34]
  493. // CHECK:STDOUT: %tuple: %tuple.type.7 = tuple_value (%.loc6_15.6, %.loc6_15.11) [template = constants.%tuple]
  494. // CHECK:STDOUT: %.loc6_9: %tuple.type.7 = converted %.loc6_15.1, %tuple [template = constants.%tuple]
  495. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple) [template = constants.%C.3]
  496. // CHECK:STDOUT: %c.var: ref %C.3 = var c
  497. // CHECK:STDOUT: %c: ref %C.3 = bind_name c, %c.var
  498. // CHECK:STDOUT: }
  499. // CHECK:STDOUT:
  500. // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) {
  501. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  502. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)]
  503. // CHECK:STDOUT:
  504. // CHECK:STDOUT: !definition:
  505. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
  506. // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
  507. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)]
  508. // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)]
  509. // CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.1)]
  510. // CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.1) = assoc_entity element0, imports.%import_ref.11 [symbolic = %.2 (constants.%.2)]
  511. // CHECK:STDOUT:
  512. // CHECK:STDOUT: interface {
  513. // CHECK:STDOUT: !members:
  514. // CHECK:STDOUT: .Self = imports.%import_ref.5
  515. // CHECK:STDOUT: .Convert = imports.%import_ref.6
  516. // CHECK:STDOUT: witness = (imports.%import_ref.7)
  517. // CHECK:STDOUT: }
  518. // CHECK:STDOUT: }
  519. // CHECK:STDOUT:
  520. // CHECK:STDOUT: generic interface @As(constants.%Dest: type) {
  521. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  522. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)]
  523. // CHECK:STDOUT:
  524. // CHECK:STDOUT: !definition:
  525. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)]
  526. // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)]
  527. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.7)]
  528. // CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)]
  529. // CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.7) [symbolic = %.1 (constants.%.9)]
  530. // CHECK:STDOUT: %.2: @As.%.1 (%.9) = assoc_entity element0, imports.%import_ref.28 [symbolic = %.2 (constants.%.10)]
  531. // CHECK:STDOUT:
  532. // CHECK:STDOUT: interface {
  533. // CHECK:STDOUT: !members:
  534. // CHECK:STDOUT: .Self = imports.%import_ref.22
  535. // CHECK:STDOUT: .Convert = imports.%import_ref.23
  536. // CHECK:STDOUT: witness = (imports.%import_ref.24)
  537. // CHECK:STDOUT: }
  538. // CHECK:STDOUT: }
  539. // CHECK:STDOUT:
  540. // CHECK:STDOUT: generic impl @impl.1(constants.%N: Core.IntLiteral) {
  541. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  542. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  543. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  544. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3)]
  545. // CHECK:STDOUT:
  546. // CHECK:STDOUT: !definition:
  547. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.1(%N) [symbolic = %Convert.type (constants.%Convert.type.2)]
  548. // CHECK:STDOUT: %Convert: @impl.1.%Convert.type (%Convert.type.2) = struct_value () [symbolic = %Convert (constants.%Convert.2)]
  549. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.3)]
  550. // CHECK:STDOUT:
  551. // CHECK:STDOUT: impl: imports.%import_ref.8 as imports.%import_ref.9 {
  552. // CHECK:STDOUT: !members:
  553. // CHECK:STDOUT: witness = imports.%import_ref.10
  554. // CHECK:STDOUT: }
  555. // CHECK:STDOUT: }
  556. // CHECK:STDOUT:
  557. // CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) {
  558. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  559. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  560. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  561. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)]
  562. // CHECK:STDOUT:
  563. // CHECK:STDOUT: !definition:
  564. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)]
  565. // CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)]
  566. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.4)]
  567. // CHECK:STDOUT:
  568. // CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 {
  569. // CHECK:STDOUT: !members:
  570. // CHECK:STDOUT: witness = imports.%import_ref.14
  571. // CHECK:STDOUT: }
  572. // CHECK:STDOUT: }
  573. // CHECK:STDOUT:
  574. // CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) {
  575. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  576. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  577. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  578. // CHECK:STDOUT:
  579. // CHECK:STDOUT: !definition:
  580. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)]
  581. // CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)]
  582. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.5)]
  583. // CHECK:STDOUT:
  584. // CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 {
  585. // CHECK:STDOUT: !members:
  586. // CHECK:STDOUT: witness = imports.%import_ref.17
  587. // CHECK:STDOUT: }
  588. // CHECK:STDOUT: }
  589. // CHECK:STDOUT:
  590. // CHECK:STDOUT: generic impl @impl.4(constants.%N: Core.IntLiteral) {
  591. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  592. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  593. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  594. // CHECK:STDOUT:
  595. // CHECK:STDOUT: !definition:
  596. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.4(%N) [symbolic = %Convert.type (constants.%Convert.type.6)]
  597. // CHECK:STDOUT: %Convert: @impl.4.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)]
  598. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.8)]
  599. // CHECK:STDOUT:
  600. // CHECK:STDOUT: impl: imports.%import_ref.19 as imports.%import_ref.20 {
  601. // CHECK:STDOUT: !members:
  602. // CHECK:STDOUT: witness = imports.%import_ref.21
  603. // CHECK:STDOUT: }
  604. // CHECK:STDOUT: }
  605. // CHECK:STDOUT:
  606. // CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) {
  607. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  608. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  609. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  610. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%iN)> [symbolic = %As.type (constants.%As.type.3)]
  611. // CHECK:STDOUT:
  612. // CHECK:STDOUT: !definition:
  613. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.8)]
  614. // CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)]
  615. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.11)]
  616. // CHECK:STDOUT:
  617. // CHECK:STDOUT: impl: imports.%import_ref.25 as imports.%import_ref.26 {
  618. // CHECK:STDOUT: !members:
  619. // CHECK:STDOUT: witness = imports.%import_ref.27
  620. // CHECK:STDOUT: }
  621. // CHECK:STDOUT: }
  622. // CHECK:STDOUT:
  623. // CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) {
  624. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  625. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  626. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  627. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%uN)> [symbolic = %As.type (constants.%As.type.4)]
  628. // CHECK:STDOUT:
  629. // CHECK:STDOUT: !definition:
  630. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.9)]
  631. // CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.9) = struct_value () [symbolic = %Convert (constants.%Convert.9)]
  632. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.12)]
  633. // CHECK:STDOUT:
  634. // CHECK:STDOUT: impl: imports.%import_ref.29 as imports.%import_ref.30 {
  635. // CHECK:STDOUT: !members:
  636. // CHECK:STDOUT: witness = imports.%import_ref.31
  637. // CHECK:STDOUT: }
  638. // CHECK:STDOUT: }
  639. // CHECK:STDOUT:
  640. // CHECK:STDOUT: generic impl @impl.7(constants.%N: Core.IntLiteral) {
  641. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  642. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  643. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  644. // CHECK:STDOUT:
  645. // CHECK:STDOUT: !definition:
  646. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.7(%N) [symbolic = %Convert.type (constants.%Convert.type.10)]
  647. // CHECK:STDOUT: %Convert: @impl.7.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)]
  648. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.13)]
  649. // CHECK:STDOUT:
  650. // CHECK:STDOUT: impl: imports.%import_ref.32 as imports.%import_ref.33 {
  651. // CHECK:STDOUT: !members:
  652. // CHECK:STDOUT: witness = imports.%import_ref.34
  653. // CHECK:STDOUT: }
  654. // CHECK:STDOUT: }
  655. // CHECK:STDOUT:
  656. // CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) {
  657. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  658. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  659. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  660. // CHECK:STDOUT:
  661. // CHECK:STDOUT: !definition:
  662. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.12)]
  663. // CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.12) = struct_value () [symbolic = %Convert (constants.%Convert.12)]
  664. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.16)]
  665. // CHECK:STDOUT:
  666. // CHECK:STDOUT: impl: imports.%import_ref.36 as imports.%import_ref.37 {
  667. // CHECK:STDOUT: !members:
  668. // CHECK:STDOUT: witness = imports.%import_ref.38
  669. // CHECK:STDOUT: }
  670. // CHECK:STDOUT: }
  671. // CHECK:STDOUT:
  672. // CHECK:STDOUT: generic class @C(constants.%X: %tuple.type.7) {
  673. // CHECK:STDOUT: %X: %tuple.type.7 = bind_symbolic_name X, 0 [symbolic = %X (constants.%X)]
  674. // CHECK:STDOUT: %X.patt: %tuple.type.7 = symbolic_binding_pattern X, 0 [symbolic = %X.patt (constants.%X.patt)]
  675. // CHECK:STDOUT:
  676. // CHECK:STDOUT: !definition:
  677. // CHECK:STDOUT:
  678. // CHECK:STDOUT: class {
  679. // CHECK:STDOUT: !members:
  680. // CHECK:STDOUT: .Self = imports.%import_ref.40
  681. // CHECK:STDOUT: }
  682. // CHECK:STDOUT: }
  683. // CHECK:STDOUT:
  684. // CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) {
  685. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  686. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
  687. // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
  688. // CHECK:STDOUT:
  689. // CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest);
  690. // CHECK:STDOUT: }
  691. // CHECK:STDOUT:
  692. // CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) {
  693. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  694. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  695. // CHECK:STDOUT:
  696. // CHECK:STDOUT: !definition:
  697. // CHECK:STDOUT:
  698. // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%iN (%iN) = "int.convert_checked";
  699. // CHECK:STDOUT: }
  700. // CHECK:STDOUT:
  701. // CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) {
  702. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  703. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  704. // CHECK:STDOUT:
  705. // CHECK:STDOUT: !definition:
  706. // CHECK:STDOUT:
  707. // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%uN (%uN) = "int.convert_checked";
  708. // CHECK:STDOUT: }
  709. // CHECK:STDOUT:
  710. // CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) {
  711. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  712. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  713. // CHECK:STDOUT:
  714. // CHECK:STDOUT: !definition:
  715. // CHECK:STDOUT:
  716. // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked";
  717. // CHECK:STDOUT: }
  718. // CHECK:STDOUT:
  719. // CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) {
  720. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  721. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  722. // CHECK:STDOUT:
  723. // CHECK:STDOUT: !definition:
  724. // CHECK:STDOUT:
  725. // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked";
  726. // CHECK:STDOUT: }
  727. // CHECK:STDOUT:
  728. // CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) {
  729. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  730. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)]
  731. // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)]
  732. // CHECK:STDOUT:
  733. // CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest);
  734. // CHECK:STDOUT: }
  735. // CHECK:STDOUT:
  736. // CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) {
  737. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  738. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  739. // CHECK:STDOUT:
  740. // CHECK:STDOUT: !definition:
  741. // CHECK:STDOUT:
  742. // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%iN (%iN) = "int.convert_checked";
  743. // CHECK:STDOUT: }
  744. // CHECK:STDOUT:
  745. // CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) {
  746. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  747. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  748. // CHECK:STDOUT:
  749. // CHECK:STDOUT: !definition:
  750. // CHECK:STDOUT:
  751. // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%uN (%uN) = "int.convert_checked";
  752. // CHECK:STDOUT: }
  753. // CHECK:STDOUT:
  754. // CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) {
  755. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  756. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  757. // CHECK:STDOUT:
  758. // CHECK:STDOUT: !definition:
  759. // CHECK:STDOUT:
  760. // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked";
  761. // CHECK:STDOUT: }
  762. // CHECK:STDOUT:
  763. // CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) {
  764. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  765. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  766. // CHECK:STDOUT:
  767. // CHECK:STDOUT: !definition:
  768. // CHECK:STDOUT:
  769. // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked";
  770. // CHECK:STDOUT: }
  771. // CHECK:STDOUT:
  772. // CHECK:STDOUT: fn @F() -> %C.3;
  773. // CHECK:STDOUT:
  774. // CHECK:STDOUT: fn @__global_init() {
  775. // CHECK:STDOUT: !entry:
  776. // CHECK:STDOUT: %a_ref.ref: ref %tuple.type.2 = name_ref a_ref, imports.%import_ref.1
  777. // CHECK:STDOUT: %.loc4_17.1: ref %i32 = tuple_access %a_ref.ref, element0
  778. // CHECK:STDOUT: %.loc4_17.2: %i32 = bind_value %.loc4_17.1
  779. // CHECK:STDOUT: %.loc4_17.3: init %tuple.type.2 = tuple_init (%.loc4_17.2) to file.%a.var
  780. // CHECK:STDOUT: %.loc4_22: init %tuple.type.2 = converted %a_ref.ref, %.loc4_17.3
  781. // CHECK:STDOUT: assign file.%a.var, %.loc4_22
  782. // CHECK:STDOUT: %b_ref.ref: ref %tuple.type.8 = name_ref b_ref, imports.%import_ref.2
  783. // CHECK:STDOUT: %.loc5_38.1: ref %tuple.type.6 = tuple_access %b_ref.ref, element0
  784. // CHECK:STDOUT: %.loc5_38.2: ref %tuple.type.2 = tuple_access %.loc5_38.1, element0
  785. // CHECK:STDOUT: %.loc5_38.3: ref %i32 = tuple_access %.loc5_38.2, element0
  786. // CHECK:STDOUT: %.loc5_38.4: %i32 = bind_value %.loc5_38.3
  787. // CHECK:STDOUT: %.loc5_38.5: ref %tuple.type.6 = tuple_access file.%b.var, element0
  788. // CHECK:STDOUT: %.loc5_38.6: ref %tuple.type.2 = tuple_access %.loc5_38.5, element0
  789. // CHECK:STDOUT: %.loc5_38.7: init %tuple.type.2 = tuple_init (%.loc5_38.4) to %.loc5_38.6
  790. // CHECK:STDOUT: %.loc5_38.8: init %tuple.type.2 = converted %.loc5_38.2, %.loc5_38.7
  791. // CHECK:STDOUT: %.loc5_38.9: init %tuple.type.2 = initialize_from %.loc5_38.8 to %.loc5_38.6
  792. // CHECK:STDOUT: %.loc5_38.10: ref %i32 = tuple_access %.loc5_38.1, element1
  793. // CHECK:STDOUT: %.loc5_38.11: %i32 = bind_value %.loc5_38.10
  794. // CHECK:STDOUT: %.loc5_38.12: ref %i32 = tuple_access %.loc5_38.5, element1
  795. // CHECK:STDOUT: %.loc5_38.13: init %i32 = initialize_from %.loc5_38.11 to %.loc5_38.12
  796. // CHECK:STDOUT: %.loc5_38.14: init %tuple.type.6 = tuple_init (%.loc5_38.9, %.loc5_38.13) to %.loc5_38.5
  797. // CHECK:STDOUT: %.loc5_38.15: init %tuple.type.6 = converted %.loc5_38.1, %.loc5_38.14
  798. // CHECK:STDOUT: %.loc5_38.16: ref %tuple.type.7 = tuple_access %b_ref.ref, element1
  799. // CHECK:STDOUT: %.loc5_38.17: ref %i32 = tuple_access %.loc5_38.16, element0
  800. // CHECK:STDOUT: %.loc5_38.18: %i32 = bind_value %.loc5_38.17
  801. // CHECK:STDOUT: %.loc5_38.19: ref %tuple.type.7 = tuple_access file.%b.var, element1
  802. // CHECK:STDOUT: %.loc5_38.20: ref %i32 = tuple_access %.loc5_38.19, element0
  803. // CHECK:STDOUT: %.loc5_38.21: init %i32 = initialize_from %.loc5_38.18 to %.loc5_38.20
  804. // CHECK:STDOUT: %.loc5_38.22: ref %i32 = tuple_access %.loc5_38.16, element1
  805. // CHECK:STDOUT: %.loc5_38.23: %i32 = bind_value %.loc5_38.22
  806. // CHECK:STDOUT: %.loc5_38.24: ref %i32 = tuple_access %.loc5_38.19, element1
  807. // CHECK:STDOUT: %.loc5_38.25: init %i32 = initialize_from %.loc5_38.23 to %.loc5_38.24
  808. // CHECK:STDOUT: %.loc5_38.26: init %tuple.type.7 = tuple_init (%.loc5_38.21, %.loc5_38.25) to %.loc5_38.19
  809. // CHECK:STDOUT: %.loc5_38.27: init %tuple.type.7 = converted %.loc5_38.16, %.loc5_38.26
  810. // CHECK:STDOUT: %.loc5_38.28: init %tuple.type.8 = tuple_init (%.loc5_38.15, %.loc5_38.27) to file.%b.var
  811. // CHECK:STDOUT: %.loc5_43: init %tuple.type.8 = converted %b_ref.ref, %.loc5_38.28
  812. // CHECK:STDOUT: assign file.%b.var, %.loc5_43
  813. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F]
  814. // CHECK:STDOUT: %.loc6: ref %C.3 = splice_block file.%c.var {}
  815. // CHECK:STDOUT: %F.call: init %C.3 = call %F.ref() to %.loc6
  816. // CHECK:STDOUT: assign file.%c.var, %F.call
  817. // CHECK:STDOUT: return
  818. // CHECK:STDOUT: }
  819. // CHECK:STDOUT:
  820. // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
  821. // CHECK:STDOUT: %Dest => constants.%Dest
  822. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  823. // CHECK:STDOUT: }
  824. // CHECK:STDOUT:
  825. // CHECK:STDOUT: specific @ImplicitAs(constants.%iN) {
  826. // CHECK:STDOUT: %Dest => constants.%iN
  827. // CHECK:STDOUT: %Dest.patt => constants.%iN
  828. // CHECK:STDOUT: }
  829. // CHECK:STDOUT:
  830. // CHECK:STDOUT: specific @ImplicitAs(%Dest) {
  831. // CHECK:STDOUT: %Dest => constants.%Dest
  832. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  833. // CHECK:STDOUT: }
  834. // CHECK:STDOUT:
  835. // CHECK:STDOUT: specific @ImplicitAs(@impl.1.%iN) {
  836. // CHECK:STDOUT: %Dest => constants.%iN
  837. // CHECK:STDOUT: %Dest.patt => constants.%iN
  838. // CHECK:STDOUT: }
  839. // CHECK:STDOUT:
  840. // CHECK:STDOUT: specific @impl.1(constants.%N) {
  841. // CHECK:STDOUT: %N => constants.%N
  842. // CHECK:STDOUT: %N.patt => constants.%N
  843. // CHECK:STDOUT: %iN => constants.%iN
  844. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3
  845. // CHECK:STDOUT: }
  846. // CHECK:STDOUT:
  847. // CHECK:STDOUT: specific @impl.1(%N) {
  848. // CHECK:STDOUT: %N => constants.%N
  849. // CHECK:STDOUT: %N.patt => constants.%N
  850. // CHECK:STDOUT: %iN => constants.%iN
  851. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3
  852. // CHECK:STDOUT: }
  853. // CHECK:STDOUT:
  854. // CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) {
  855. // CHECK:STDOUT: %Dest => constants.%Dest
  856. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  857. // CHECK:STDOUT: }
  858. // CHECK:STDOUT:
  859. // CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) {
  860. // CHECK:STDOUT: %Dest => constants.%Dest
  861. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2
  862. // CHECK:STDOUT: %Self => constants.%Self.1
  863. // CHECK:STDOUT: }
  864. // CHECK:STDOUT:
  865. // CHECK:STDOUT: specific @Convert.2(constants.%N) {
  866. // CHECK:STDOUT: %N => constants.%N
  867. // CHECK:STDOUT: %iN => constants.%iN
  868. // CHECK:STDOUT: }
  869. // CHECK:STDOUT:
  870. // CHECK:STDOUT: specific @ImplicitAs(constants.%uN) {
  871. // CHECK:STDOUT: %Dest => constants.%uN
  872. // CHECK:STDOUT: %Dest.patt => constants.%uN
  873. // CHECK:STDOUT: }
  874. // CHECK:STDOUT:
  875. // CHECK:STDOUT: specific @ImplicitAs(@impl.2.%uN) {
  876. // CHECK:STDOUT: %Dest => constants.%uN
  877. // CHECK:STDOUT: %Dest.patt => constants.%uN
  878. // CHECK:STDOUT: }
  879. // CHECK:STDOUT:
  880. // CHECK:STDOUT: specific @impl.2(constants.%N) {
  881. // CHECK:STDOUT: %N => constants.%N
  882. // CHECK:STDOUT: %N.patt => constants.%N
  883. // CHECK:STDOUT: %uN => constants.%uN
  884. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4
  885. // CHECK:STDOUT: }
  886. // CHECK:STDOUT:
  887. // CHECK:STDOUT: specific @impl.2(%N) {
  888. // CHECK:STDOUT: %N => constants.%N
  889. // CHECK:STDOUT: %N.patt => constants.%N
  890. // CHECK:STDOUT: %uN => constants.%uN
  891. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4
  892. // CHECK:STDOUT: }
  893. // CHECK:STDOUT:
  894. // CHECK:STDOUT: specific @Convert.3(constants.%N) {
  895. // CHECK:STDOUT: %N => constants.%N
  896. // CHECK:STDOUT: %uN => constants.%uN
  897. // CHECK:STDOUT: }
  898. // CHECK:STDOUT:
  899. // CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) {
  900. // CHECK:STDOUT: %Dest => Core.IntLiteral
  901. // CHECK:STDOUT: %Dest.patt => Core.IntLiteral
  902. // CHECK:STDOUT:
  903. // CHECK:STDOUT: !definition:
  904. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5
  905. // CHECK:STDOUT: %Self => constants.%Self.2
  906. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5
  907. // CHECK:STDOUT: %Convert => constants.%Convert.5
  908. // CHECK:STDOUT: %.1 => constants.%.6
  909. // CHECK:STDOUT: %.2 => constants.%.7
  910. // CHECK:STDOUT: }
  911. // CHECK:STDOUT:
  912. // CHECK:STDOUT: specific @impl.3(constants.%N) {
  913. // CHECK:STDOUT: %N => constants.%N
  914. // CHECK:STDOUT: %N.patt => constants.%N
  915. // CHECK:STDOUT: %iN => constants.%iN
  916. // CHECK:STDOUT: }
  917. // CHECK:STDOUT:
  918. // CHECK:STDOUT: specific @impl.3(%N) {
  919. // CHECK:STDOUT: %N => constants.%N
  920. // CHECK:STDOUT: %N.patt => constants.%N
  921. // CHECK:STDOUT: %iN => constants.%iN
  922. // CHECK:STDOUT: }
  923. // CHECK:STDOUT:
  924. // CHECK:STDOUT: specific @Convert.4(constants.%N) {
  925. // CHECK:STDOUT: %N => constants.%N
  926. // CHECK:STDOUT: %iN => constants.%iN
  927. // CHECK:STDOUT: }
  928. // CHECK:STDOUT:
  929. // CHECK:STDOUT: specific @impl.4(constants.%N) {
  930. // CHECK:STDOUT: %N => constants.%N
  931. // CHECK:STDOUT: %N.patt => constants.%N
  932. // CHECK:STDOUT: %uN => constants.%uN
  933. // CHECK:STDOUT: }
  934. // CHECK:STDOUT:
  935. // CHECK:STDOUT: specific @impl.4(%N) {
  936. // CHECK:STDOUT: %N => constants.%N
  937. // CHECK:STDOUT: %N.patt => constants.%N
  938. // CHECK:STDOUT: %uN => constants.%uN
  939. // CHECK:STDOUT: }
  940. // CHECK:STDOUT:
  941. // CHECK:STDOUT: specific @Convert.5(constants.%N) {
  942. // CHECK:STDOUT: %N => constants.%N
  943. // CHECK:STDOUT: %uN => constants.%uN
  944. // CHECK:STDOUT: }
  945. // CHECK:STDOUT:
  946. // CHECK:STDOUT: specific @As(constants.%Dest) {
  947. // CHECK:STDOUT: %Dest => constants.%Dest
  948. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  949. // CHECK:STDOUT: }
  950. // CHECK:STDOUT:
  951. // CHECK:STDOUT: specific @As(constants.%iN) {
  952. // CHECK:STDOUT: %Dest => constants.%iN
  953. // CHECK:STDOUT: %Dest.patt => constants.%iN
  954. // CHECK:STDOUT: }
  955. // CHECK:STDOUT:
  956. // CHECK:STDOUT: specific @As(%Dest) {
  957. // CHECK:STDOUT: %Dest => constants.%Dest
  958. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  959. // CHECK:STDOUT: }
  960. // CHECK:STDOUT:
  961. // CHECK:STDOUT: specific @As(@impl.5.%iN) {
  962. // CHECK:STDOUT: %Dest => constants.%iN
  963. // CHECK:STDOUT: %Dest.patt => constants.%iN
  964. // CHECK:STDOUT: }
  965. // CHECK:STDOUT:
  966. // CHECK:STDOUT: specific @impl.5(constants.%N) {
  967. // CHECK:STDOUT: %N => constants.%N
  968. // CHECK:STDOUT: %N.patt => constants.%N
  969. // CHECK:STDOUT: %iN => constants.%iN
  970. // CHECK:STDOUT: %As.type => constants.%As.type.3
  971. // CHECK:STDOUT: }
  972. // CHECK:STDOUT:
  973. // CHECK:STDOUT: specific @impl.5(%N) {
  974. // CHECK:STDOUT: %N => constants.%N
  975. // CHECK:STDOUT: %N.patt => constants.%N
  976. // CHECK:STDOUT: %iN => constants.%iN
  977. // CHECK:STDOUT: %As.type => constants.%As.type.3
  978. // CHECK:STDOUT: }
  979. // CHECK:STDOUT:
  980. // CHECK:STDOUT: specific @As(@Convert.6.%Dest) {
  981. // CHECK:STDOUT: %Dest => constants.%Dest
  982. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  983. // CHECK:STDOUT: }
  984. // CHECK:STDOUT:
  985. // CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) {
  986. // CHECK:STDOUT: %Dest => constants.%Dest
  987. // CHECK:STDOUT: %As.type => constants.%As.type.2
  988. // CHECK:STDOUT: %Self => constants.%Self.3
  989. // CHECK:STDOUT: }
  990. // CHECK:STDOUT:
  991. // CHECK:STDOUT: specific @Convert.7(constants.%N) {
  992. // CHECK:STDOUT: %N => constants.%N
  993. // CHECK:STDOUT: %iN => constants.%iN
  994. // CHECK:STDOUT: }
  995. // CHECK:STDOUT:
  996. // CHECK:STDOUT: specific @As(constants.%uN) {
  997. // CHECK:STDOUT: %Dest => constants.%uN
  998. // CHECK:STDOUT: %Dest.patt => constants.%uN
  999. // CHECK:STDOUT: }
  1000. // CHECK:STDOUT:
  1001. // CHECK:STDOUT: specific @As(@impl.6.%uN) {
  1002. // CHECK:STDOUT: %Dest => constants.%uN
  1003. // CHECK:STDOUT: %Dest.patt => constants.%uN
  1004. // CHECK:STDOUT: }
  1005. // CHECK:STDOUT:
  1006. // CHECK:STDOUT: specific @impl.6(constants.%N) {
  1007. // CHECK:STDOUT: %N => constants.%N
  1008. // CHECK:STDOUT: %N.patt => constants.%N
  1009. // CHECK:STDOUT: %uN => constants.%uN
  1010. // CHECK:STDOUT: %As.type => constants.%As.type.4
  1011. // CHECK:STDOUT: }
  1012. // CHECK:STDOUT:
  1013. // CHECK:STDOUT: specific @impl.6(%N) {
  1014. // CHECK:STDOUT: %N => constants.%N
  1015. // CHECK:STDOUT: %N.patt => constants.%N
  1016. // CHECK:STDOUT: %uN => constants.%uN
  1017. // CHECK:STDOUT: %As.type => constants.%As.type.4
  1018. // CHECK:STDOUT: }
  1019. // CHECK:STDOUT:
  1020. // CHECK:STDOUT: specific @Convert.8(constants.%N) {
  1021. // CHECK:STDOUT: %N => constants.%N
  1022. // CHECK:STDOUT: %uN => constants.%uN
  1023. // CHECK:STDOUT: }
  1024. // CHECK:STDOUT:
  1025. // CHECK:STDOUT: specific @As(Core.IntLiteral) {
  1026. // CHECK:STDOUT: %Dest => Core.IntLiteral
  1027. // CHECK:STDOUT: %Dest.patt => Core.IntLiteral
  1028. // CHECK:STDOUT:
  1029. // CHECK:STDOUT: !definition:
  1030. // CHECK:STDOUT: %As.type => constants.%As.type.5
  1031. // CHECK:STDOUT: %Self => constants.%Self.4
  1032. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.11
  1033. // CHECK:STDOUT: %Convert => constants.%Convert.11
  1034. // CHECK:STDOUT: %.1 => constants.%.14
  1035. // CHECK:STDOUT: %.2 => constants.%.15
  1036. // CHECK:STDOUT: }
  1037. // CHECK:STDOUT:
  1038. // CHECK:STDOUT: specific @impl.7(constants.%N) {
  1039. // CHECK:STDOUT: %N => constants.%N
  1040. // CHECK:STDOUT: %N.patt => constants.%N
  1041. // CHECK:STDOUT: %iN => constants.%iN
  1042. // CHECK:STDOUT: }
  1043. // CHECK:STDOUT:
  1044. // CHECK:STDOUT: specific @impl.7(%N) {
  1045. // CHECK:STDOUT: %N => constants.%N
  1046. // CHECK:STDOUT: %N.patt => constants.%N
  1047. // CHECK:STDOUT: %iN => constants.%iN
  1048. // CHECK:STDOUT: }
  1049. // CHECK:STDOUT:
  1050. // CHECK:STDOUT: specific @Convert.9(constants.%N) {
  1051. // CHECK:STDOUT: %N => constants.%N
  1052. // CHECK:STDOUT: %iN => constants.%iN
  1053. // CHECK:STDOUT: }
  1054. // CHECK:STDOUT:
  1055. // CHECK:STDOUT: specific @impl.8(constants.%N) {
  1056. // CHECK:STDOUT: %N => constants.%N
  1057. // CHECK:STDOUT: %N.patt => constants.%N
  1058. // CHECK:STDOUT: %uN => constants.%uN
  1059. // CHECK:STDOUT: }
  1060. // CHECK:STDOUT:
  1061. // CHECK:STDOUT: specific @impl.8(%N) {
  1062. // CHECK:STDOUT: %N => constants.%N
  1063. // CHECK:STDOUT: %N.patt => constants.%N
  1064. // CHECK:STDOUT: %uN => constants.%uN
  1065. // CHECK:STDOUT: }
  1066. // CHECK:STDOUT:
  1067. // CHECK:STDOUT: specific @Convert.10(constants.%N) {
  1068. // CHECK:STDOUT: %N => constants.%N
  1069. // CHECK:STDOUT: %uN => constants.%uN
  1070. // CHECK:STDOUT: }
  1071. // CHECK:STDOUT:
  1072. // CHECK:STDOUT: specific @C(constants.%X) {
  1073. // CHECK:STDOUT: %X => constants.%X
  1074. // CHECK:STDOUT: %X.patt => constants.%X
  1075. // CHECK:STDOUT: }
  1076. // CHECK:STDOUT:
  1077. // CHECK:STDOUT: specific @ImplicitAs(constants.%i32) {
  1078. // CHECK:STDOUT: %Dest => constants.%i32
  1079. // CHECK:STDOUT: %Dest.patt => constants.%i32
  1080. // CHECK:STDOUT:
  1081. // CHECK:STDOUT: !definition:
  1082. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6
  1083. // CHECK:STDOUT: %Self => constants.%Self.2
  1084. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.13
  1085. // CHECK:STDOUT: %Convert => constants.%Convert.13
  1086. // CHECK:STDOUT: %.1 => constants.%.25
  1087. // CHECK:STDOUT: %.2 => constants.%.26
  1088. // CHECK:STDOUT: }
  1089. // CHECK:STDOUT:
  1090. // CHECK:STDOUT: specific @impl.1(constants.%.17) {
  1091. // CHECK:STDOUT: %N => constants.%.17
  1092. // CHECK:STDOUT: %N.patt => constants.%.17
  1093. // CHECK:STDOUT: %iN => constants.%i32
  1094. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6
  1095. // CHECK:STDOUT:
  1096. // CHECK:STDOUT: !definition:
  1097. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.14
  1098. // CHECK:STDOUT: %Convert => constants.%Convert.14
  1099. // CHECK:STDOUT: %.1 => constants.%.28
  1100. // CHECK:STDOUT: }
  1101. // CHECK:STDOUT:
  1102. // CHECK:STDOUT: specific @Convert.2(constants.%.17) {
  1103. // CHECK:STDOUT: %N => constants.%.17
  1104. // CHECK:STDOUT: %iN => constants.%i32
  1105. // CHECK:STDOUT:
  1106. // CHECK:STDOUT: !definition:
  1107. // CHECK:STDOUT: }
  1108. // CHECK:STDOUT:
  1109. // CHECK:STDOUT: specific @C(constants.%tuple) {
  1110. // CHECK:STDOUT: %X => constants.%tuple
  1111. // CHECK:STDOUT: %X.patt => constants.%tuple
  1112. // CHECK:STDOUT:
  1113. // CHECK:STDOUT: !definition:
  1114. // CHECK:STDOUT: }
  1115. // CHECK:STDOUT:
  1116. // CHECK:STDOUT: --- fail_bad_type.impl.carbon
  1117. // CHECK:STDOUT:
  1118. // CHECK:STDOUT: constants {
  1119. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  1120. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic]
  1121. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
  1122. // CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
  1123. // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic]
  1124. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic]
  1125. // CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic]
  1126. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic]
  1127. // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic]
  1128. // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic]
  1129. // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic]
  1130. // CHECK:STDOUT: %.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic]
  1131. // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, imports.%import_ref.11 [symbolic]
  1132. // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic]
  1133. // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic]
  1134. // CHECK:STDOUT: %.3: <witness> = interface_witness (%Convert.2) [symbolic]
  1135. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic]
  1136. // CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic]
  1137. // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.3, @impl.2(%N) [symbolic]
  1138. // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic]
  1139. // CHECK:STDOUT: %.4: <witness> = interface_witness (%Convert.3) [symbolic]
  1140. // CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template]
  1141. // CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.4, @impl.3(%N) [symbolic]
  1142. // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic]
  1143. // CHECK:STDOUT: %.5: <witness> = interface_witness (%Convert.4) [symbolic]
  1144. // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template]
  1145. // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template]
  1146. // CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.5, %Convert.type.5 [template]
  1147. // CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.18 [template]
  1148. // CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.5, @impl.4(%N) [symbolic]
  1149. // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic]
  1150. // CHECK:STDOUT: %.8: <witness> = interface_witness (%Convert.6) [symbolic]
  1151. // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic]
  1152. // CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic]
  1153. // CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%iN)> [symbolic]
  1154. // CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic]
  1155. // CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.6, @As(%Dest) [symbolic]
  1156. // CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic]
  1157. // CHECK:STDOUT: %.9: type = assoc_entity_type %As.type.2, %Convert.type.7 [symbolic]
  1158. // CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.28 [symbolic]
  1159. // CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.7, @impl.5(%N) [symbolic]
  1160. // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic]
  1161. // CHECK:STDOUT: %.11: <witness> = interface_witness (%Convert.8) [symbolic]
  1162. // CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%uN)> [symbolic]
  1163. // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.8, @impl.6(%N) [symbolic]
  1164. // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [symbolic]
  1165. // CHECK:STDOUT: %.12: <witness> = interface_witness (%Convert.9) [symbolic]
  1166. // CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(Core.IntLiteral)> [template]
  1167. // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.9, @impl.7(%N) [symbolic]
  1168. // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic]
  1169. // CHECK:STDOUT: %.13: <witness> = interface_witness (%Convert.10) [symbolic]
  1170. // CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.6, @As(Core.IntLiteral) [template]
  1171. // CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template]
  1172. // CHECK:STDOUT: %.14: type = assoc_entity_type %As.type.5, %Convert.type.11 [template]
  1173. // CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.35 [template]
  1174. // CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10, @impl.8(%N) [symbolic]
  1175. // CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [symbolic]
  1176. // CHECK:STDOUT: %.16: <witness> = interface_witness (%Convert.12) [symbolic]
  1177. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  1178. // CHECK:STDOUT: %C.1: %C.type = struct_value () [template]
  1179. // CHECK:STDOUT: %.19: Core.IntLiteral = int_value 32 [template]
  1180. // CHECK:STDOUT: %i32: type = int_type signed, %.19 [template]
  1181. // CHECK:STDOUT: %tuple.type.1: type = tuple_type (%i32, %i32) [template]
  1182. // CHECK:STDOUT: %X: %tuple.type.1 = bind_symbolic_name X, 0 [symbolic]
  1183. // CHECK:STDOUT: %X.patt: %tuple.type.1 = symbolic_binding_pattern X, 0 [symbolic]
  1184. // CHECK:STDOUT: %.20: Core.IntLiteral = int_value 1 [template]
  1185. // CHECK:STDOUT: %.21: Core.IntLiteral = int_value 2 [template]
  1186. // CHECK:STDOUT: %.22: Core.IntLiteral = int_value 3 [template]
  1187. // CHECK:STDOUT: %tuple.type.2: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template]
  1188. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  1189. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  1190. // CHECK:STDOUT: %.24: %i32 = int_value 2 [template]
  1191. // CHECK:STDOUT: %.25: %i32 = int_value 1 [template]
  1192. // CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.25, %.24) [template]
  1193. // CHECK:STDOUT: %C.3: type = class_type @C, @C(%tuple) [template]
  1194. // CHECK:STDOUT: }
  1195. // CHECK:STDOUT:
  1196. // CHECK:STDOUT: imports {
  1197. // CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+26, unloaded
  1198. // CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+406, unloaded
  1199. // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+489, loaded [template = constants.%C.1]
  1200. // CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+523, loaded [template = constants.%F]
  1201. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  1202. // CHECK:STDOUT: import Core//prelude
  1203. // CHECK:STDOUT: import Core//prelude/...
  1204. // CHECK:STDOUT: }
  1205. // CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+44, unloaded
  1206. // CHECK:STDOUT: %import_ref.6 = import_ref Implicit//default, inst+45, unloaded
  1207. // CHECK:STDOUT: %import_ref.7 = import_ref Implicit//default, inst+46, unloaded
  1208. // CHECK:STDOUT: %import_ref.8: type = import_ref Implicit//default, inst+88, loaded [template = Core.IntLiteral]
  1209. // CHECK:STDOUT: %import_ref.9: type = import_ref Implicit//default, inst+89, loaded [symbolic = @impl.1.%ImplicitAs.type (constants.%ImplicitAs.type.3)]
  1210. // CHECK:STDOUT: %import_ref.10 = import_ref Implicit//default, inst+90, unloaded
  1211. // CHECK:STDOUT: %import_ref.11 = import_ref Implicit//default, inst+61, unloaded
  1212. // CHECK:STDOUT: %import_ref.12: type = import_ref Implicit//default, inst+118, loaded [template = Core.IntLiteral]
  1213. // CHECK:STDOUT: %import_ref.13: type = import_ref Implicit//default, inst+119, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)]
  1214. // CHECK:STDOUT: %import_ref.14 = import_ref Implicit//default, inst+120, unloaded
  1215. // CHECK:STDOUT: %import_ref.15: type = import_ref Implicit//default, inst+147, loaded [symbolic = @impl.3.%iN (constants.%iN)]
  1216. // CHECK:STDOUT: %import_ref.16: type = import_ref Implicit//default, inst+148, loaded [template = constants.%ImplicitAs.type.5]
  1217. // CHECK:STDOUT: %import_ref.17 = import_ref Implicit//default, inst+149, unloaded
  1218. // CHECK:STDOUT: %import_ref.19: type = import_ref Implicit//default, inst+179, loaded [symbolic = @impl.4.%uN (constants.%uN)]
  1219. // CHECK:STDOUT: %import_ref.20: type = import_ref Implicit//default, inst+180, loaded [template = constants.%ImplicitAs.type.5]
  1220. // CHECK:STDOUT: %import_ref.21 = import_ref Implicit//default, inst+181, unloaded
  1221. // CHECK:STDOUT: %import_ref.22 = import_ref Implicit//default, inst+211, unloaded
  1222. // CHECK:STDOUT: %import_ref.23 = import_ref Implicit//default, inst+212, unloaded
  1223. // CHECK:STDOUT: %import_ref.24 = import_ref Implicit//default, inst+213, unloaded
  1224. // CHECK:STDOUT: %import_ref.25: type = import_ref Implicit//default, inst+219, loaded [template = Core.IntLiteral]
  1225. // CHECK:STDOUT: %import_ref.26: type = import_ref Implicit//default, inst+220, loaded [symbolic = @impl.5.%As.type (constants.%As.type.3)]
  1226. // CHECK:STDOUT: %import_ref.27 = import_ref Implicit//default, inst+221, unloaded
  1227. // CHECK:STDOUT: %import_ref.28 = import_ref Implicit//default, inst+236, unloaded
  1228. // CHECK:STDOUT: %import_ref.29: type = import_ref Implicit//default, inst+273, loaded [template = Core.IntLiteral]
  1229. // CHECK:STDOUT: %import_ref.30: type = import_ref Implicit//default, inst+274, loaded [symbolic = @impl.6.%As.type (constants.%As.type.4)]
  1230. // CHECK:STDOUT: %import_ref.31 = import_ref Implicit//default, inst+275, unloaded
  1231. // CHECK:STDOUT: %import_ref.32: type = import_ref Implicit//default, inst+302, loaded [symbolic = @impl.7.%iN (constants.%iN)]
  1232. // CHECK:STDOUT: %import_ref.33: type = import_ref Implicit//default, inst+303, loaded [template = constants.%As.type.5]
  1233. // CHECK:STDOUT: %import_ref.34 = import_ref Implicit//default, inst+304, unloaded
  1234. // CHECK:STDOUT: %import_ref.36: type = import_ref Implicit//default, inst+334, loaded [symbolic = @impl.8.%uN (constants.%uN)]
  1235. // CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+335, loaded [template = constants.%As.type.5]
  1236. // CHECK:STDOUT: %import_ref.38 = import_ref Implicit//default, inst+336, unloaded
  1237. // CHECK:STDOUT: %import_ref.39 = import_ref Implicit//default, inst+494, unloaded
  1238. // CHECK:STDOUT: }
  1239. // CHECK:STDOUT:
  1240. // CHECK:STDOUT: file {
  1241. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1242. // CHECK:STDOUT: .a_ref = imports.%import_ref.1
  1243. // CHECK:STDOUT: .b_ref = imports.%import_ref.2
  1244. // CHECK:STDOUT: .C = imports.%import_ref.3
  1245. // CHECK:STDOUT: .F = imports.%import_ref.4
  1246. // CHECK:STDOUT: .Core = imports.%Core
  1247. // CHECK:STDOUT: .c_bad = %c_bad
  1248. // CHECK:STDOUT: }
  1249. // CHECK:STDOUT: %Implicit.import = import Implicit
  1250. // CHECK:STDOUT: %default.import = import <invalid>
  1251. // CHECK:STDOUT: %Core.import = import Core
  1252. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1]
  1253. // CHECK:STDOUT: %.loc12_15: Core.IntLiteral = int_value 1 [template = constants.%.20]
  1254. // CHECK:STDOUT: %.loc12_18: Core.IntLiteral = int_value 2 [template = constants.%.21]
  1255. // CHECK:STDOUT: %.loc12_21: Core.IntLiteral = int_value 3 [template = constants.%.22]
  1256. // CHECK:STDOUT: %.loc12_22: %tuple.type.2 = tuple_literal (%.loc12_15, %.loc12_18, %.loc12_21)
  1257. // CHECK:STDOUT: %c_bad.var: ref <error> = var c_bad
  1258. // CHECK:STDOUT: %c_bad: ref <error> = bind_name c_bad, %c_bad.var
  1259. // CHECK:STDOUT: }
  1260. // CHECK:STDOUT:
  1261. // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) {
  1262. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  1263. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)]
  1264. // CHECK:STDOUT:
  1265. // CHECK:STDOUT: !definition:
  1266. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
  1267. // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
  1268. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)]
  1269. // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)]
  1270. // CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.1)]
  1271. // CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.1) = assoc_entity element0, imports.%import_ref.11 [symbolic = %.2 (constants.%.2)]
  1272. // CHECK:STDOUT:
  1273. // CHECK:STDOUT: interface {
  1274. // CHECK:STDOUT: !members:
  1275. // CHECK:STDOUT: .Self = imports.%import_ref.5
  1276. // CHECK:STDOUT: .Convert = imports.%import_ref.6
  1277. // CHECK:STDOUT: witness = (imports.%import_ref.7)
  1278. // CHECK:STDOUT: }
  1279. // CHECK:STDOUT: }
  1280. // CHECK:STDOUT:
  1281. // CHECK:STDOUT: generic interface @As(constants.%Dest: type) {
  1282. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  1283. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)]
  1284. // CHECK:STDOUT:
  1285. // CHECK:STDOUT: !definition:
  1286. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)]
  1287. // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)]
  1288. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.7)]
  1289. // CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)]
  1290. // CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.7) [symbolic = %.1 (constants.%.9)]
  1291. // CHECK:STDOUT: %.2: @As.%.1 (%.9) = assoc_entity element0, imports.%import_ref.28 [symbolic = %.2 (constants.%.10)]
  1292. // CHECK:STDOUT:
  1293. // CHECK:STDOUT: interface {
  1294. // CHECK:STDOUT: !members:
  1295. // CHECK:STDOUT: .Self = imports.%import_ref.22
  1296. // CHECK:STDOUT: .Convert = imports.%import_ref.23
  1297. // CHECK:STDOUT: witness = (imports.%import_ref.24)
  1298. // CHECK:STDOUT: }
  1299. // CHECK:STDOUT: }
  1300. // CHECK:STDOUT:
  1301. // CHECK:STDOUT: generic impl @impl.1(constants.%N: Core.IntLiteral) {
  1302. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  1303. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  1304. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  1305. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3)]
  1306. // CHECK:STDOUT:
  1307. // CHECK:STDOUT: !definition:
  1308. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.1(%N) [symbolic = %Convert.type (constants.%Convert.type.2)]
  1309. // CHECK:STDOUT: %Convert: @impl.1.%Convert.type (%Convert.type.2) = struct_value () [symbolic = %Convert (constants.%Convert.2)]
  1310. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.3)]
  1311. // CHECK:STDOUT:
  1312. // CHECK:STDOUT: impl: imports.%import_ref.8 as imports.%import_ref.9 {
  1313. // CHECK:STDOUT: !members:
  1314. // CHECK:STDOUT: witness = imports.%import_ref.10
  1315. // CHECK:STDOUT: }
  1316. // CHECK:STDOUT: }
  1317. // CHECK:STDOUT:
  1318. // CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) {
  1319. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  1320. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  1321. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  1322. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)]
  1323. // CHECK:STDOUT:
  1324. // CHECK:STDOUT: !definition:
  1325. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)]
  1326. // CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)]
  1327. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.4)]
  1328. // CHECK:STDOUT:
  1329. // CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 {
  1330. // CHECK:STDOUT: !members:
  1331. // CHECK:STDOUT: witness = imports.%import_ref.14
  1332. // CHECK:STDOUT: }
  1333. // CHECK:STDOUT: }
  1334. // CHECK:STDOUT:
  1335. // CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) {
  1336. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  1337. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  1338. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  1339. // CHECK:STDOUT:
  1340. // CHECK:STDOUT: !definition:
  1341. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)]
  1342. // CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)]
  1343. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.5)]
  1344. // CHECK:STDOUT:
  1345. // CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 {
  1346. // CHECK:STDOUT: !members:
  1347. // CHECK:STDOUT: witness = imports.%import_ref.17
  1348. // CHECK:STDOUT: }
  1349. // CHECK:STDOUT: }
  1350. // CHECK:STDOUT:
  1351. // CHECK:STDOUT: generic impl @impl.4(constants.%N: Core.IntLiteral) {
  1352. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  1353. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  1354. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  1355. // CHECK:STDOUT:
  1356. // CHECK:STDOUT: !definition:
  1357. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.4(%N) [symbolic = %Convert.type (constants.%Convert.type.6)]
  1358. // CHECK:STDOUT: %Convert: @impl.4.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)]
  1359. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.8)]
  1360. // CHECK:STDOUT:
  1361. // CHECK:STDOUT: impl: imports.%import_ref.19 as imports.%import_ref.20 {
  1362. // CHECK:STDOUT: !members:
  1363. // CHECK:STDOUT: witness = imports.%import_ref.21
  1364. // CHECK:STDOUT: }
  1365. // CHECK:STDOUT: }
  1366. // CHECK:STDOUT:
  1367. // CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) {
  1368. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  1369. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  1370. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  1371. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%iN)> [symbolic = %As.type (constants.%As.type.3)]
  1372. // CHECK:STDOUT:
  1373. // CHECK:STDOUT: !definition:
  1374. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.8)]
  1375. // CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)]
  1376. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.11)]
  1377. // CHECK:STDOUT:
  1378. // CHECK:STDOUT: impl: imports.%import_ref.25 as imports.%import_ref.26 {
  1379. // CHECK:STDOUT: !members:
  1380. // CHECK:STDOUT: witness = imports.%import_ref.27
  1381. // CHECK:STDOUT: }
  1382. // CHECK:STDOUT: }
  1383. // CHECK:STDOUT:
  1384. // CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) {
  1385. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  1386. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  1387. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  1388. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%uN)> [symbolic = %As.type (constants.%As.type.4)]
  1389. // CHECK:STDOUT:
  1390. // CHECK:STDOUT: !definition:
  1391. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.9)]
  1392. // CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.9) = struct_value () [symbolic = %Convert (constants.%Convert.9)]
  1393. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.12)]
  1394. // CHECK:STDOUT:
  1395. // CHECK:STDOUT: impl: imports.%import_ref.29 as imports.%import_ref.30 {
  1396. // CHECK:STDOUT: !members:
  1397. // CHECK:STDOUT: witness = imports.%import_ref.31
  1398. // CHECK:STDOUT: }
  1399. // CHECK:STDOUT: }
  1400. // CHECK:STDOUT:
  1401. // CHECK:STDOUT: generic impl @impl.7(constants.%N: Core.IntLiteral) {
  1402. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  1403. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  1404. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  1405. // CHECK:STDOUT:
  1406. // CHECK:STDOUT: !definition:
  1407. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.7(%N) [symbolic = %Convert.type (constants.%Convert.type.10)]
  1408. // CHECK:STDOUT: %Convert: @impl.7.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)]
  1409. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.13)]
  1410. // CHECK:STDOUT:
  1411. // CHECK:STDOUT: impl: imports.%import_ref.32 as imports.%import_ref.33 {
  1412. // CHECK:STDOUT: !members:
  1413. // CHECK:STDOUT: witness = imports.%import_ref.34
  1414. // CHECK:STDOUT: }
  1415. // CHECK:STDOUT: }
  1416. // CHECK:STDOUT:
  1417. // CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) {
  1418. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  1419. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  1420. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  1421. // CHECK:STDOUT:
  1422. // CHECK:STDOUT: !definition:
  1423. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.12)]
  1424. // CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.12) = struct_value () [symbolic = %Convert (constants.%Convert.12)]
  1425. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.16)]
  1426. // CHECK:STDOUT:
  1427. // CHECK:STDOUT: impl: imports.%import_ref.36 as imports.%import_ref.37 {
  1428. // CHECK:STDOUT: !members:
  1429. // CHECK:STDOUT: witness = imports.%import_ref.38
  1430. // CHECK:STDOUT: }
  1431. // CHECK:STDOUT: }
  1432. // CHECK:STDOUT:
  1433. // CHECK:STDOUT: generic class @C(constants.%X: %tuple.type.1) {
  1434. // CHECK:STDOUT: %X: %tuple.type.1 = bind_symbolic_name X, 0 [symbolic = %X (constants.%X)]
  1435. // CHECK:STDOUT: %X.patt: %tuple.type.1 = symbolic_binding_pattern X, 0 [symbolic = %X.patt (constants.%X.patt)]
  1436. // CHECK:STDOUT:
  1437. // CHECK:STDOUT: !definition:
  1438. // CHECK:STDOUT:
  1439. // CHECK:STDOUT: class {
  1440. // CHECK:STDOUT: !members:
  1441. // CHECK:STDOUT: .Self = imports.%import_ref.39
  1442. // CHECK:STDOUT: }
  1443. // CHECK:STDOUT: }
  1444. // CHECK:STDOUT:
  1445. // CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) {
  1446. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  1447. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
  1448. // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
  1449. // CHECK:STDOUT:
  1450. // CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest);
  1451. // CHECK:STDOUT: }
  1452. // CHECK:STDOUT:
  1453. // CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) {
  1454. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  1455. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  1456. // CHECK:STDOUT:
  1457. // CHECK:STDOUT: !definition:
  1458. // CHECK:STDOUT:
  1459. // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%iN (%iN) = "int.convert_checked";
  1460. // CHECK:STDOUT: }
  1461. // CHECK:STDOUT:
  1462. // CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) {
  1463. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  1464. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  1465. // CHECK:STDOUT:
  1466. // CHECK:STDOUT: !definition:
  1467. // CHECK:STDOUT:
  1468. // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%uN (%uN) = "int.convert_checked";
  1469. // CHECK:STDOUT: }
  1470. // CHECK:STDOUT:
  1471. // CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) {
  1472. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  1473. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  1474. // CHECK:STDOUT:
  1475. // CHECK:STDOUT: !definition:
  1476. // CHECK:STDOUT:
  1477. // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked";
  1478. // CHECK:STDOUT: }
  1479. // CHECK:STDOUT:
  1480. // CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) {
  1481. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  1482. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  1483. // CHECK:STDOUT:
  1484. // CHECK:STDOUT: !definition:
  1485. // CHECK:STDOUT:
  1486. // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked";
  1487. // CHECK:STDOUT: }
  1488. // CHECK:STDOUT:
  1489. // CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) {
  1490. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  1491. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)]
  1492. // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)]
  1493. // CHECK:STDOUT:
  1494. // CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest);
  1495. // CHECK:STDOUT: }
  1496. // CHECK:STDOUT:
  1497. // CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) {
  1498. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  1499. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  1500. // CHECK:STDOUT:
  1501. // CHECK:STDOUT: !definition:
  1502. // CHECK:STDOUT:
  1503. // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%iN (%iN) = "int.convert_checked";
  1504. // CHECK:STDOUT: }
  1505. // CHECK:STDOUT:
  1506. // CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) {
  1507. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  1508. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  1509. // CHECK:STDOUT:
  1510. // CHECK:STDOUT: !definition:
  1511. // CHECK:STDOUT:
  1512. // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%uN (%uN) = "int.convert_checked";
  1513. // CHECK:STDOUT: }
  1514. // CHECK:STDOUT:
  1515. // CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) {
  1516. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  1517. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  1518. // CHECK:STDOUT:
  1519. // CHECK:STDOUT: !definition:
  1520. // CHECK:STDOUT:
  1521. // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked";
  1522. // CHECK:STDOUT: }
  1523. // CHECK:STDOUT:
  1524. // CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) {
  1525. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  1526. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  1527. // CHECK:STDOUT:
  1528. // CHECK:STDOUT: !definition:
  1529. // CHECK:STDOUT:
  1530. // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked";
  1531. // CHECK:STDOUT: }
  1532. // CHECK:STDOUT:
  1533. // CHECK:STDOUT: fn @F() -> %C.3;
  1534. // CHECK:STDOUT:
  1535. // CHECK:STDOUT: fn @__global_init() {
  1536. // CHECK:STDOUT: !entry:
  1537. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F]
  1538. // CHECK:STDOUT: %.loc12: ref %C.3 = temporary_storage
  1539. // CHECK:STDOUT: %F.call: init %C.3 = call %F.ref() to %.loc12
  1540. // CHECK:STDOUT: assign file.%c_bad.var, <error>
  1541. // CHECK:STDOUT: return
  1542. // CHECK:STDOUT: }
  1543. // CHECK:STDOUT:
  1544. // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
  1545. // CHECK:STDOUT: %Dest => constants.%Dest
  1546. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  1547. // CHECK:STDOUT: }
  1548. // CHECK:STDOUT:
  1549. // CHECK:STDOUT: specific @ImplicitAs(constants.%iN) {
  1550. // CHECK:STDOUT: %Dest => constants.%iN
  1551. // CHECK:STDOUT: %Dest.patt => constants.%iN
  1552. // CHECK:STDOUT: }
  1553. // CHECK:STDOUT:
  1554. // CHECK:STDOUT: specific @ImplicitAs(%Dest) {
  1555. // CHECK:STDOUT: %Dest => constants.%Dest
  1556. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  1557. // CHECK:STDOUT: }
  1558. // CHECK:STDOUT:
  1559. // CHECK:STDOUT: specific @ImplicitAs(@impl.1.%iN) {
  1560. // CHECK:STDOUT: %Dest => constants.%iN
  1561. // CHECK:STDOUT: %Dest.patt => constants.%iN
  1562. // CHECK:STDOUT: }
  1563. // CHECK:STDOUT:
  1564. // CHECK:STDOUT: specific @impl.1(constants.%N) {
  1565. // CHECK:STDOUT: %N => constants.%N
  1566. // CHECK:STDOUT: %N.patt => constants.%N
  1567. // CHECK:STDOUT: %iN => constants.%iN
  1568. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3
  1569. // CHECK:STDOUT: }
  1570. // CHECK:STDOUT:
  1571. // CHECK:STDOUT: specific @impl.1(%N) {
  1572. // CHECK:STDOUT: %N => constants.%N
  1573. // CHECK:STDOUT: %N.patt => constants.%N
  1574. // CHECK:STDOUT: %iN => constants.%iN
  1575. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3
  1576. // CHECK:STDOUT: }
  1577. // CHECK:STDOUT:
  1578. // CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) {
  1579. // CHECK:STDOUT: %Dest => constants.%Dest
  1580. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  1581. // CHECK:STDOUT: }
  1582. // CHECK:STDOUT:
  1583. // CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) {
  1584. // CHECK:STDOUT: %Dest => constants.%Dest
  1585. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2
  1586. // CHECK:STDOUT: %Self => constants.%Self.1
  1587. // CHECK:STDOUT: }
  1588. // CHECK:STDOUT:
  1589. // CHECK:STDOUT: specific @Convert.2(constants.%N) {
  1590. // CHECK:STDOUT: %N => constants.%N
  1591. // CHECK:STDOUT: %iN => constants.%iN
  1592. // CHECK:STDOUT: }
  1593. // CHECK:STDOUT:
  1594. // CHECK:STDOUT: specific @ImplicitAs(constants.%uN) {
  1595. // CHECK:STDOUT: %Dest => constants.%uN
  1596. // CHECK:STDOUT: %Dest.patt => constants.%uN
  1597. // CHECK:STDOUT: }
  1598. // CHECK:STDOUT:
  1599. // CHECK:STDOUT: specific @ImplicitAs(@impl.2.%uN) {
  1600. // CHECK:STDOUT: %Dest => constants.%uN
  1601. // CHECK:STDOUT: %Dest.patt => constants.%uN
  1602. // CHECK:STDOUT: }
  1603. // CHECK:STDOUT:
  1604. // CHECK:STDOUT: specific @impl.2(constants.%N) {
  1605. // CHECK:STDOUT: %N => constants.%N
  1606. // CHECK:STDOUT: %N.patt => constants.%N
  1607. // CHECK:STDOUT: %uN => constants.%uN
  1608. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4
  1609. // CHECK:STDOUT: }
  1610. // CHECK:STDOUT:
  1611. // CHECK:STDOUT: specific @impl.2(%N) {
  1612. // CHECK:STDOUT: %N => constants.%N
  1613. // CHECK:STDOUT: %N.patt => constants.%N
  1614. // CHECK:STDOUT: %uN => constants.%uN
  1615. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4
  1616. // CHECK:STDOUT: }
  1617. // CHECK:STDOUT:
  1618. // CHECK:STDOUT: specific @Convert.3(constants.%N) {
  1619. // CHECK:STDOUT: %N => constants.%N
  1620. // CHECK:STDOUT: %uN => constants.%uN
  1621. // CHECK:STDOUT: }
  1622. // CHECK:STDOUT:
  1623. // CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) {
  1624. // CHECK:STDOUT: %Dest => Core.IntLiteral
  1625. // CHECK:STDOUT: %Dest.patt => Core.IntLiteral
  1626. // CHECK:STDOUT:
  1627. // CHECK:STDOUT: !definition:
  1628. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5
  1629. // CHECK:STDOUT: %Self => constants.%Self.2
  1630. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5
  1631. // CHECK:STDOUT: %Convert => constants.%Convert.5
  1632. // CHECK:STDOUT: %.1 => constants.%.6
  1633. // CHECK:STDOUT: %.2 => constants.%.7
  1634. // CHECK:STDOUT: }
  1635. // CHECK:STDOUT:
  1636. // CHECK:STDOUT: specific @impl.3(constants.%N) {
  1637. // CHECK:STDOUT: %N => constants.%N
  1638. // CHECK:STDOUT: %N.patt => constants.%N
  1639. // CHECK:STDOUT: %iN => constants.%iN
  1640. // CHECK:STDOUT: }
  1641. // CHECK:STDOUT:
  1642. // CHECK:STDOUT: specific @impl.3(%N) {
  1643. // CHECK:STDOUT: %N => constants.%N
  1644. // CHECK:STDOUT: %N.patt => constants.%N
  1645. // CHECK:STDOUT: %iN => constants.%iN
  1646. // CHECK:STDOUT: }
  1647. // CHECK:STDOUT:
  1648. // CHECK:STDOUT: specific @Convert.4(constants.%N) {
  1649. // CHECK:STDOUT: %N => constants.%N
  1650. // CHECK:STDOUT: %iN => constants.%iN
  1651. // CHECK:STDOUT: }
  1652. // CHECK:STDOUT:
  1653. // CHECK:STDOUT: specific @impl.4(constants.%N) {
  1654. // CHECK:STDOUT: %N => constants.%N
  1655. // CHECK:STDOUT: %N.patt => constants.%N
  1656. // CHECK:STDOUT: %uN => constants.%uN
  1657. // CHECK:STDOUT: }
  1658. // CHECK:STDOUT:
  1659. // CHECK:STDOUT: specific @impl.4(%N) {
  1660. // CHECK:STDOUT: %N => constants.%N
  1661. // CHECK:STDOUT: %N.patt => constants.%N
  1662. // CHECK:STDOUT: %uN => constants.%uN
  1663. // CHECK:STDOUT: }
  1664. // CHECK:STDOUT:
  1665. // CHECK:STDOUT: specific @Convert.5(constants.%N) {
  1666. // CHECK:STDOUT: %N => constants.%N
  1667. // CHECK:STDOUT: %uN => constants.%uN
  1668. // CHECK:STDOUT: }
  1669. // CHECK:STDOUT:
  1670. // CHECK:STDOUT: specific @As(constants.%Dest) {
  1671. // CHECK:STDOUT: %Dest => constants.%Dest
  1672. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  1673. // CHECK:STDOUT: }
  1674. // CHECK:STDOUT:
  1675. // CHECK:STDOUT: specific @As(constants.%iN) {
  1676. // CHECK:STDOUT: %Dest => constants.%iN
  1677. // CHECK:STDOUT: %Dest.patt => constants.%iN
  1678. // CHECK:STDOUT: }
  1679. // CHECK:STDOUT:
  1680. // CHECK:STDOUT: specific @As(%Dest) {
  1681. // CHECK:STDOUT: %Dest => constants.%Dest
  1682. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  1683. // CHECK:STDOUT: }
  1684. // CHECK:STDOUT:
  1685. // CHECK:STDOUT: specific @As(@impl.5.%iN) {
  1686. // CHECK:STDOUT: %Dest => constants.%iN
  1687. // CHECK:STDOUT: %Dest.patt => constants.%iN
  1688. // CHECK:STDOUT: }
  1689. // CHECK:STDOUT:
  1690. // CHECK:STDOUT: specific @impl.5(constants.%N) {
  1691. // CHECK:STDOUT: %N => constants.%N
  1692. // CHECK:STDOUT: %N.patt => constants.%N
  1693. // CHECK:STDOUT: %iN => constants.%iN
  1694. // CHECK:STDOUT: %As.type => constants.%As.type.3
  1695. // CHECK:STDOUT: }
  1696. // CHECK:STDOUT:
  1697. // CHECK:STDOUT: specific @impl.5(%N) {
  1698. // CHECK:STDOUT: %N => constants.%N
  1699. // CHECK:STDOUT: %N.patt => constants.%N
  1700. // CHECK:STDOUT: %iN => constants.%iN
  1701. // CHECK:STDOUT: %As.type => constants.%As.type.3
  1702. // CHECK:STDOUT: }
  1703. // CHECK:STDOUT:
  1704. // CHECK:STDOUT: specific @As(@Convert.6.%Dest) {
  1705. // CHECK:STDOUT: %Dest => constants.%Dest
  1706. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  1707. // CHECK:STDOUT: }
  1708. // CHECK:STDOUT:
  1709. // CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) {
  1710. // CHECK:STDOUT: %Dest => constants.%Dest
  1711. // CHECK:STDOUT: %As.type => constants.%As.type.2
  1712. // CHECK:STDOUT: %Self => constants.%Self.3
  1713. // CHECK:STDOUT: }
  1714. // CHECK:STDOUT:
  1715. // CHECK:STDOUT: specific @Convert.7(constants.%N) {
  1716. // CHECK:STDOUT: %N => constants.%N
  1717. // CHECK:STDOUT: %iN => constants.%iN
  1718. // CHECK:STDOUT: }
  1719. // CHECK:STDOUT:
  1720. // CHECK:STDOUT: specific @As(constants.%uN) {
  1721. // CHECK:STDOUT: %Dest => constants.%uN
  1722. // CHECK:STDOUT: %Dest.patt => constants.%uN
  1723. // CHECK:STDOUT: }
  1724. // CHECK:STDOUT:
  1725. // CHECK:STDOUT: specific @As(@impl.6.%uN) {
  1726. // CHECK:STDOUT: %Dest => constants.%uN
  1727. // CHECK:STDOUT: %Dest.patt => constants.%uN
  1728. // CHECK:STDOUT: }
  1729. // CHECK:STDOUT:
  1730. // CHECK:STDOUT: specific @impl.6(constants.%N) {
  1731. // CHECK:STDOUT: %N => constants.%N
  1732. // CHECK:STDOUT: %N.patt => constants.%N
  1733. // CHECK:STDOUT: %uN => constants.%uN
  1734. // CHECK:STDOUT: %As.type => constants.%As.type.4
  1735. // CHECK:STDOUT: }
  1736. // CHECK:STDOUT:
  1737. // CHECK:STDOUT: specific @impl.6(%N) {
  1738. // CHECK:STDOUT: %N => constants.%N
  1739. // CHECK:STDOUT: %N.patt => constants.%N
  1740. // CHECK:STDOUT: %uN => constants.%uN
  1741. // CHECK:STDOUT: %As.type => constants.%As.type.4
  1742. // CHECK:STDOUT: }
  1743. // CHECK:STDOUT:
  1744. // CHECK:STDOUT: specific @Convert.8(constants.%N) {
  1745. // CHECK:STDOUT: %N => constants.%N
  1746. // CHECK:STDOUT: %uN => constants.%uN
  1747. // CHECK:STDOUT: }
  1748. // CHECK:STDOUT:
  1749. // CHECK:STDOUT: specific @As(Core.IntLiteral) {
  1750. // CHECK:STDOUT: %Dest => Core.IntLiteral
  1751. // CHECK:STDOUT: %Dest.patt => Core.IntLiteral
  1752. // CHECK:STDOUT:
  1753. // CHECK:STDOUT: !definition:
  1754. // CHECK:STDOUT: %As.type => constants.%As.type.5
  1755. // CHECK:STDOUT: %Self => constants.%Self.4
  1756. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.11
  1757. // CHECK:STDOUT: %Convert => constants.%Convert.11
  1758. // CHECK:STDOUT: %.1 => constants.%.14
  1759. // CHECK:STDOUT: %.2 => constants.%.15
  1760. // CHECK:STDOUT: }
  1761. // CHECK:STDOUT:
  1762. // CHECK:STDOUT: specific @impl.7(constants.%N) {
  1763. // CHECK:STDOUT: %N => constants.%N
  1764. // CHECK:STDOUT: %N.patt => constants.%N
  1765. // CHECK:STDOUT: %iN => constants.%iN
  1766. // CHECK:STDOUT: }
  1767. // CHECK:STDOUT:
  1768. // CHECK:STDOUT: specific @impl.7(%N) {
  1769. // CHECK:STDOUT: %N => constants.%N
  1770. // CHECK:STDOUT: %N.patt => constants.%N
  1771. // CHECK:STDOUT: %iN => constants.%iN
  1772. // CHECK:STDOUT: }
  1773. // CHECK:STDOUT:
  1774. // CHECK:STDOUT: specific @Convert.9(constants.%N) {
  1775. // CHECK:STDOUT: %N => constants.%N
  1776. // CHECK:STDOUT: %iN => constants.%iN
  1777. // CHECK:STDOUT: }
  1778. // CHECK:STDOUT:
  1779. // CHECK:STDOUT: specific @impl.8(constants.%N) {
  1780. // CHECK:STDOUT: %N => constants.%N
  1781. // CHECK:STDOUT: %N.patt => constants.%N
  1782. // CHECK:STDOUT: %uN => constants.%uN
  1783. // CHECK:STDOUT: }
  1784. // CHECK:STDOUT:
  1785. // CHECK:STDOUT: specific @impl.8(%N) {
  1786. // CHECK:STDOUT: %N => constants.%N
  1787. // CHECK:STDOUT: %N.patt => constants.%N
  1788. // CHECK:STDOUT: %uN => constants.%uN
  1789. // CHECK:STDOUT: }
  1790. // CHECK:STDOUT:
  1791. // CHECK:STDOUT: specific @Convert.10(constants.%N) {
  1792. // CHECK:STDOUT: %N => constants.%N
  1793. // CHECK:STDOUT: %uN => constants.%uN
  1794. // CHECK:STDOUT: }
  1795. // CHECK:STDOUT:
  1796. // CHECK:STDOUT: specific @C(constants.%X) {
  1797. // CHECK:STDOUT: %X => constants.%X
  1798. // CHECK:STDOUT: %X.patt => constants.%X
  1799. // CHECK:STDOUT: }
  1800. // CHECK:STDOUT:
  1801. // CHECK:STDOUT: specific @C(constants.%tuple) {
  1802. // CHECK:STDOUT: %X => constants.%tuple
  1803. // CHECK:STDOUT: %X.patt => constants.%tuple
  1804. // CHECK:STDOUT:
  1805. // CHECK:STDOUT: !definition:
  1806. // CHECK:STDOUT: }
  1807. // CHECK:STDOUT:
  1808. // CHECK:STDOUT: --- fail_bad_value.impl.carbon
  1809. // CHECK:STDOUT:
  1810. // CHECK:STDOUT: constants {
  1811. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  1812. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic]
  1813. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
  1814. // CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
  1815. // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic]
  1816. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic]
  1817. // CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic]
  1818. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic]
  1819. // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic]
  1820. // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic]
  1821. // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic]
  1822. // CHECK:STDOUT: %.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic]
  1823. // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, imports.%import_ref.11 [symbolic]
  1824. // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic]
  1825. // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic]
  1826. // CHECK:STDOUT: %.3: <witness> = interface_witness (%Convert.2) [symbolic]
  1827. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic]
  1828. // CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic]
  1829. // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.3, @impl.2(%N) [symbolic]
  1830. // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic]
  1831. // CHECK:STDOUT: %.4: <witness> = interface_witness (%Convert.3) [symbolic]
  1832. // CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template]
  1833. // CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.4, @impl.3(%N) [symbolic]
  1834. // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic]
  1835. // CHECK:STDOUT: %.5: <witness> = interface_witness (%Convert.4) [symbolic]
  1836. // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template]
  1837. // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template]
  1838. // CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.5, %Convert.type.5 [template]
  1839. // CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.18 [template]
  1840. // CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.5, @impl.4(%N) [symbolic]
  1841. // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic]
  1842. // CHECK:STDOUT: %.8: <witness> = interface_witness (%Convert.6) [symbolic]
  1843. // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic]
  1844. // CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic]
  1845. // CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%iN)> [symbolic]
  1846. // CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic]
  1847. // CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.6, @As(%Dest) [symbolic]
  1848. // CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic]
  1849. // CHECK:STDOUT: %.9: type = assoc_entity_type %As.type.2, %Convert.type.7 [symbolic]
  1850. // CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.28 [symbolic]
  1851. // CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.7, @impl.5(%N) [symbolic]
  1852. // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic]
  1853. // CHECK:STDOUT: %.11: <witness> = interface_witness (%Convert.8) [symbolic]
  1854. // CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%uN)> [symbolic]
  1855. // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.8, @impl.6(%N) [symbolic]
  1856. // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [symbolic]
  1857. // CHECK:STDOUT: %.12: <witness> = interface_witness (%Convert.9) [symbolic]
  1858. // CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(Core.IntLiteral)> [template]
  1859. // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.9, @impl.7(%N) [symbolic]
  1860. // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic]
  1861. // CHECK:STDOUT: %.13: <witness> = interface_witness (%Convert.10) [symbolic]
  1862. // CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.6, @As(Core.IntLiteral) [template]
  1863. // CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template]
  1864. // CHECK:STDOUT: %.14: type = assoc_entity_type %As.type.5, %Convert.type.11 [template]
  1865. // CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.35 [template]
  1866. // CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10, @impl.8(%N) [symbolic]
  1867. // CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [symbolic]
  1868. // CHECK:STDOUT: %.16: <witness> = interface_witness (%Convert.12) [symbolic]
  1869. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  1870. // CHECK:STDOUT: %C.1: %C.type = struct_value () [template]
  1871. // CHECK:STDOUT: %.19: Core.IntLiteral = int_value 32 [template]
  1872. // CHECK:STDOUT: %i32: type = int_type signed, %.19 [template]
  1873. // CHECK:STDOUT: %tuple.type.1: type = tuple_type (%i32, %i32) [template]
  1874. // CHECK:STDOUT: %X: %tuple.type.1 = bind_symbolic_name X, 0 [symbolic]
  1875. // CHECK:STDOUT: %X.patt: %tuple.type.1 = symbolic_binding_pattern X, 0 [symbolic]
  1876. // CHECK:STDOUT: %.20: Core.IntLiteral = int_value 3 [template]
  1877. // CHECK:STDOUT: %.21: Core.IntLiteral = int_value 4 [template]
  1878. // CHECK:STDOUT: %tuple.type.2: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template]
  1879. // CHECK:STDOUT: %ImplicitAs.type.6: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
  1880. // CHECK:STDOUT: %Convert.type.13: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
  1881. // CHECK:STDOUT: %Convert.13: %Convert.type.13 = struct_value () [template]
  1882. // CHECK:STDOUT: %.23: type = assoc_entity_type %ImplicitAs.type.6, %Convert.type.13 [template]
  1883. // CHECK:STDOUT: %.24: %.23 = assoc_entity element0, imports.%import_ref.11 [template]
  1884. // CHECK:STDOUT: %.25: %.1 = assoc_entity element0, imports.%import_ref.41 [symbolic]
  1885. // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.19) [template]
  1886. // CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template]
  1887. // CHECK:STDOUT: %.26: <witness> = interface_witness (%Convert.14) [template]
  1888. // CHECK:STDOUT: %.27: <bound method> = bound_method %.20, %Convert.14 [template]
  1889. // CHECK:STDOUT: %.28: <specific function> = specific_function %.27, @Convert.2(%.19) [template]
  1890. // CHECK:STDOUT: %.29: %i32 = int_value 3 [template]
  1891. // CHECK:STDOUT: %.30: <bound method> = bound_method %.21, %Convert.14 [template]
  1892. // CHECK:STDOUT: %.31: <specific function> = specific_function %.30, @Convert.2(%.19) [template]
  1893. // CHECK:STDOUT: %.32: %i32 = int_value 4 [template]
  1894. // CHECK:STDOUT: %tuple.1: %tuple.type.1 = tuple_value (%.29, %.32) [template]
  1895. // CHECK:STDOUT: %C.3: type = class_type @C, @C(%tuple.1) [template]
  1896. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  1897. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  1898. // CHECK:STDOUT: %.34: %i32 = int_value 2 [template]
  1899. // CHECK:STDOUT: %.35: %i32 = int_value 1 [template]
  1900. // CHECK:STDOUT: %tuple.2: %tuple.type.1 = tuple_value (%.35, %.34) [template]
  1901. // CHECK:STDOUT: %C.4: type = class_type @C, @C(%tuple.2) [template]
  1902. // CHECK:STDOUT: %ImplicitAs.type.7: type = facet_type <@ImplicitAs, @ImplicitAs(%C.3)> [template]
  1903. // CHECK:STDOUT: %Convert.type.15: type = fn_type @Convert.1, @ImplicitAs(%C.3) [template]
  1904. // CHECK:STDOUT: %Convert.15: %Convert.type.15 = struct_value () [template]
  1905. // CHECK:STDOUT: %.36: type = assoc_entity_type %ImplicitAs.type.7, %Convert.type.15 [template]
  1906. // CHECK:STDOUT: %.37: %.36 = assoc_entity element0, imports.%import_ref.11 [template]
  1907. // CHECK:STDOUT: }
  1908. // CHECK:STDOUT:
  1909. // CHECK:STDOUT: imports {
  1910. // CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+26, unloaded
  1911. // CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+406, unloaded
  1912. // CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+489, loaded [template = constants.%C.1]
  1913. // CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+523, loaded [template = constants.%F]
  1914. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  1915. // CHECK:STDOUT: .ImplicitAs = %import_ref.40
  1916. // CHECK:STDOUT: import Core//prelude
  1917. // CHECK:STDOUT: import Core//prelude/...
  1918. // CHECK:STDOUT: }
  1919. // CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+44, unloaded
  1920. // CHECK:STDOUT: %import_ref.6: @ImplicitAs.%.1 (%.1) = import_ref Implicit//default, inst+45, loaded [symbolic = @ImplicitAs.%.2 (constants.%.25)]
  1921. // CHECK:STDOUT: %import_ref.7 = import_ref Implicit//default, inst+46, unloaded
  1922. // CHECK:STDOUT: %import_ref.8: type = import_ref Implicit//default, inst+88, loaded [template = Core.IntLiteral]
  1923. // CHECK:STDOUT: %import_ref.9: type = import_ref Implicit//default, inst+89, loaded [symbolic = @impl.1.%ImplicitAs.type (constants.%ImplicitAs.type.3)]
  1924. // CHECK:STDOUT: %import_ref.10: <witness> = import_ref Implicit//default, inst+90, loaded [symbolic = @impl.1.%.1 (constants.%.3)]
  1925. // CHECK:STDOUT: %import_ref.11 = import_ref Implicit//default, inst+61, unloaded
  1926. // CHECK:STDOUT: %import_ref.12: type = import_ref Implicit//default, inst+118, loaded [template = Core.IntLiteral]
  1927. // CHECK:STDOUT: %import_ref.13: type = import_ref Implicit//default, inst+119, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)]
  1928. // CHECK:STDOUT: %import_ref.14 = import_ref Implicit//default, inst+120, unloaded
  1929. // CHECK:STDOUT: %import_ref.15: type = import_ref Implicit//default, inst+147, loaded [symbolic = @impl.3.%iN (constants.%iN)]
  1930. // CHECK:STDOUT: %import_ref.16: type = import_ref Implicit//default, inst+148, loaded [template = constants.%ImplicitAs.type.5]
  1931. // CHECK:STDOUT: %import_ref.17 = import_ref Implicit//default, inst+149, unloaded
  1932. // CHECK:STDOUT: %import_ref.19: type = import_ref Implicit//default, inst+179, loaded [symbolic = @impl.4.%uN (constants.%uN)]
  1933. // CHECK:STDOUT: %import_ref.20: type = import_ref Implicit//default, inst+180, loaded [template = constants.%ImplicitAs.type.5]
  1934. // CHECK:STDOUT: %import_ref.21 = import_ref Implicit//default, inst+181, unloaded
  1935. // CHECK:STDOUT: %import_ref.22 = import_ref Implicit//default, inst+211, unloaded
  1936. // CHECK:STDOUT: %import_ref.23 = import_ref Implicit//default, inst+212, unloaded
  1937. // CHECK:STDOUT: %import_ref.24 = import_ref Implicit//default, inst+213, unloaded
  1938. // CHECK:STDOUT: %import_ref.25: type = import_ref Implicit//default, inst+219, loaded [template = Core.IntLiteral]
  1939. // CHECK:STDOUT: %import_ref.26: type = import_ref Implicit//default, inst+220, loaded [symbolic = @impl.5.%As.type (constants.%As.type.3)]
  1940. // CHECK:STDOUT: %import_ref.27 = import_ref Implicit//default, inst+221, unloaded
  1941. // CHECK:STDOUT: %import_ref.28 = import_ref Implicit//default, inst+236, unloaded
  1942. // CHECK:STDOUT: %import_ref.29: type = import_ref Implicit//default, inst+273, loaded [template = Core.IntLiteral]
  1943. // CHECK:STDOUT: %import_ref.30: type = import_ref Implicit//default, inst+274, loaded [symbolic = @impl.6.%As.type (constants.%As.type.4)]
  1944. // CHECK:STDOUT: %import_ref.31 = import_ref Implicit//default, inst+275, unloaded
  1945. // CHECK:STDOUT: %import_ref.32: type = import_ref Implicit//default, inst+302, loaded [symbolic = @impl.7.%iN (constants.%iN)]
  1946. // CHECK:STDOUT: %import_ref.33: type = import_ref Implicit//default, inst+303, loaded [template = constants.%As.type.5]
  1947. // CHECK:STDOUT: %import_ref.34 = import_ref Implicit//default, inst+304, unloaded
  1948. // CHECK:STDOUT: %import_ref.36: type = import_ref Implicit//default, inst+334, loaded [symbolic = @impl.8.%uN (constants.%uN)]
  1949. // CHECK:STDOUT: %import_ref.37: type = import_ref Implicit//default, inst+335, loaded [template = constants.%As.type.5]
  1950. // CHECK:STDOUT: %import_ref.38 = import_ref Implicit//default, inst+336, unloaded
  1951. // CHECK:STDOUT: %import_ref.39 = import_ref Implicit//default, inst+494, unloaded
  1952. // CHECK:STDOUT: }
  1953. // CHECK:STDOUT:
  1954. // CHECK:STDOUT: file {
  1955. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1956. // CHECK:STDOUT: .a_ref = imports.%import_ref.1
  1957. // CHECK:STDOUT: .b_ref = imports.%import_ref.2
  1958. // CHECK:STDOUT: .C = imports.%import_ref.3
  1959. // CHECK:STDOUT: .F = imports.%import_ref.4
  1960. // CHECK:STDOUT: .Core = imports.%Core
  1961. // CHECK:STDOUT: .c_bad = %c_bad
  1962. // CHECK:STDOUT: }
  1963. // CHECK:STDOUT: %Implicit.import = import Implicit
  1964. // CHECK:STDOUT: %default.import = import <invalid>
  1965. // CHECK:STDOUT: %Core.import = import Core
  1966. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1]
  1967. // CHECK:STDOUT: %.loc10_15: Core.IntLiteral = int_value 3 [template = constants.%.20]
  1968. // CHECK:STDOUT: %.loc10_18: Core.IntLiteral = int_value 4 [template = constants.%.21]
  1969. // CHECK:STDOUT: %.loc10_19.1: %tuple.type.2 = tuple_literal (%.loc10_15, %.loc10_18)
  1970. // CHECK:STDOUT: %.loc10_19.2: %Convert.type.13 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14]
  1971. // CHECK:STDOUT: %.loc10_19.3: <bound method> = bound_method %.loc10_15, %.loc10_19.2 [template = constants.%.27]
  1972. // CHECK:STDOUT: %.loc10_19.4: <specific function> = specific_function %.loc10_19.3, @Convert.2(constants.%.19) [template = constants.%.28]
  1973. // CHECK:STDOUT: %int.convert_checked.loc10_19.1: init %i32 = call %.loc10_19.4(%.loc10_15) [template = constants.%.29]
  1974. // CHECK:STDOUT: %.loc10_19.5: %i32 = value_of_initializer %int.convert_checked.loc10_19.1 [template = constants.%.29]
  1975. // CHECK:STDOUT: %.loc10_19.6: %i32 = converted %.loc10_15, %.loc10_19.5 [template = constants.%.29]
  1976. // CHECK:STDOUT: %.loc10_19.7: %Convert.type.13 = interface_witness_access constants.%.26, element0 [template = constants.%Convert.14]
  1977. // CHECK:STDOUT: %.loc10_19.8: <bound method> = bound_method %.loc10_18, %.loc10_19.7 [template = constants.%.30]
  1978. // CHECK:STDOUT: %.loc10_19.9: <specific function> = specific_function %.loc10_19.8, @Convert.2(constants.%.19) [template = constants.%.31]
  1979. // CHECK:STDOUT: %int.convert_checked.loc10_19.2: init %i32 = call %.loc10_19.9(%.loc10_18) [template = constants.%.32]
  1980. // CHECK:STDOUT: %.loc10_19.10: %i32 = value_of_initializer %int.convert_checked.loc10_19.2 [template = constants.%.32]
  1981. // CHECK:STDOUT: %.loc10_19.11: %i32 = converted %.loc10_18, %.loc10_19.10 [template = constants.%.32]
  1982. // CHECK:STDOUT: %tuple: %tuple.type.1 = tuple_value (%.loc10_19.6, %.loc10_19.11) [template = constants.%tuple.1]
  1983. // CHECK:STDOUT: %.loc10_13: %tuple.type.1 = converted %.loc10_19.1, %tuple [template = constants.%tuple.1]
  1984. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple.1) [template = constants.%C.3]
  1985. // CHECK:STDOUT: %c_bad.var: ref %C.3 = var c_bad
  1986. // CHECK:STDOUT: %c_bad: ref %C.3 = bind_name c_bad, %c_bad.var
  1987. // CHECK:STDOUT: }
  1988. // CHECK:STDOUT:
  1989. // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) {
  1990. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  1991. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)]
  1992. // CHECK:STDOUT:
  1993. // CHECK:STDOUT: !definition:
  1994. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
  1995. // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
  1996. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)]
  1997. // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)]
  1998. // CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.1)]
  1999. // CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.1) = assoc_entity element0, imports.%import_ref.11 [symbolic = %.2 (constants.%.2)]
  2000. // CHECK:STDOUT:
  2001. // CHECK:STDOUT: interface {
  2002. // CHECK:STDOUT: !members:
  2003. // CHECK:STDOUT: .Self = imports.%import_ref.5
  2004. // CHECK:STDOUT: .Convert = imports.%import_ref.6
  2005. // CHECK:STDOUT: witness = (imports.%import_ref.7)
  2006. // CHECK:STDOUT: }
  2007. // CHECK:STDOUT: }
  2008. // CHECK:STDOUT:
  2009. // CHECK:STDOUT: generic interface @As(constants.%Dest: type) {
  2010. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  2011. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)]
  2012. // CHECK:STDOUT:
  2013. // CHECK:STDOUT: !definition:
  2014. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)]
  2015. // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)]
  2016. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.7)]
  2017. // CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)]
  2018. // CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.7) [symbolic = %.1 (constants.%.9)]
  2019. // CHECK:STDOUT: %.2: @As.%.1 (%.9) = assoc_entity element0, imports.%import_ref.28 [symbolic = %.2 (constants.%.10)]
  2020. // CHECK:STDOUT:
  2021. // CHECK:STDOUT: interface {
  2022. // CHECK:STDOUT: !members:
  2023. // CHECK:STDOUT: .Self = imports.%import_ref.22
  2024. // CHECK:STDOUT: .Convert = imports.%import_ref.23
  2025. // CHECK:STDOUT: witness = (imports.%import_ref.24)
  2026. // CHECK:STDOUT: }
  2027. // CHECK:STDOUT: }
  2028. // CHECK:STDOUT:
  2029. // CHECK:STDOUT: generic impl @impl.1(constants.%N: Core.IntLiteral) {
  2030. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  2031. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  2032. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  2033. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3)]
  2034. // CHECK:STDOUT:
  2035. // CHECK:STDOUT: !definition:
  2036. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.1(%N) [symbolic = %Convert.type (constants.%Convert.type.2)]
  2037. // CHECK:STDOUT: %Convert: @impl.1.%Convert.type (%Convert.type.2) = struct_value () [symbolic = %Convert (constants.%Convert.2)]
  2038. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.3)]
  2039. // CHECK:STDOUT:
  2040. // CHECK:STDOUT: impl: imports.%import_ref.8 as imports.%import_ref.9 {
  2041. // CHECK:STDOUT: !members:
  2042. // CHECK:STDOUT: witness = imports.%import_ref.10
  2043. // CHECK:STDOUT: }
  2044. // CHECK:STDOUT: }
  2045. // CHECK:STDOUT:
  2046. // CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) {
  2047. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  2048. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  2049. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  2050. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)]
  2051. // CHECK:STDOUT:
  2052. // CHECK:STDOUT: !definition:
  2053. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)]
  2054. // CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)]
  2055. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.4)]
  2056. // CHECK:STDOUT:
  2057. // CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 {
  2058. // CHECK:STDOUT: !members:
  2059. // CHECK:STDOUT: witness = imports.%import_ref.14
  2060. // CHECK:STDOUT: }
  2061. // CHECK:STDOUT: }
  2062. // CHECK:STDOUT:
  2063. // CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) {
  2064. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  2065. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  2066. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  2067. // CHECK:STDOUT:
  2068. // CHECK:STDOUT: !definition:
  2069. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)]
  2070. // CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)]
  2071. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.5)]
  2072. // CHECK:STDOUT:
  2073. // CHECK:STDOUT: impl: imports.%import_ref.15 as imports.%import_ref.16 {
  2074. // CHECK:STDOUT: !members:
  2075. // CHECK:STDOUT: witness = imports.%import_ref.17
  2076. // CHECK:STDOUT: }
  2077. // CHECK:STDOUT: }
  2078. // CHECK:STDOUT:
  2079. // CHECK:STDOUT: generic impl @impl.4(constants.%N: Core.IntLiteral) {
  2080. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  2081. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  2082. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  2083. // CHECK:STDOUT:
  2084. // CHECK:STDOUT: !definition:
  2085. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.4(%N) [symbolic = %Convert.type (constants.%Convert.type.6)]
  2086. // CHECK:STDOUT: %Convert: @impl.4.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)]
  2087. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.8)]
  2088. // CHECK:STDOUT:
  2089. // CHECK:STDOUT: impl: imports.%import_ref.19 as imports.%import_ref.20 {
  2090. // CHECK:STDOUT: !members:
  2091. // CHECK:STDOUT: witness = imports.%import_ref.21
  2092. // CHECK:STDOUT: }
  2093. // CHECK:STDOUT: }
  2094. // CHECK:STDOUT:
  2095. // CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) {
  2096. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  2097. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  2098. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  2099. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%iN)> [symbolic = %As.type (constants.%As.type.3)]
  2100. // CHECK:STDOUT:
  2101. // CHECK:STDOUT: !definition:
  2102. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.8)]
  2103. // CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)]
  2104. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.11)]
  2105. // CHECK:STDOUT:
  2106. // CHECK:STDOUT: impl: imports.%import_ref.25 as imports.%import_ref.26 {
  2107. // CHECK:STDOUT: !members:
  2108. // CHECK:STDOUT: witness = imports.%import_ref.27
  2109. // CHECK:STDOUT: }
  2110. // CHECK:STDOUT: }
  2111. // CHECK:STDOUT:
  2112. // CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) {
  2113. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  2114. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  2115. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  2116. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%uN)> [symbolic = %As.type (constants.%As.type.4)]
  2117. // CHECK:STDOUT:
  2118. // CHECK:STDOUT: !definition:
  2119. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.9)]
  2120. // CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.9) = struct_value () [symbolic = %Convert (constants.%Convert.9)]
  2121. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.12)]
  2122. // CHECK:STDOUT:
  2123. // CHECK:STDOUT: impl: imports.%import_ref.29 as imports.%import_ref.30 {
  2124. // CHECK:STDOUT: !members:
  2125. // CHECK:STDOUT: witness = imports.%import_ref.31
  2126. // CHECK:STDOUT: }
  2127. // CHECK:STDOUT: }
  2128. // CHECK:STDOUT:
  2129. // CHECK:STDOUT: generic impl @impl.7(constants.%N: Core.IntLiteral) {
  2130. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  2131. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  2132. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  2133. // CHECK:STDOUT:
  2134. // CHECK:STDOUT: !definition:
  2135. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.7(%N) [symbolic = %Convert.type (constants.%Convert.type.10)]
  2136. // CHECK:STDOUT: %Convert: @impl.7.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)]
  2137. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.13)]
  2138. // CHECK:STDOUT:
  2139. // CHECK:STDOUT: impl: imports.%import_ref.32 as imports.%import_ref.33 {
  2140. // CHECK:STDOUT: !members:
  2141. // CHECK:STDOUT: witness = imports.%import_ref.34
  2142. // CHECK:STDOUT: }
  2143. // CHECK:STDOUT: }
  2144. // CHECK:STDOUT:
  2145. // CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) {
  2146. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  2147. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  2148. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  2149. // CHECK:STDOUT:
  2150. // CHECK:STDOUT: !definition:
  2151. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.12)]
  2152. // CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.12) = struct_value () [symbolic = %Convert (constants.%Convert.12)]
  2153. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.16)]
  2154. // CHECK:STDOUT:
  2155. // CHECK:STDOUT: impl: imports.%import_ref.36 as imports.%import_ref.37 {
  2156. // CHECK:STDOUT: !members:
  2157. // CHECK:STDOUT: witness = imports.%import_ref.38
  2158. // CHECK:STDOUT: }
  2159. // CHECK:STDOUT: }
  2160. // CHECK:STDOUT:
  2161. // CHECK:STDOUT: generic class @C(constants.%X: %tuple.type.1) {
  2162. // CHECK:STDOUT: %X: %tuple.type.1 = bind_symbolic_name X, 0 [symbolic = %X (constants.%X)]
  2163. // CHECK:STDOUT: %X.patt: %tuple.type.1 = symbolic_binding_pattern X, 0 [symbolic = %X.patt (constants.%X.patt)]
  2164. // CHECK:STDOUT:
  2165. // CHECK:STDOUT: !definition:
  2166. // CHECK:STDOUT:
  2167. // CHECK:STDOUT: class {
  2168. // CHECK:STDOUT: !members:
  2169. // CHECK:STDOUT: .Self = imports.%import_ref.39
  2170. // CHECK:STDOUT: }
  2171. // CHECK:STDOUT: }
  2172. // CHECK:STDOUT:
  2173. // CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) {
  2174. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  2175. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
  2176. // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
  2177. // CHECK:STDOUT:
  2178. // CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest);
  2179. // CHECK:STDOUT: }
  2180. // CHECK:STDOUT:
  2181. // CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) {
  2182. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  2183. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  2184. // CHECK:STDOUT:
  2185. // CHECK:STDOUT: !definition:
  2186. // CHECK:STDOUT:
  2187. // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%iN (%iN) = "int.convert_checked";
  2188. // CHECK:STDOUT: }
  2189. // CHECK:STDOUT:
  2190. // CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) {
  2191. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  2192. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  2193. // CHECK:STDOUT:
  2194. // CHECK:STDOUT: !definition:
  2195. // CHECK:STDOUT:
  2196. // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%uN (%uN) = "int.convert_checked";
  2197. // CHECK:STDOUT: }
  2198. // CHECK:STDOUT:
  2199. // CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) {
  2200. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  2201. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  2202. // CHECK:STDOUT:
  2203. // CHECK:STDOUT: !definition:
  2204. // CHECK:STDOUT:
  2205. // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked";
  2206. // CHECK:STDOUT: }
  2207. // CHECK:STDOUT:
  2208. // CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) {
  2209. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  2210. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  2211. // CHECK:STDOUT:
  2212. // CHECK:STDOUT: !definition:
  2213. // CHECK:STDOUT:
  2214. // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked";
  2215. // CHECK:STDOUT: }
  2216. // CHECK:STDOUT:
  2217. // CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) {
  2218. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  2219. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)]
  2220. // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)]
  2221. // CHECK:STDOUT:
  2222. // CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest);
  2223. // CHECK:STDOUT: }
  2224. // CHECK:STDOUT:
  2225. // CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) {
  2226. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  2227. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  2228. // CHECK:STDOUT:
  2229. // CHECK:STDOUT: !definition:
  2230. // CHECK:STDOUT:
  2231. // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%iN (%iN) = "int.convert_checked";
  2232. // CHECK:STDOUT: }
  2233. // CHECK:STDOUT:
  2234. // CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) {
  2235. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  2236. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  2237. // CHECK:STDOUT:
  2238. // CHECK:STDOUT: !definition:
  2239. // CHECK:STDOUT:
  2240. // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%uN (%uN) = "int.convert_checked";
  2241. // CHECK:STDOUT: }
  2242. // CHECK:STDOUT:
  2243. // CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) {
  2244. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  2245. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  2246. // CHECK:STDOUT:
  2247. // CHECK:STDOUT: !definition:
  2248. // CHECK:STDOUT:
  2249. // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked";
  2250. // CHECK:STDOUT: }
  2251. // CHECK:STDOUT:
  2252. // CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) {
  2253. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  2254. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  2255. // CHECK:STDOUT:
  2256. // CHECK:STDOUT: !definition:
  2257. // CHECK:STDOUT:
  2258. // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked";
  2259. // CHECK:STDOUT: }
  2260. // CHECK:STDOUT:
  2261. // CHECK:STDOUT: fn @F() -> %C.4;
  2262. // CHECK:STDOUT:
  2263. // CHECK:STDOUT: fn @__global_init() {
  2264. // CHECK:STDOUT: !entry:
  2265. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.4 [template = constants.%F]
  2266. // CHECK:STDOUT: %.loc10_25: ref %C.4 = temporary_storage
  2267. // CHECK:STDOUT: %F.call: init %C.4 = call %F.ref() to %.loc10_25
  2268. // CHECK:STDOUT: %.loc10_27: %C.3 = converted %F.call, <error> [template = <error>]
  2269. // CHECK:STDOUT: assign file.%c_bad.var, <error>
  2270. // CHECK:STDOUT: return
  2271. // CHECK:STDOUT: }
  2272. // CHECK:STDOUT:
  2273. // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
  2274. // CHECK:STDOUT: %Dest => constants.%Dest
  2275. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  2276. // CHECK:STDOUT: }
  2277. // CHECK:STDOUT:
  2278. // CHECK:STDOUT: specific @ImplicitAs(constants.%iN) {
  2279. // CHECK:STDOUT: %Dest => constants.%iN
  2280. // CHECK:STDOUT: %Dest.patt => constants.%iN
  2281. // CHECK:STDOUT: }
  2282. // CHECK:STDOUT:
  2283. // CHECK:STDOUT: specific @ImplicitAs(%Dest) {
  2284. // CHECK:STDOUT: %Dest => constants.%Dest
  2285. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  2286. // CHECK:STDOUT: }
  2287. // CHECK:STDOUT:
  2288. // CHECK:STDOUT: specific @ImplicitAs(@impl.1.%iN) {
  2289. // CHECK:STDOUT: %Dest => constants.%iN
  2290. // CHECK:STDOUT: %Dest.patt => constants.%iN
  2291. // CHECK:STDOUT: }
  2292. // CHECK:STDOUT:
  2293. // CHECK:STDOUT: specific @impl.1(constants.%N) {
  2294. // CHECK:STDOUT: %N => constants.%N
  2295. // CHECK:STDOUT: %N.patt => constants.%N
  2296. // CHECK:STDOUT: %iN => constants.%iN
  2297. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3
  2298. // CHECK:STDOUT: }
  2299. // CHECK:STDOUT:
  2300. // CHECK:STDOUT: specific @impl.1(%N) {
  2301. // CHECK:STDOUT: %N => constants.%N
  2302. // CHECK:STDOUT: %N.patt => constants.%N
  2303. // CHECK:STDOUT: %iN => constants.%iN
  2304. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3
  2305. // CHECK:STDOUT: }
  2306. // CHECK:STDOUT:
  2307. // CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) {
  2308. // CHECK:STDOUT: %Dest => constants.%Dest
  2309. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  2310. // CHECK:STDOUT: }
  2311. // CHECK:STDOUT:
  2312. // CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) {
  2313. // CHECK:STDOUT: %Dest => constants.%Dest
  2314. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2
  2315. // CHECK:STDOUT: %Self => constants.%Self.1
  2316. // CHECK:STDOUT: }
  2317. // CHECK:STDOUT:
  2318. // CHECK:STDOUT: specific @Convert.2(constants.%N) {
  2319. // CHECK:STDOUT: %N => constants.%N
  2320. // CHECK:STDOUT: %iN => constants.%iN
  2321. // CHECK:STDOUT: }
  2322. // CHECK:STDOUT:
  2323. // CHECK:STDOUT: specific @ImplicitAs(constants.%uN) {
  2324. // CHECK:STDOUT: %Dest => constants.%uN
  2325. // CHECK:STDOUT: %Dest.patt => constants.%uN
  2326. // CHECK:STDOUT: }
  2327. // CHECK:STDOUT:
  2328. // CHECK:STDOUT: specific @ImplicitAs(@impl.2.%uN) {
  2329. // CHECK:STDOUT: %Dest => constants.%uN
  2330. // CHECK:STDOUT: %Dest.patt => constants.%uN
  2331. // CHECK:STDOUT: }
  2332. // CHECK:STDOUT:
  2333. // CHECK:STDOUT: specific @impl.2(constants.%N) {
  2334. // CHECK:STDOUT: %N => constants.%N
  2335. // CHECK:STDOUT: %N.patt => constants.%N
  2336. // CHECK:STDOUT: %uN => constants.%uN
  2337. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4
  2338. // CHECK:STDOUT: }
  2339. // CHECK:STDOUT:
  2340. // CHECK:STDOUT: specific @impl.2(%N) {
  2341. // CHECK:STDOUT: %N => constants.%N
  2342. // CHECK:STDOUT: %N.patt => constants.%N
  2343. // CHECK:STDOUT: %uN => constants.%uN
  2344. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4
  2345. // CHECK:STDOUT: }
  2346. // CHECK:STDOUT:
  2347. // CHECK:STDOUT: specific @Convert.3(constants.%N) {
  2348. // CHECK:STDOUT: %N => constants.%N
  2349. // CHECK:STDOUT: %uN => constants.%uN
  2350. // CHECK:STDOUT: }
  2351. // CHECK:STDOUT:
  2352. // CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) {
  2353. // CHECK:STDOUT: %Dest => Core.IntLiteral
  2354. // CHECK:STDOUT: %Dest.patt => Core.IntLiteral
  2355. // CHECK:STDOUT:
  2356. // CHECK:STDOUT: !definition:
  2357. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5
  2358. // CHECK:STDOUT: %Self => constants.%Self.2
  2359. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5
  2360. // CHECK:STDOUT: %Convert => constants.%Convert.5
  2361. // CHECK:STDOUT: %.1 => constants.%.6
  2362. // CHECK:STDOUT: %.2 => constants.%.7
  2363. // CHECK:STDOUT: }
  2364. // CHECK:STDOUT:
  2365. // CHECK:STDOUT: specific @impl.3(constants.%N) {
  2366. // CHECK:STDOUT: %N => constants.%N
  2367. // CHECK:STDOUT: %N.patt => constants.%N
  2368. // CHECK:STDOUT: %iN => constants.%iN
  2369. // CHECK:STDOUT: }
  2370. // CHECK:STDOUT:
  2371. // CHECK:STDOUT: specific @impl.3(%N) {
  2372. // CHECK:STDOUT: %N => constants.%N
  2373. // CHECK:STDOUT: %N.patt => constants.%N
  2374. // CHECK:STDOUT: %iN => constants.%iN
  2375. // CHECK:STDOUT: }
  2376. // CHECK:STDOUT:
  2377. // CHECK:STDOUT: specific @Convert.4(constants.%N) {
  2378. // CHECK:STDOUT: %N => constants.%N
  2379. // CHECK:STDOUT: %iN => constants.%iN
  2380. // CHECK:STDOUT: }
  2381. // CHECK:STDOUT:
  2382. // CHECK:STDOUT: specific @impl.4(constants.%N) {
  2383. // CHECK:STDOUT: %N => constants.%N
  2384. // CHECK:STDOUT: %N.patt => constants.%N
  2385. // CHECK:STDOUT: %uN => constants.%uN
  2386. // CHECK:STDOUT: }
  2387. // CHECK:STDOUT:
  2388. // CHECK:STDOUT: specific @impl.4(%N) {
  2389. // CHECK:STDOUT: %N => constants.%N
  2390. // CHECK:STDOUT: %N.patt => constants.%N
  2391. // CHECK:STDOUT: %uN => constants.%uN
  2392. // CHECK:STDOUT: }
  2393. // CHECK:STDOUT:
  2394. // CHECK:STDOUT: specific @Convert.5(constants.%N) {
  2395. // CHECK:STDOUT: %N => constants.%N
  2396. // CHECK:STDOUT: %uN => constants.%uN
  2397. // CHECK:STDOUT: }
  2398. // CHECK:STDOUT:
  2399. // CHECK:STDOUT: specific @As(constants.%Dest) {
  2400. // CHECK:STDOUT: %Dest => constants.%Dest
  2401. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  2402. // CHECK:STDOUT: }
  2403. // CHECK:STDOUT:
  2404. // CHECK:STDOUT: specific @As(constants.%iN) {
  2405. // CHECK:STDOUT: %Dest => constants.%iN
  2406. // CHECK:STDOUT: %Dest.patt => constants.%iN
  2407. // CHECK:STDOUT: }
  2408. // CHECK:STDOUT:
  2409. // CHECK:STDOUT: specific @As(%Dest) {
  2410. // CHECK:STDOUT: %Dest => constants.%Dest
  2411. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  2412. // CHECK:STDOUT: }
  2413. // CHECK:STDOUT:
  2414. // CHECK:STDOUT: specific @As(@impl.5.%iN) {
  2415. // CHECK:STDOUT: %Dest => constants.%iN
  2416. // CHECK:STDOUT: %Dest.patt => constants.%iN
  2417. // CHECK:STDOUT: }
  2418. // CHECK:STDOUT:
  2419. // CHECK:STDOUT: specific @impl.5(constants.%N) {
  2420. // CHECK:STDOUT: %N => constants.%N
  2421. // CHECK:STDOUT: %N.patt => constants.%N
  2422. // CHECK:STDOUT: %iN => constants.%iN
  2423. // CHECK:STDOUT: %As.type => constants.%As.type.3
  2424. // CHECK:STDOUT: }
  2425. // CHECK:STDOUT:
  2426. // CHECK:STDOUT: specific @impl.5(%N) {
  2427. // CHECK:STDOUT: %N => constants.%N
  2428. // CHECK:STDOUT: %N.patt => constants.%N
  2429. // CHECK:STDOUT: %iN => constants.%iN
  2430. // CHECK:STDOUT: %As.type => constants.%As.type.3
  2431. // CHECK:STDOUT: }
  2432. // CHECK:STDOUT:
  2433. // CHECK:STDOUT: specific @As(@Convert.6.%Dest) {
  2434. // CHECK:STDOUT: %Dest => constants.%Dest
  2435. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  2436. // CHECK:STDOUT: }
  2437. // CHECK:STDOUT:
  2438. // CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) {
  2439. // CHECK:STDOUT: %Dest => constants.%Dest
  2440. // CHECK:STDOUT: %As.type => constants.%As.type.2
  2441. // CHECK:STDOUT: %Self => constants.%Self.3
  2442. // CHECK:STDOUT: }
  2443. // CHECK:STDOUT:
  2444. // CHECK:STDOUT: specific @Convert.7(constants.%N) {
  2445. // CHECK:STDOUT: %N => constants.%N
  2446. // CHECK:STDOUT: %iN => constants.%iN
  2447. // CHECK:STDOUT: }
  2448. // CHECK:STDOUT:
  2449. // CHECK:STDOUT: specific @As(constants.%uN) {
  2450. // CHECK:STDOUT: %Dest => constants.%uN
  2451. // CHECK:STDOUT: %Dest.patt => constants.%uN
  2452. // CHECK:STDOUT: }
  2453. // CHECK:STDOUT:
  2454. // CHECK:STDOUT: specific @As(@impl.6.%uN) {
  2455. // CHECK:STDOUT: %Dest => constants.%uN
  2456. // CHECK:STDOUT: %Dest.patt => constants.%uN
  2457. // CHECK:STDOUT: }
  2458. // CHECK:STDOUT:
  2459. // CHECK:STDOUT: specific @impl.6(constants.%N) {
  2460. // CHECK:STDOUT: %N => constants.%N
  2461. // CHECK:STDOUT: %N.patt => constants.%N
  2462. // CHECK:STDOUT: %uN => constants.%uN
  2463. // CHECK:STDOUT: %As.type => constants.%As.type.4
  2464. // CHECK:STDOUT: }
  2465. // CHECK:STDOUT:
  2466. // CHECK:STDOUT: specific @impl.6(%N) {
  2467. // CHECK:STDOUT: %N => constants.%N
  2468. // CHECK:STDOUT: %N.patt => constants.%N
  2469. // CHECK:STDOUT: %uN => constants.%uN
  2470. // CHECK:STDOUT: %As.type => constants.%As.type.4
  2471. // CHECK:STDOUT: }
  2472. // CHECK:STDOUT:
  2473. // CHECK:STDOUT: specific @Convert.8(constants.%N) {
  2474. // CHECK:STDOUT: %N => constants.%N
  2475. // CHECK:STDOUT: %uN => constants.%uN
  2476. // CHECK:STDOUT: }
  2477. // CHECK:STDOUT:
  2478. // CHECK:STDOUT: specific @As(Core.IntLiteral) {
  2479. // CHECK:STDOUT: %Dest => Core.IntLiteral
  2480. // CHECK:STDOUT: %Dest.patt => Core.IntLiteral
  2481. // CHECK:STDOUT:
  2482. // CHECK:STDOUT: !definition:
  2483. // CHECK:STDOUT: %As.type => constants.%As.type.5
  2484. // CHECK:STDOUT: %Self => constants.%Self.4
  2485. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.11
  2486. // CHECK:STDOUT: %Convert => constants.%Convert.11
  2487. // CHECK:STDOUT: %.1 => constants.%.14
  2488. // CHECK:STDOUT: %.2 => constants.%.15
  2489. // CHECK:STDOUT: }
  2490. // CHECK:STDOUT:
  2491. // CHECK:STDOUT: specific @impl.7(constants.%N) {
  2492. // CHECK:STDOUT: %N => constants.%N
  2493. // CHECK:STDOUT: %N.patt => constants.%N
  2494. // CHECK:STDOUT: %iN => constants.%iN
  2495. // CHECK:STDOUT: }
  2496. // CHECK:STDOUT:
  2497. // CHECK:STDOUT: specific @impl.7(%N) {
  2498. // CHECK:STDOUT: %N => constants.%N
  2499. // CHECK:STDOUT: %N.patt => constants.%N
  2500. // CHECK:STDOUT: %iN => constants.%iN
  2501. // CHECK:STDOUT: }
  2502. // CHECK:STDOUT:
  2503. // CHECK:STDOUT: specific @Convert.9(constants.%N) {
  2504. // CHECK:STDOUT: %N => constants.%N
  2505. // CHECK:STDOUT: %iN => constants.%iN
  2506. // CHECK:STDOUT: }
  2507. // CHECK:STDOUT:
  2508. // CHECK:STDOUT: specific @impl.8(constants.%N) {
  2509. // CHECK:STDOUT: %N => constants.%N
  2510. // CHECK:STDOUT: %N.patt => constants.%N
  2511. // CHECK:STDOUT: %uN => constants.%uN
  2512. // CHECK:STDOUT: }
  2513. // CHECK:STDOUT:
  2514. // CHECK:STDOUT: specific @impl.8(%N) {
  2515. // CHECK:STDOUT: %N => constants.%N
  2516. // CHECK:STDOUT: %N.patt => constants.%N
  2517. // CHECK:STDOUT: %uN => constants.%uN
  2518. // CHECK:STDOUT: }
  2519. // CHECK:STDOUT:
  2520. // CHECK:STDOUT: specific @Convert.10(constants.%N) {
  2521. // CHECK:STDOUT: %N => constants.%N
  2522. // CHECK:STDOUT: %uN => constants.%uN
  2523. // CHECK:STDOUT: }
  2524. // CHECK:STDOUT:
  2525. // CHECK:STDOUT: specific @C(constants.%X) {
  2526. // CHECK:STDOUT: %X => constants.%X
  2527. // CHECK:STDOUT: %X.patt => constants.%X
  2528. // CHECK:STDOUT: }
  2529. // CHECK:STDOUT:
  2530. // CHECK:STDOUT: specific @ImplicitAs(constants.%i32) {
  2531. // CHECK:STDOUT: %Dest => constants.%i32
  2532. // CHECK:STDOUT: %Dest.patt => constants.%i32
  2533. // CHECK:STDOUT:
  2534. // CHECK:STDOUT: !definition:
  2535. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6
  2536. // CHECK:STDOUT: %Self => constants.%Self.2
  2537. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.13
  2538. // CHECK:STDOUT: %Convert => constants.%Convert.13
  2539. // CHECK:STDOUT: %.1 => constants.%.23
  2540. // CHECK:STDOUT: %.2 => constants.%.24
  2541. // CHECK:STDOUT: }
  2542. // CHECK:STDOUT:
  2543. // CHECK:STDOUT: specific @impl.1(constants.%.19) {
  2544. // CHECK:STDOUT: %N => constants.%.19
  2545. // CHECK:STDOUT: %N.patt => constants.%.19
  2546. // CHECK:STDOUT: %iN => constants.%i32
  2547. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.6
  2548. // CHECK:STDOUT:
  2549. // CHECK:STDOUT: !definition:
  2550. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.14
  2551. // CHECK:STDOUT: %Convert => constants.%Convert.14
  2552. // CHECK:STDOUT: %.1 => constants.%.26
  2553. // CHECK:STDOUT: }
  2554. // CHECK:STDOUT:
  2555. // CHECK:STDOUT: specific @Convert.2(constants.%.19) {
  2556. // CHECK:STDOUT: %N => constants.%.19
  2557. // CHECK:STDOUT: %iN => constants.%i32
  2558. // CHECK:STDOUT:
  2559. // CHECK:STDOUT: !definition:
  2560. // CHECK:STDOUT: }
  2561. // CHECK:STDOUT:
  2562. // CHECK:STDOUT: specific @C(constants.%tuple.1) {
  2563. // CHECK:STDOUT: %X => constants.%tuple.1
  2564. // CHECK:STDOUT: %X.patt => constants.%tuple.1
  2565. // CHECK:STDOUT:
  2566. // CHECK:STDOUT: !definition:
  2567. // CHECK:STDOUT: }
  2568. // CHECK:STDOUT:
  2569. // CHECK:STDOUT: specific @C(constants.%tuple.2) {
  2570. // CHECK:STDOUT: %X => constants.%tuple.2
  2571. // CHECK:STDOUT: %X.patt => constants.%tuple.2
  2572. // CHECK:STDOUT:
  2573. // CHECK:STDOUT: !definition:
  2574. // CHECK:STDOUT: }
  2575. // CHECK:STDOUT:
  2576. // CHECK:STDOUT: specific @ImplicitAs(constants.%C.3) {
  2577. // CHECK:STDOUT: %Dest => constants.%C.3
  2578. // CHECK:STDOUT: %Dest.patt => constants.%C.3
  2579. // CHECK:STDOUT:
  2580. // CHECK:STDOUT: !definition:
  2581. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.7
  2582. // CHECK:STDOUT: %Self => constants.%Self.2
  2583. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.15
  2584. // CHECK:STDOUT: %Convert => constants.%Convert.15
  2585. // CHECK:STDOUT: %.1 => constants.%.36
  2586. // CHECK:STDOUT: %.2 => constants.%.37
  2587. // CHECK:STDOUT: }
  2588. // CHECK:STDOUT: