import.carbon 146 KB

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