import.carbon 147 KB

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