operators.carbon 216 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon
  6. // EXTRA-ARGS: --target=x86_64-linux-gnu --clang-arg=-std=c++20
  7. //
  8. // AUTOUPDATE
  9. // TIP: To test this file alone, run:
  10. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/operators.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/operators.carbon
  13. // ============================================================================
  14. // Unary operators
  15. // ============================================================================
  16. // --- unary_operators.h
  17. class C {};
  18. // Increment and Decrement.
  19. // TODO: Change return value to reference when it is supported.
  20. auto operator++(C& operand) -> C;
  21. auto operator--(C& operand) -> C;
  22. // Arithmetic.
  23. auto operator-(C operand) -> C;
  24. // --- import_unary_operators.carbon
  25. library "[[@TEST_NAME]]";
  26. import Cpp library "unary_operators.h";
  27. fn F() {
  28. //@dump-sem-ir-begin
  29. var c: Cpp.C = Cpp.C.C();
  30. // Increment and Decrement.
  31. ++c;
  32. --c;
  33. // Arithmetic.
  34. let minus: Cpp.C = -c;
  35. //@dump-sem-ir-end
  36. }
  37. // ============================================================================
  38. // Prefix increment and decrement vs postfix increment and decrement
  39. // ============================================================================
  40. // --- prefix_inc_and_dec.h
  41. class Prefix {};
  42. // TODO: Change return value to reference when it is supported.
  43. auto operator++(Prefix& operand) -> Prefix;
  44. auto operator--(Prefix& operand) -> Prefix;
  45. // --- fail_prefix_calling_postfix.carbon
  46. library "[[@TEST_NAME]]";
  47. import Cpp library "prefix_inc_and_dec.h";
  48. fn F() {
  49. var prefix: Cpp.Prefix = Cpp.Prefix.Prefix();
  50. // CHECK:STDERR: fail_prefix_calling_postfix.carbon:[[@LINE+8]]:9: error: expected `;` after expression statement [ExpectedExprSemi]
  51. // CHECK:STDERR: prefix++;
  52. // CHECK:STDERR: ^~
  53. // CHECK:STDERR:
  54. // CHECK:STDERR: fail_prefix_calling_postfix.carbon:[[@LINE+4]]:3: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
  55. // CHECK:STDERR: prefix++;
  56. // CHECK:STDERR: ^~~~~~~~~
  57. // CHECK:STDERR:
  58. prefix++;
  59. // CHECK:STDERR: fail_prefix_calling_postfix.carbon:[[@LINE+4]]:9: error: expected `;` after expression statement [ExpectedExprSemi]
  60. // CHECK:STDERR: prefix--;
  61. // CHECK:STDERR: ^~
  62. // CHECK:STDERR:
  63. prefix--;
  64. }
  65. // --- postfix_inc_and_dec.h
  66. class Postfix {};
  67. // TODO: Change return value to reference when it is supported.
  68. auto operator++(Postfix& operand, int) -> Postfix;
  69. auto operator--(Postfix& operand, int) -> Postfix;
  70. // --- fail_postfix_calling_prefix.carbon
  71. library "[[@TEST_NAME]]";
  72. import Cpp library "postfix_inc_and_dec.h";
  73. fn F() {
  74. var postfix: Cpp.Postfix = Cpp.Postfix.Postfix();
  75. // CHECK:STDERR: fail_postfix_calling_prefix.carbon:[[@LINE+8]]:3: error: no matching function for call to '<C++ operator>' [CppInteropParseError]
  76. // CHECK:STDERR: 16 | ++postfix;
  77. // CHECK:STDERR: | ^
  78. // CHECK:STDERR: fail_postfix_calling_prefix.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
  79. // CHECK:STDERR: ./postfix_inc_and_dec.h:4:6: note: candidate function not viable: requires 2 arguments, but 1 was provided [CppInteropParseNote]
  80. // CHECK:STDERR: 4 | auto operator++(Postfix& operand, int) -> Postfix;
  81. // CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~
  82. // CHECK:STDERR:
  83. ++postfix;
  84. // CHECK:STDERR: fail_postfix_calling_prefix.carbon:[[@LINE+8]]:3: error: no matching function for call to '<C++ operator>' [CppInteropParseError]
  85. // CHECK:STDERR: 25 | --postfix;
  86. // CHECK:STDERR: | ^
  87. // CHECK:STDERR: fail_postfix_calling_prefix.carbon:[[@LINE-16]]:10: in file included here [InCppInclude]
  88. // CHECK:STDERR: ./postfix_inc_and_dec.h:5:6: note: candidate function not viable: requires 2 arguments, but 1 was provided [CppInteropParseNote]
  89. // CHECK:STDERR: 5 | auto operator--(Postfix& operand, int) -> Postfix;
  90. // CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~
  91. // CHECK:STDERR:
  92. --postfix;
  93. }
  94. // ============================================================================
  95. // Binary operators
  96. // ============================================================================
  97. // --- binary_operators.h
  98. class C {};
  99. // Arithmetic.
  100. auto operator+(C lhs, C rhs) -> C;
  101. auto operator-(C lhs, C rhs) -> C;
  102. auto operator*(C lhs, C rhs) -> C;
  103. auto operator/(C lhs, C rhs) -> C;
  104. auto operator%(C lhs, C rhs) -> C;
  105. // Bitwise.
  106. auto operator&(C lhs, C rhs) -> C;
  107. auto operator|(C lhs, C rhs) -> C;
  108. auto operator^(C lhs, C rhs) -> C;
  109. auto operator<<(C lhs, int num_bits) -> C;
  110. auto operator>>(C lhs, int num_bits) -> C;
  111. // Compound Assignment Arithmetic.
  112. // TODO: Change the return value to reference when it is supported.
  113. auto operator+=(C& lhs, C rhs) -> C;
  114. auto operator-=(C& lhs, C rhs) -> C;
  115. auto operator*=(C& lhs, C rhs) -> C;
  116. auto operator/=(C& lhs, C rhs) -> C;
  117. auto operator%=(C& lhs, C rhs) -> C;
  118. // Compound Assignment Bitwuse.
  119. // TODO: Change the return value to reference when it is supported.
  120. auto operator&=(C& lhs, C rhs) -> C;
  121. auto operator|=(C& lhs, C rhs) -> C;
  122. auto operator^=(C& lhs, C rhs) -> C;
  123. // TODO: Add <<= and >>= when references are supported.
  124. // Relational.
  125. auto operator==(C lhs, C rhs) -> bool;
  126. auto operator!=(C lhs, C rhs) -> bool;
  127. auto operator<(C lhs, C rhs) -> bool;
  128. auto operator>(C lhs, C rhs) -> bool;
  129. auto operator<=(C lhs, C rhs) -> bool;
  130. auto operator>=(C lhs, C rhs) -> bool;
  131. // --- import_binary_operators.carbon
  132. library "[[@TEST_NAME]]";
  133. import Cpp library "binary_operators.h";
  134. fn F() {
  135. //@dump-sem-ir-begin
  136. var c1: Cpp.C = Cpp.C.C();
  137. var c2: Cpp.C = Cpp.C.C();
  138. // Arithmetic.
  139. let addition: Cpp.C = c1 + c2;
  140. let subtraction: Cpp.C = c1 - c2;
  141. let multiplication: Cpp.C = c1 * c2;
  142. let division: Cpp.C = c1 / c2;
  143. let modulo: Cpp.C = c1 % c2;
  144. // Bitwise.
  145. let bitwise_and: Cpp.C = c1 & c2;
  146. let bitwise_or: Cpp.C = c1 | c2;
  147. let bitwise_xor: Cpp.C = c1 ^ c2;
  148. let left_shift: Cpp.C = c1 << 3;
  149. let right_shift: Cpp.C = c1 >> 5;
  150. // Compound Assignment Arithmetic.
  151. c1 += c2;
  152. c1 -= c2;
  153. c1 *= c2;
  154. c1 /= c2;
  155. c1 %= c2;
  156. // Compound Assignment Bitwise.
  157. c1 &= c2;
  158. c1 |= c2;
  159. c1 ^= c2;
  160. // Relational.
  161. let equal: bool = c1 == c2;
  162. let not_equal: bool = c1 != c2;
  163. let greater_than: bool = c1 > c2;
  164. let less_than: bool = c1 < c2;
  165. let greater_than_or_equal: bool = c1 >= c2;
  166. let less_than_or_equal: bool = c1 <= c2;
  167. //@dump-sem-ir-end
  168. }
  169. // --- multiple_calls.carbon
  170. library "[[@TEST_NAME]]";
  171. import Cpp library "binary_operators.h";
  172. fn F() {
  173. //@dump-sem-ir-begin
  174. let c1: Cpp.C = Cpp.C.C();
  175. let c2: Cpp.C = Cpp.C.C();
  176. let c3: Cpp.C = c1 + c2;
  177. let c4: Cpp.C = c1 + c3;
  178. let c5: Cpp.C = c4 + c3;
  179. //@dump-sem-ir-end
  180. }
  181. // --- fail_call_with_wrong_type.carbon
  182. library "[[@TEST_NAME]]";
  183. import Cpp library "binary_operators.h";
  184. fn F() {
  185. let c1: Cpp.C = Cpp.C.C();
  186. // CHECK:STDERR: fail_call_with_wrong_type.carbon:[[@LINE+8]]:22: error: no matching function for call to '<C++ operator>' [CppInteropParseError]
  187. // CHECK:STDERR: 16 | let c2: Cpp.C = c1 + 5;
  188. // CHECK:STDERR: | ^
  189. // CHECK:STDERR: fail_call_with_wrong_type.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
  190. // CHECK:STDERR: ./binary_operators.h:5:6: note: candidate function not viable: no known conversion from 'int' to 'C' for 2nd argument [CppInteropParseNote]
  191. // CHECK:STDERR: 5 | auto operator+(C lhs, C rhs) -> C;
  192. // CHECK:STDERR: | ^ ~~~~~
  193. // CHECK:STDERR:
  194. let c2: Cpp.C = c1 + 5;
  195. // CHECK:STDERR: fail_call_with_wrong_type.carbon:[[@LINE+8]]:21: error: no matching function for call to '<C++ operator>' [CppInteropParseError]
  196. // CHECK:STDERR: 25 | let c3: Cpp.C = 6 + c1;
  197. // CHECK:STDERR: | ^
  198. // CHECK:STDERR: fail_call_with_wrong_type.carbon:[[@LINE-16]]:10: in file included here [InCppInclude]
  199. // CHECK:STDERR: ./binary_operators.h:5:6: note: candidate function not viable: no known conversion from 'int' to 'C' for 1st argument [CppInteropParseNote]
  200. // CHECK:STDERR: 5 | auto operator+(C lhs, C rhs) -> C;
  201. // CHECK:STDERR: | ^ ~~~~~
  202. // CHECK:STDERR:
  203. let c3: Cpp.C = 6 + c1;
  204. }
  205. // ============================================================================
  206. // Rewrite using the spaceship operator
  207. // ============================================================================
  208. // --- fail_todo_rewrite_spaceship.carbon
  209. library "[[@TEST_NAME]]";
  210. import Cpp inline '''
  211. class C {};
  212. namespace std { class strong_ordering {}; }
  213. auto operator<=>(C lhs, C rhs) -> std::strong_ordering;
  214. auto operator>(C lhs, C rhs) -> bool;
  215. auto operator<=(C lhs, C rhs) -> bool;
  216. ''';
  217. fn F() {
  218. //@dump-sem-ir-begin
  219. var c1: Cpp.C = Cpp.C.C();
  220. var c2: Cpp.C = Cpp.C.C();
  221. // No rewrite.
  222. let greater_than: bool = c1 > c2;
  223. // Rewrite.
  224. // CHECK:STDERR: fail_todo_rewrite_spaceship.carbon:[[@LINE+4]]:25: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
  225. // CHECK:STDERR: let less_than: bool = c1 < c2;
  226. // CHECK:STDERR: ^~~~~~~
  227. // CHECK:STDERR:
  228. let less_than: bool = c1 < c2;
  229. // Rewrite.
  230. // CHECK:STDERR: fail_todo_rewrite_spaceship.carbon:[[@LINE+4]]:37: error: semantics TODO: `Rewriting operator>= using operator<=> is not supported` [SemanticsTodo]
  231. // CHECK:STDERR: let greater_than_or_equal: bool = c1 >= c2;
  232. // CHECK:STDERR: ^~~~~~~~
  233. // CHECK:STDERR:
  234. let greater_than_or_equal: bool = c1 >= c2;
  235. // No rewrite.
  236. let less_than_or_equal: bool = c1 <= c2;
  237. //@dump-sem-ir-end
  238. }
  239. // ============================================================================
  240. // Rewrite using the equal operator
  241. // ============================================================================
  242. // --- fail_todo_rewrite_equal.carbon
  243. library "[[@TEST_NAME]]";
  244. import Cpp inline '''
  245. class C {};
  246. auto operator==(C lhs, C rhs) -> bool;
  247. ''';
  248. fn F() {
  249. //@dump-sem-ir-begin
  250. var c1: Cpp.C = Cpp.C.C();
  251. var c2: Cpp.C = Cpp.C.C();
  252. // No rewrite.
  253. let equal: bool = c1 == c2;
  254. // Rewrite.
  255. // CHECK:STDERR: fail_todo_rewrite_equal.carbon:[[@LINE+4]]:25: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
  256. // CHECK:STDERR: let not_equal: bool = c1 != c2;
  257. // CHECK:STDERR: ^~~~~~~~
  258. // CHECK:STDERR:
  259. let not_equal: bool = c1 != c2;
  260. //@dump-sem-ir-end
  261. }
  262. // ============================================================================
  263. // One of two operands conversion
  264. // ============================================================================
  265. // --- plus_with_int_conversion.h
  266. class C {
  267. public:
  268. C(int);
  269. };
  270. auto operator+(C lhs, C rhs) -> C;
  271. // --- fail_todo_plus_with_int_conversion.carbon
  272. library "[[@TEST_NAME]]";
  273. import Cpp library "plus_with_int_conversion.h";
  274. fn F() {
  275. let c1: Cpp.C = Cpp.C.C(4);
  276. // CHECK:STDERR: fail_todo_plus_with_int_conversion.carbon:[[@LINE+8]]:24: error: cannot implicitly convert expression of type `Core.IntLiteral` to `Cpp.C` [ConversionFailure]
  277. // CHECK:STDERR: let c2: Cpp.C = c1 + 5;
  278. // CHECK:STDERR: ^
  279. // CHECK:STDERR: fail_todo_plus_with_int_conversion.carbon:[[@LINE+5]]:24: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(Cpp.C)` [MissingImplInMemberAccessNote]
  280. // CHECK:STDERR: let c2: Cpp.C = c1 + 5;
  281. // CHECK:STDERR: ^
  282. // CHECK:STDERR: fail_todo_plus_with_int_conversion.carbon: note: initializing function parameter [InCallToFunctionParam]
  283. // CHECK:STDERR:
  284. let c2: Cpp.C = c1 + 5;
  285. // CHECK:STDERR: fail_todo_plus_with_int_conversion.carbon:[[@LINE+8]]:19: error: cannot implicitly convert expression of type `Core.IntLiteral` to `Cpp.C` [ConversionFailure]
  286. // CHECK:STDERR: let c3: Cpp.C = 6 + c1;
  287. // CHECK:STDERR: ^
  288. // CHECK:STDERR: fail_todo_plus_with_int_conversion.carbon:[[@LINE+5]]:19: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(Cpp.C)` [MissingImplInMemberAccessNote]
  289. // CHECK:STDERR: let c3: Cpp.C = 6 + c1;
  290. // CHECK:STDERR: ^
  291. // CHECK:STDERR: fail_todo_plus_with_int_conversion.carbon: note: initializing function parameter [InCallToFunctionParam]
  292. // CHECK:STDERR:
  293. let c3: Cpp.C = 6 + c1;
  294. }
  295. // ============================================================================
  296. // All operands conversion
  297. // ============================================================================
  298. // --- plus_with_string_view_conversion.h
  299. namespace std {
  300. using size_t = __SIZE_TYPE__;
  301. inline namespace __1 {
  302. template<typename T> struct char_traits {};
  303. template<typename CharT, typename Traits = char_traits<CharT>>
  304. class basic_string_view {
  305. public:
  306. basic_string_view() = default;
  307. size_t size() const { return size_; }
  308. private:
  309. const CharT* data_;
  310. size_t size_;
  311. };
  312. using string_view = basic_string_view<char>;
  313. }
  314. }
  315. class C {
  316. public:
  317. C(std::string_view s);
  318. };
  319. auto operator+(C lhs, C rhs) -> C;
  320. // --- fail_todo_import_plus_with_string_view_conversion.carbon
  321. library "[[@TEST_NAME]]";
  322. import Cpp library "plus_with_string_view_conversion.h";
  323. fn F() {
  324. let s1: str = "hello";
  325. let s2: str = "world";
  326. // CHECK:STDERR: fail_todo_import_plus_with_string_view_conversion.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.AddWith(str)` in type `str` that does not implement that interface [MissingImplInMemberAccess]
  327. // CHECK:STDERR: let c: Cpp.C = s1 + s2;
  328. // CHECK:STDERR: ^~~~~~~
  329. // CHECK:STDERR:
  330. let c: Cpp.C = s1 + s2;
  331. }
  332. // ============================================================================
  333. // Unsupported unary operators
  334. // ============================================================================
  335. // --- unsupported_unary_operators.h
  336. class C {};
  337. // Arithmetic.
  338. auto operator+(C operand) -> C;
  339. // Increment and Decrement.
  340. // TODO: Change the return value to reference when it is supported.
  341. auto operator++(C& operand, int) -> C;
  342. auto operator--(C& operand, int) -> C;
  343. // Bitwise.
  344. auto operator~(C operand) -> C;
  345. // Logical.
  346. auto operator!(C operand) -> C;
  347. // Pointer and Memory.
  348. class P {
  349. public:
  350. auto foo() -> P;
  351. auto operator->() const -> P* _Nonnull;
  352. };
  353. auto operator*(P operand) -> P;
  354. auto operator&(P operand) -> P;
  355. // --- fail_todo_import_unsupported_unary_operators.carbon
  356. library "[[@TEST_NAME]]";
  357. import Cpp library "unsupported_unary_operators.h";
  358. fn F() {
  359. var c: Cpp.C = Cpp.C.C();
  360. // Arithmetic.
  361. // CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+12]]:21: error: expected expression [ExpectedExpr]
  362. // CHECK:STDERR: let plus: Cpp.C = +c;
  363. // CHECK:STDERR: ^
  364. // CHECK:STDERR:
  365. // CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+8]]:21: error: whitespace missing after binary operator [BinaryOperatorRequiresWhitespace]
  366. // CHECK:STDERR: let plus: Cpp.C = +c;
  367. // CHECK:STDERR: ^
  368. // CHECK:STDERR:
  369. // CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:21: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
  370. // CHECK:STDERR: let plus: Cpp.C = +c;
  371. // CHECK:STDERR: ^
  372. // CHECK:STDERR:
  373. let plus: Cpp.C = +c;
  374. // Increment and Decrement.
  375. // CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:4: error: expected `;` after expression statement [ExpectedExprSemi]
  376. // CHECK:STDERR: c++;
  377. // CHECK:STDERR: ^~
  378. // CHECK:STDERR:
  379. c++;
  380. // CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:4: error: expected `;` after expression statement [ExpectedExprSemi]
  381. // CHECK:STDERR: c--;
  382. // CHECK:STDERR: ^~
  383. // CHECK:STDERR:
  384. c--;
  385. // Bitwise.
  386. // CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+8]]:26: error: expected expression [ExpectedExpr]
  387. // CHECK:STDERR: let not_value: Cpp.C = ~c;
  388. // CHECK:STDERR: ^
  389. // CHECK:STDERR:
  390. // CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:26: error: `let` declarations must end with a `;` [ExpectedDeclSemi]
  391. // CHECK:STDERR: let not_value: Cpp.C = ~c;
  392. // CHECK:STDERR: ^
  393. // CHECK:STDERR:
  394. let not_value: Cpp.C = ~c;
  395. // Logical.
  396. // CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:35: error: `let` declarations must end with a `;` [ExpectedDeclSemi]
  397. // CHECK:STDERR: let not_result: Cpp.C = operator!(c1);
  398. // CHECK:STDERR: ^
  399. // CHECK:STDERR:
  400. let not_result: Cpp.C = operator!(c1);
  401. // Pointer and Memory.
  402. var p: Cpp.P = Cpp.P.P();
  403. // Pointer and Memory.
  404. let dereference: Cpp.P = *p;
  405. let address: Cpp.P = operator&(p);
  406. let call_result: Cpp.P = p->foo();
  407. }
  408. // ============================================================================
  409. // Unsupported binary operators
  410. // ============================================================================
  411. // --- unsupported_binary_operators.h
  412. class C {};
  413. // Bitwise.
  414. // TODO: Change the return value to reference when it is supported.
  415. auto operator<<=(C& lhs, int num_bits) -> C;
  416. auto operator>>=(C& lhs, int num_bits) -> C;
  417. // Logical.
  418. auto operator&&(C lhs, C rhs) -> C;
  419. auto operator||(C lhs, C rhs) -> C;
  420. // --- fail_todo_import_unsupported_binary_operators.carbon
  421. library "[[@TEST_NAME]]";
  422. import Cpp library "unsupported_binary_operators.h";
  423. fn F() {
  424. var c1: Cpp.C = Cpp.C.C();
  425. // Bitwise.
  426. // CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+8]]:3: error: semantics TODO: `Unsupported operator interface `LeftShiftAssignWith`` [SemanticsTodo]
  427. // CHECK:STDERR: c1 <<= 1;
  428. // CHECK:STDERR: ^~~~~~~~
  429. // CHECK:STDERR:
  430. // CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.LeftShiftAssignWith(Core.IntLiteral)` in type `Cpp.C` that does not implement that interface [MissingImplInMemberAccess]
  431. // CHECK:STDERR: c1 <<= 1;
  432. // CHECK:STDERR: ^~~~~~~~
  433. // CHECK:STDERR:
  434. c1 <<= 1;
  435. // CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+8]]:3: error: semantics TODO: `Unsupported operator interface `RightShiftAssignWith`` [SemanticsTodo]
  436. // CHECK:STDERR: c1 >>= 2;
  437. // CHECK:STDERR: ^~~~~~~~
  438. // CHECK:STDERR:
  439. // CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.RightShiftAssignWith(Core.IntLiteral)` in type `Cpp.C` that does not implement that interface [MissingImplInMemberAccess]
  440. // CHECK:STDERR: c1 >>= 2;
  441. // CHECK:STDERR: ^~~~~~~~
  442. // CHECK:STDERR:
  443. c1 >>= 2;
  444. // Logical.
  445. // CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+16]]:27: error: name `operator` not found [NameNotFound]
  446. // CHECK:STDERR: let and_result: Cpp.C = operator&&(c1, c2);
  447. // CHECK:STDERR: ^~~~~~~~
  448. // CHECK:STDERR:
  449. // CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+12]]:35: error: whitespace missing around binary operator [BinaryOperatorRequiresWhitespace]
  450. // CHECK:STDERR: let and_result: Cpp.C = operator&&(c1, c2);
  451. // CHECK:STDERR: ^
  452. // CHECK:STDERR:
  453. // CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+8]]:42: error: name `c2` not found [NameNotFound]
  454. // CHECK:STDERR: let and_result: Cpp.C = operator&&(c1, c2);
  455. // CHECK:STDERR: ^~
  456. // CHECK:STDERR:
  457. // CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+4]]:36: error: cannot take the address of non-reference expression [AddrOfNonRef]
  458. // CHECK:STDERR: let and_result: Cpp.C = operator&&(c1, c2);
  459. // CHECK:STDERR: ^
  460. // CHECK:STDERR:
  461. let and_result: Cpp.C = operator&&(c1, c2);
  462. // CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+20]]:26: error: name `operator` not found [NameNotFound]
  463. // CHECK:STDERR: let or_result: Cpp.C = operator||(c1, c2);
  464. // CHECK:STDERR: ^~~~~~~~
  465. // CHECK:STDERR:
  466. // CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+16]]:34: error: whitespace missing around binary operator [BinaryOperatorRequiresWhitespace]
  467. // CHECK:STDERR: let or_result: Cpp.C = operator||(c1, c2);
  468. // CHECK:STDERR: ^
  469. // CHECK:STDERR:
  470. // CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+12]]:35: error: expected expression [ExpectedExpr]
  471. // CHECK:STDERR: let or_result: Cpp.C = operator||(c1, c2);
  472. // CHECK:STDERR: ^
  473. // CHECK:STDERR:
  474. // CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+8]]:35: error: whitespace missing around binary operator [BinaryOperatorRequiresWhitespace]
  475. // CHECK:STDERR: let or_result: Cpp.C = operator||(c1, c2);
  476. // CHECK:STDERR: ^
  477. // CHECK:STDERR:
  478. // CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+4]]:35: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
  479. // CHECK:STDERR: let or_result: Cpp.C = operator||(c1, c2);
  480. // CHECK:STDERR: ^
  481. // CHECK:STDERR:
  482. let or_result: Cpp.C = operator||(c1, c2);
  483. }
  484. // ============================================================================
  485. // Operator and operands in a single namespace
  486. // ============================================================================
  487. // --- single_namespace.h
  488. namespace N {
  489. class C {};
  490. auto operator+(C lhs, C rhs) -> C;
  491. } // namespace N
  492. // --- import_single_namespace.carbon
  493. library "[[@TEST_NAME]]";
  494. import Cpp library "single_namespace.h";
  495. fn F() {
  496. //@dump-sem-ir-begin
  497. let c1: Cpp.N.C = Cpp.N.C.C();
  498. let c2: Cpp.N.C = Cpp.N.C.C();
  499. let c3: Cpp.N.C = c1 + c2;
  500. //@dump-sem-ir-end
  501. }
  502. // ============================================================================
  503. // Operator and operands in a different namespaces
  504. // ============================================================================
  505. // --- multiple_namespaces.h
  506. namespace N1 {
  507. class C1 {};
  508. } // namespace N1
  509. namespace N2 {
  510. class C2 {};
  511. auto operator+(N1::C1 lhs, C2 rhs) -> C2;
  512. auto operator-(C2 lhs, N1::C1 rhs) -> C2;
  513. } // namespace N2
  514. // --- import_multiple_namespaces.carbon
  515. library "[[@TEST_NAME]]";
  516. import Cpp library "multiple_namespaces.h";
  517. fn F() {
  518. //@dump-sem-ir-begin
  519. let c1: Cpp.N1.C1 = Cpp.N1.C1.C1();
  520. let c2: Cpp.N2.C2 = Cpp.N2.C2.C2();
  521. let c3: Cpp.N2.C2 = c1 + c2;
  522. let c4: Cpp.N2.C2 = c2 - c1;
  523. //@dump-sem-ir-end
  524. }
  525. // ============================================================================
  526. // Operands in namespace, operator in global namespace
  527. // ============================================================================
  528. // --- operands_in_namespace_operator_in_global.h
  529. namespace N {
  530. class C {};
  531. } // namespace N
  532. auto operator+(N::C lhs, N::C rhs) -> N::C;
  533. void foo() {
  534. N::C() + N::C();
  535. }
  536. // --- fail_todo_import_operands_in_namespace_operator_in_global.carbon
  537. library "[[@TEST_NAME]]";
  538. import Cpp library "operands_in_namespace_operator_in_global.h";
  539. fn F() {
  540. //@dump-sem-ir-begin
  541. let c1: Cpp.N.C = Cpp.N.C.C();
  542. let c2: Cpp.N.C = Cpp.N.C.C();
  543. // CHECK:STDERR: fail_todo_import_operands_in_namespace_operator_in_global.carbon:[[@LINE+4]]:24: error: no matching function for call to '<C++ operator>' [CppInteropParseError]
  544. // CHECK:STDERR: 14 | let c3: Cpp.N.C = c1 + c2;
  545. // CHECK:STDERR: | ^
  546. // CHECK:STDERR:
  547. let c3: Cpp.N.C = c1 + c2;
  548. //@dump-sem-ir-end
  549. }
  550. // ============================================================================
  551. // Operand is an inner class
  552. // ============================================================================
  553. // --- inner_class.h
  554. class O {
  555. public:
  556. class C {};
  557. };
  558. auto operator+(O::C lhs, O::C rhs) -> O::C;
  559. // --- import_inner_class.carbon
  560. library "[[@TEST_NAME]]";
  561. import Cpp library "inner_class.h";
  562. fn F() {
  563. //@dump-sem-ir-begin
  564. let c1: Cpp.O.C = Cpp.O.C.C();
  565. let c2: Cpp.O.C = Cpp.O.C.C();
  566. let c3: Cpp.O.C = c1 + c2;
  567. //@dump-sem-ir-end
  568. }
  569. // ============================================================================
  570. // Operand is an inner class in a namespace
  571. // ============================================================================
  572. // --- inner_class_in_namespace.h
  573. namespace N {
  574. class O {
  575. public:
  576. class C {};
  577. };
  578. auto operator+(O::C lhs, O::C rhs) -> O::C;
  579. } // namespace N
  580. // --- import_inner_class_in_namespace.carbon
  581. library "[[@TEST_NAME]]";
  582. import Cpp library "inner_class_in_namespace.h";
  583. fn F() {
  584. //@dump-sem-ir-begin
  585. let c1: Cpp.N.O.C = Cpp.N.O.C.C();
  586. let c2: Cpp.N.O.C = Cpp.N.O.C.C();
  587. let c3: Cpp.N.O.C = c1 + c2;
  588. //@dump-sem-ir-end
  589. }
  590. // ============================================================================
  591. // Member operator
  592. // ============================================================================
  593. // --- member_add_with.h
  594. class C {
  595. public:
  596. // Unary.
  597. auto operator-() -> C;
  598. // Binary.
  599. auto operator+(C rhs) -> C;
  600. };
  601. // --- import_member_add_with.carbon
  602. library "[[@TEST_NAME]]";
  603. import Cpp library "member_add_with.h";
  604. fn F() {
  605. //@dump-sem-ir-begin
  606. var c1: Cpp.C = Cpp.C.C();
  607. var c2: Cpp.C = -c1;
  608. var c3: Cpp.C = c1 + c2;
  609. //@dump-sem-ir-end
  610. }
  611. // ============================================================================
  612. // Satisfying constraints
  613. // ============================================================================
  614. // --- fail_todo_constraints.carbon
  615. library "[[@TEST_NAME]]";
  616. import Cpp inline '''
  617. class X {};
  618. X operator+(X, X);
  619. ''';
  620. // TODO: Use Core.Add() when it is available.
  621. // TODO: `Sum()` should be declared this way when generics implementation is ready for that:
  622. // fn Sum[T:! Core.AddWith(.Self) where .Result = .Self](a: T, b: T) -> T
  623. fn Sum[U:! type, T:! Core.AddWith(U) where .Result = U](a: T, b: U) -> U {
  624. return a + b;
  625. }
  626. fn Call(x: Cpp.X) -> Cpp.X {
  627. // CHECK:STDERR: fail_todo_constraints.carbon:[[@LINE+7]]:10: error: cannot convert type `Cpp.X` into type implementing `Core.AddWith(Cpp.X) where .(Core.AddWith(Cpp.X).Core.Result) = Cpp.X` [ConversionFailureTypeToFacet]
  628. // CHECK:STDERR: return Sum(x, x);
  629. // CHECK:STDERR: ^~~~~~~~~
  630. // CHECK:STDERR: fail_todo_constraints.carbon:[[@LINE-7]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  631. // CHECK:STDERR: fn Sum[U:! type, T:! Core.AddWith(U) where .Result = U](a: T, b: U) -> U {
  632. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  633. // CHECK:STDERR:
  634. return Sum(x, x);
  635. }
  636. // ============================================================================
  637. // Operator not found
  638. // ============================================================================
  639. // --- not_found.h
  640. class C {};
  641. // --- fail_import_not_found.carbon
  642. library "[[@TEST_NAME]]";
  643. import Cpp library "not_found.h";
  644. fn F() {
  645. let c1: Cpp.C = Cpp.C.C();
  646. let c2: Cpp.C = Cpp.C.C();
  647. // CHECK:STDERR: fail_import_not_found.carbon:[[@LINE+4]]:22: error: no matching function for call to '<C++ operator>' [CppInteropParseError]
  648. // CHECK:STDERR: 13 | let c3: Cpp.C = c1 + c2;
  649. // CHECK:STDERR: | ^
  650. // CHECK:STDERR:
  651. let c3: Cpp.C = c1 + c2;
  652. }
  653. // ============================================================================
  654. // Incomplete operand C++ type
  655. // ============================================================================
  656. // --- incomplete.h
  657. class Incomplete;
  658. class Complete {};
  659. auto CreateIncomplete() -> Incomplete* _Nonnull;
  660. // --- fail_import_incomplete_unary.carbon
  661. library "[[@TEST_NAME]]";
  662. import Cpp library "incomplete.h";
  663. fn F() {
  664. // CHECK:STDERR: fail_import_incomplete_unary.carbon:[[@LINE+8]]:27: error: looking up a C++ operator with incomplete operand type `Cpp.Incomplete` [IncompleteOperandTypeInCppOperatorLookup]
  665. // CHECK:STDERR: let result_unary: i32 = -*Cpp.CreateIncomplete();
  666. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
  667. // CHECK:STDERR: fail_import_incomplete_unary.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
  668. // CHECK:STDERR: ./incomplete.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
  669. // CHECK:STDERR: class Incomplete;
  670. // CHECK:STDERR: ^
  671. // CHECK:STDERR:
  672. let result_unary: i32 = -*Cpp.CreateIncomplete();
  673. }
  674. // --- fail_import_incomplete_binary.carbon
  675. library "[[@TEST_NAME]]";
  676. import Cpp library "incomplete.h";
  677. fn F() {
  678. var complete: Cpp.Complete = Cpp.Complete.Complete();
  679. // CHECK:STDERR: fail_import_incomplete_binary.carbon:[[@LINE+8]]:28: error: looking up a C++ operator with incomplete operand type `Cpp.Incomplete` [IncompleteOperandTypeInCppOperatorLookup]
  680. // CHECK:STDERR: let result_binary: i32 = complete + *Cpp.CreateIncomplete();
  681. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  682. // CHECK:STDERR: fail_import_incomplete_binary.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
  683. // CHECK:STDERR: ./incomplete.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
  684. // CHECK:STDERR: class Incomplete;
  685. // CHECK:STDERR: ^
  686. // CHECK:STDERR:
  687. let result_binary: i32 = complete + *Cpp.CreateIncomplete();
  688. }
  689. // ============================================================================
  690. // Incomplete operand Carbon type
  691. // ============================================================================
  692. // --- complete.h
  693. struct Complete {};
  694. // --- fail_incomplete_operand_carbon_type.carbon
  695. library "[[@TEST_NAME]]";
  696. import Cpp library "complete.h";
  697. class Incomplete;
  698. fn CreateIncomplete() -> Incomplete*;
  699. fn F() {
  700. var complete: Cpp.Complete = Cpp.Complete.Complete();
  701. // CHECK:STDERR: fail_incomplete_operand_carbon_type.carbon:[[@LINE+7]]:21: error: looking up a C++ operator with incomplete operand type `Incomplete` [IncompleteOperandTypeInCppOperatorLookup]
  702. // CHECK:STDERR: let result: i32 = *CreateIncomplete() + complete;
  703. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  704. // CHECK:STDERR: fail_incomplete_operand_carbon_type.carbon:[[@LINE-8]]:1: note: class was forward declared here [ClassForwardDeclaredHere]
  705. // CHECK:STDERR: class Incomplete;
  706. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~
  707. // CHECK:STDERR:
  708. let result: i32 = *CreateIncomplete() + complete;
  709. }
  710. // ============================================================================
  711. // Unsupported operand type in instantiation
  712. // ============================================================================
  713. // --- unsupported_in_instantiation.h
  714. struct Supported {};
  715. template<typename T>
  716. struct Unsupported : public virtual Supported {};
  717. using UnsupportedAlias = Unsupported<int>;
  718. extern UnsupportedAlias unsupported;
  719. // --- fail_import_unsupported_in_instantiation_unary.carbon
  720. library "[[@TEST_NAME]]";
  721. import Cpp library "unsupported_in_instantiation.h";
  722. fn F() {
  723. // CHECK:STDERR: fail_import_unsupported_in_instantiation_unary.carbon:[[@LINE+7]]:21: error: semantics TODO: `class with virtual bases` [SemanticsTodo]
  724. // CHECK:STDERR: let result: i32 = -Cpp.unsupported;
  725. // CHECK:STDERR: ^~~~~~~~~~~~~~~~
  726. // CHECK:STDERR: fail_import_unsupported_in_instantiation_unary.carbon:[[@LINE+4]]:21: note: while completing C++ type `Cpp.Unsupported` [InCppTypeCompletion]
  727. // CHECK:STDERR: let result: i32 = -Cpp.unsupported;
  728. // CHECK:STDERR: ^~~~~~~~~~~~~~~~
  729. // CHECK:STDERR:
  730. let result: i32 = -Cpp.unsupported;
  731. }
  732. // --- fail_import_unsupported_in_instantiation_binary.carbon
  733. library "[[@TEST_NAME]]";
  734. import Cpp library "unsupported_in_instantiation.h";
  735. fn F() {
  736. var supported: Cpp.Supported = Cpp.Supported.Supported();
  737. // CHECK:STDERR: fail_import_unsupported_in_instantiation_binary.carbon:[[@LINE+7]]:21: error: semantics TODO: `class with virtual bases` [SemanticsTodo]
  738. // CHECK:STDERR: let result: i32 = supported + Cpp.unsupported;
  739. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  740. // CHECK:STDERR: fail_import_unsupported_in_instantiation_binary.carbon:[[@LINE+4]]:21: note: while completing C++ type `Cpp.Unsupported` [InCppTypeCompletion]
  741. // CHECK:STDERR: let result: i32 = supported + Cpp.unsupported;
  742. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  743. // CHECK:STDERR:
  744. let result: i32 = supported + Cpp.unsupported;
  745. }
  746. // ============================================================================
  747. // Indirect template instantiation
  748. // ============================================================================
  749. // --- indirect_template_instantiation.carbon
  750. library "[[@TEST_NAME]]";
  751. import Cpp inline '''
  752. template<typename T> struct B {};
  753. template<typename T> struct A {};
  754. using X = B<A<int>>;
  755. int operator+(X, X);
  756. ''';
  757. fn F(x: Cpp.X) -> i32 {
  758. //@dump-sem-ir-begin
  759. return x + x;
  760. //@dump-sem-ir-end
  761. }
  762. // ============================================================================
  763. // Indirect template instantiation error
  764. // ============================================================================
  765. // --- fail_indirect_template_instantiation_error.carbon
  766. library "[[@TEST_NAME]]";
  767. import Cpp inline '''
  768. template<typename T> struct B {};
  769. template<typename T> struct A {
  770. // CHECK:STDERR: fail_indirect_template_instantiation_error.carbon:[[@LINE+3]]:19: error: type 'int' cannot be used prior to '::' because it has no members [CppInteropParseError]
  771. // CHECK:STDERR: 10 | friend typename T::error operator+(B<A>, B<A>);
  772. // CHECK:STDERR: | ^
  773. friend typename T::error operator+(B<A>, B<A>);
  774. };
  775. using X = B<A<int>>;
  776. ''';
  777. fn F(x: Cpp.X) -> i32 {
  778. // CHECK:STDERR: fail_indirect_template_instantiation_error.carbon:[[@LINE+8]]:12: note: in instantiation of template class 'A<int>' requested here [CppInteropParseNote]
  779. // CHECK:STDERR: 25 | return x + x;
  780. // CHECK:STDERR: | ^
  781. // CHECK:STDERR:
  782. // CHECK:STDERR: fail_indirect_template_instantiation_error.carbon:[[@LINE+4]]:12: error: no matching function for call to '<C++ operator>' [CppInteropParseError]
  783. // CHECK:STDERR: 25 | return x + x;
  784. // CHECK:STDERR: | ^
  785. // CHECK:STDERR:
  786. return x + x;
  787. }
  788. // ============================================================================
  789. // Operator overloading
  790. // ============================================================================
  791. // --- overloading.h
  792. class C {};
  793. auto operator+(C lhs, C rhs) -> C;
  794. class D {};
  795. auto operator+(D lhs, D rhs) -> D;
  796. // --- import_overloading.carbon
  797. library "[[@TEST_NAME]]";
  798. import Cpp library "overloading.h";
  799. fn F() {
  800. let c1: Cpp.C = Cpp.C.C();
  801. let c2: Cpp.C = Cpp.C.C();
  802. //@dump-sem-ir-begin
  803. let c3: Cpp.C = c1 + c2;
  804. //@dump-sem-ir-end
  805. }
  806. // CHECK:STDOUT: --- import_unary_operators.carbon
  807. // CHECK:STDOUT:
  808. // CHECK:STDOUT: constants {
  809. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  810. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  811. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  812. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  813. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  814. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  815. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  816. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  817. // CHECK:STDOUT: %operator++__carbon_thunk.type: type = fn_type @operator++__carbon_thunk [concrete]
  818. // CHECK:STDOUT: %operator++__carbon_thunk: %operator++__carbon_thunk.type = struct_value () [concrete]
  819. // CHECK:STDOUT: %operator--__carbon_thunk.type: type = fn_type @operator--__carbon_thunk [concrete]
  820. // CHECK:STDOUT: %operator--__carbon_thunk: %operator--__carbon_thunk.type = struct_value () [concrete]
  821. // CHECK:STDOUT: %operator-__carbon_thunk.type: type = fn_type @operator-__carbon_thunk [concrete]
  822. // CHECK:STDOUT: %operator-__carbon_thunk: %operator-__carbon_thunk.type = struct_value () [concrete]
  823. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  824. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  825. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b92: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  826. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.841: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b92 = struct_value () [concrete]
  827. // CHECK:STDOUT: }
  828. // CHECK:STDOUT:
  829. // CHECK:STDOUT: imports {
  830. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  831. // CHECK:STDOUT: .C = %C.decl
  832. // CHECK:STDOUT: import Cpp//...
  833. // CHECK:STDOUT: }
  834. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  835. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete = constants.%C.C.cpp_overload_set.value]
  836. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  837. // CHECK:STDOUT: <elided>
  838. // CHECK:STDOUT: } {
  839. // CHECK:STDOUT: <elided>
  840. // CHECK:STDOUT: }
  841. // CHECK:STDOUT: %operator++__carbon_thunk.decl: %operator++__carbon_thunk.type = fn_decl @operator++__carbon_thunk [concrete = constants.%operator++__carbon_thunk] {
  842. // CHECK:STDOUT: <elided>
  843. // CHECK:STDOUT: } {
  844. // CHECK:STDOUT: <elided>
  845. // CHECK:STDOUT: }
  846. // CHECK:STDOUT: %operator--__carbon_thunk.decl: %operator--__carbon_thunk.type = fn_decl @operator--__carbon_thunk [concrete = constants.%operator--__carbon_thunk] {
  847. // CHECK:STDOUT: <elided>
  848. // CHECK:STDOUT: } {
  849. // CHECK:STDOUT: <elided>
  850. // CHECK:STDOUT: }
  851. // CHECK:STDOUT: %operator-__carbon_thunk.decl: %operator-__carbon_thunk.type = fn_decl @operator-__carbon_thunk [concrete = constants.%operator-__carbon_thunk] {
  852. // CHECK:STDOUT: <elided>
  853. // CHECK:STDOUT: } {
  854. // CHECK:STDOUT: <elided>
  855. // CHECK:STDOUT: }
  856. // CHECK:STDOUT: }
  857. // CHECK:STDOUT:
  858. // CHECK:STDOUT: fn @F() {
  859. // CHECK:STDOUT: !entry:
  860. // CHECK:STDOUT: name_binding_decl {
  861. // CHECK:STDOUT: %c.patt: %pattern_type.217 = binding_pattern c [concrete]
  862. // CHECK:STDOUT: %c.var_patt: %pattern_type.217 = var_pattern %c.patt [concrete]
  863. // CHECK:STDOUT: }
  864. // CHECK:STDOUT: %c.var: ref %C = var %c.var_patt
  865. // CHECK:STDOUT: %Cpp.ref.loc8_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  866. // CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  867. // CHECK:STDOUT: %C.ref.loc8_23: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  868. // CHECK:STDOUT: %.loc8_3.1: ref %C = splice_block %c.var {}
  869. // CHECK:STDOUT: %addr.loc8_26: %ptr.d9e = addr_of %.loc8_3.1
  870. // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_26)
  871. // CHECK:STDOUT: %.loc8_26: init %C = in_place_init %C__carbon_thunk.call, %.loc8_3.1
  872. // CHECK:STDOUT: assign %c.var, %.loc8_26
  873. // CHECK:STDOUT: %.loc8_13: type = splice_block %C.ref.loc8_13 [concrete = constants.%C] {
  874. // CHECK:STDOUT: %Cpp.ref.loc8_10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  875. // CHECK:STDOUT: %C.ref.loc8_13: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  876. // CHECK:STDOUT: }
  877. // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var
  878. // CHECK:STDOUT: %c.ref.loc11: ref %C = name_ref c, %c
  879. // CHECK:STDOUT: %.loc11_3.1: ref %C = temporary_storage
  880. // CHECK:STDOUT: %addr.loc11_5: %ptr.d9e = addr_of %c.ref.loc11
  881. // CHECK:STDOUT: %addr.loc11_3.1: %ptr.d9e = addr_of %.loc11_3.1
  882. // CHECK:STDOUT: %operator++__carbon_thunk.call: init %empty_tuple.type = call imports.%operator++__carbon_thunk.decl(%addr.loc11_5, %addr.loc11_3.1)
  883. // CHECK:STDOUT: %.loc11_3.2: init %C = in_place_init %operator++__carbon_thunk.call, %.loc11_3.1
  884. // CHECK:STDOUT: %.loc11_3.3: ref %C = temporary %.loc11_3.1, %.loc11_3.2
  885. // CHECK:STDOUT: %c.ref.loc12: ref %C = name_ref c, %c
  886. // CHECK:STDOUT: %.loc12_3.1: ref %C = temporary_storage
  887. // CHECK:STDOUT: %addr.loc12_5: %ptr.d9e = addr_of %c.ref.loc12
  888. // CHECK:STDOUT: %addr.loc12_3.1: %ptr.d9e = addr_of %.loc12_3.1
  889. // CHECK:STDOUT: %operator--__carbon_thunk.call: init %empty_tuple.type = call imports.%operator--__carbon_thunk.decl(%addr.loc12_5, %addr.loc12_3.1)
  890. // CHECK:STDOUT: %.loc12_3.2: init %C = in_place_init %operator--__carbon_thunk.call, %.loc12_3.1
  891. // CHECK:STDOUT: %.loc12_3.3: ref %C = temporary %.loc12_3.1, %.loc12_3.2
  892. // CHECK:STDOUT: name_binding_decl {
  893. // CHECK:STDOUT: %minus.patt: %pattern_type.217 = binding_pattern minus [concrete]
  894. // CHECK:STDOUT: }
  895. // CHECK:STDOUT: %c.ref.loc15: ref %C = name_ref c, %c
  896. // CHECK:STDOUT: %.loc15_22.1: ref %C = temporary_storage
  897. // CHECK:STDOUT: %.loc15_23.1: %C = bind_value %c.ref.loc15
  898. // CHECK:STDOUT: %.loc15_23.2: ref %C = value_as_ref %.loc15_23.1
  899. // CHECK:STDOUT: %addr.loc15_22.1: %ptr.d9e = addr_of %.loc15_23.2
  900. // CHECK:STDOUT: %addr.loc15_22.2: %ptr.d9e = addr_of %.loc15_22.1
  901. // CHECK:STDOUT: %operator-__carbon_thunk.call: init %empty_tuple.type = call imports.%operator-__carbon_thunk.decl(%addr.loc15_22.1, %addr.loc15_22.2)
  902. // CHECK:STDOUT: %.loc15_22.2: init %C = in_place_init %operator-__carbon_thunk.call, %.loc15_22.1
  903. // CHECK:STDOUT: %.loc15_17: type = splice_block %C.ref.loc15 [concrete = constants.%C] {
  904. // CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  905. // CHECK:STDOUT: %C.ref.loc15: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  906. // CHECK:STDOUT: }
  907. // CHECK:STDOUT: %.loc15_22.3: ref %C = temporary %.loc15_22.1, %.loc15_22.2
  908. // CHECK:STDOUT: %.loc15_22.4: %C = bind_value %.loc15_22.3
  909. // CHECK:STDOUT: %minus: %C = bind_name minus, %.loc15_22.4
  910. // CHECK:STDOUT: %facet_value.loc15: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  911. // CHECK:STDOUT: %.loc15_22.5: %type_where = converted constants.%C, %facet_value.loc15 [concrete = constants.%facet_value]
  912. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc15: <bound method> = bound_method %.loc15_22.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  913. // CHECK:STDOUT: <elided>
  914. // CHECK:STDOUT: %bound_method.loc15: <bound method> = bound_method %.loc15_22.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
  915. // CHECK:STDOUT: %addr.loc15_22.3: %ptr.d9e = addr_of %.loc15_22.3
  916. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc15: init %empty_tuple.type = call %bound_method.loc15(%addr.loc15_22.3)
  917. // CHECK:STDOUT: %facet_value.loc12: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  918. // CHECK:STDOUT: %.loc12_3.4: %type_where = converted constants.%C, %facet_value.loc12 [concrete = constants.%facet_value]
  919. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc12: <bound method> = bound_method %.loc12_3.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  920. // CHECK:STDOUT: <elided>
  921. // CHECK:STDOUT: %bound_method.loc12: <bound method> = bound_method %.loc12_3.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2
  922. // CHECK:STDOUT: %addr.loc12_3.2: %ptr.d9e = addr_of %.loc12_3.3
  923. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc12: init %empty_tuple.type = call %bound_method.loc12(%addr.loc12_3.2)
  924. // CHECK:STDOUT: %facet_value.loc11: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  925. // CHECK:STDOUT: %.loc11_3.4: %type_where = converted constants.%C, %facet_value.loc11 [concrete = constants.%facet_value]
  926. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc11: <bound method> = bound_method %.loc11_3.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  927. // CHECK:STDOUT: <elided>
  928. // CHECK:STDOUT: %bound_method.loc11: <bound method> = bound_method %.loc11_3.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3
  929. // CHECK:STDOUT: %addr.loc11_3.2: %ptr.d9e = addr_of %.loc11_3.3
  930. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc11: init %empty_tuple.type = call %bound_method.loc11(%addr.loc11_3.2)
  931. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  932. // CHECK:STDOUT: %.loc8_3.2: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  933. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %c.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  934. // CHECK:STDOUT: <elided>
  935. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %c.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.4
  936. // CHECK:STDOUT: %addr.loc8_3: %ptr.d9e = addr_of %c.var
  937. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_3)
  938. // CHECK:STDOUT: <elided>
  939. // CHECK:STDOUT: }
  940. // CHECK:STDOUT:
  941. // CHECK:STDOUT: --- import_binary_operators.carbon
  942. // CHECK:STDOUT:
  943. // CHECK:STDOUT: constants {
  944. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  945. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  946. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  947. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  948. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  949. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  950. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  951. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  952. // CHECK:STDOUT: %operator+__carbon_thunk.type: type = fn_type @operator+__carbon_thunk [concrete]
  953. // CHECK:STDOUT: %operator+__carbon_thunk: %operator+__carbon_thunk.type = struct_value () [concrete]
  954. // CHECK:STDOUT: %operator-__carbon_thunk.type: type = fn_type @operator-__carbon_thunk [concrete]
  955. // CHECK:STDOUT: %operator-__carbon_thunk: %operator-__carbon_thunk.type = struct_value () [concrete]
  956. // CHECK:STDOUT: %operator*__carbon_thunk.type: type = fn_type @operator*__carbon_thunk [concrete]
  957. // CHECK:STDOUT: %operator*__carbon_thunk: %operator*__carbon_thunk.type = struct_value () [concrete]
  958. // CHECK:STDOUT: %operator/__carbon_thunk.type: type = fn_type @operator/__carbon_thunk [concrete]
  959. // CHECK:STDOUT: %operator/__carbon_thunk: %operator/__carbon_thunk.type = struct_value () [concrete]
  960. // CHECK:STDOUT: %operator%__carbon_thunk.type: type = fn_type @operator%__carbon_thunk [concrete]
  961. // CHECK:STDOUT: %operator%__carbon_thunk: %operator%__carbon_thunk.type = struct_value () [concrete]
  962. // CHECK:STDOUT: %operator&__carbon_thunk.type: type = fn_type @operator&__carbon_thunk [concrete]
  963. // CHECK:STDOUT: %operator&__carbon_thunk: %operator&__carbon_thunk.type = struct_value () [concrete]
  964. // CHECK:STDOUT: %operator|__carbon_thunk.type: type = fn_type @operator|__carbon_thunk [concrete]
  965. // CHECK:STDOUT: %operator|__carbon_thunk: %operator|__carbon_thunk.type = struct_value () [concrete]
  966. // CHECK:STDOUT: %operator^__carbon_thunk.type: type = fn_type @operator^__carbon_thunk [concrete]
  967. // CHECK:STDOUT: %operator^__carbon_thunk: %operator^__carbon_thunk.type = struct_value () [concrete]
  968. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
  969. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  970. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  971. // CHECK:STDOUT: %operator<<__carbon_thunk.type: type = fn_type @operator<<__carbon_thunk [concrete]
  972. // CHECK:STDOUT: %operator<<__carbon_thunk: %operator<<__carbon_thunk.type = struct_value () [concrete]
  973. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  974. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  975. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  976. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  977. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340 = struct_value () [symbolic]
  978. // CHECK:STDOUT: %ImplicitAs.impl_witness.204: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.9e9, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  979. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  980. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584 = struct_value () [concrete]
  981. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.204) [concrete]
  982. // CHECK:STDOUT: %.1df: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  983. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.595: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [concrete]
  984. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  985. // CHECK:STDOUT: %bound_method.f36: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  986. // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
  987. // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete]
  988. // CHECK:STDOUT: %operator>>__carbon_thunk.type: type = fn_type @operator>>__carbon_thunk [concrete]
  989. // CHECK:STDOUT: %operator>>__carbon_thunk: %operator>>__carbon_thunk.type = struct_value () [concrete]
  990. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.23d: <bound method> = bound_method %int_5.64b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [concrete]
  991. // CHECK:STDOUT: %bound_method.724: <bound method> = bound_method %int_5.64b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  992. // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete]
  993. // CHECK:STDOUT: %operator+=__carbon_thunk.type: type = fn_type @operator+=__carbon_thunk [concrete]
  994. // CHECK:STDOUT: %operator+=__carbon_thunk: %operator+=__carbon_thunk.type = struct_value () [concrete]
  995. // CHECK:STDOUT: %operator-=__carbon_thunk.type: type = fn_type @operator-=__carbon_thunk [concrete]
  996. // CHECK:STDOUT: %operator-=__carbon_thunk: %operator-=__carbon_thunk.type = struct_value () [concrete]
  997. // CHECK:STDOUT: %operator*=__carbon_thunk.type: type = fn_type @operator*=__carbon_thunk [concrete]
  998. // CHECK:STDOUT: %operator*=__carbon_thunk: %operator*=__carbon_thunk.type = struct_value () [concrete]
  999. // CHECK:STDOUT: %operator/=__carbon_thunk.type: type = fn_type @operator/=__carbon_thunk [concrete]
  1000. // CHECK:STDOUT: %operator/=__carbon_thunk: %operator/=__carbon_thunk.type = struct_value () [concrete]
  1001. // CHECK:STDOUT: %operator%=__carbon_thunk.type: type = fn_type @operator%=__carbon_thunk [concrete]
  1002. // CHECK:STDOUT: %operator%=__carbon_thunk: %operator%=__carbon_thunk.type = struct_value () [concrete]
  1003. // CHECK:STDOUT: %operator&=__carbon_thunk.type: type = fn_type @operator&=__carbon_thunk [concrete]
  1004. // CHECK:STDOUT: %operator&=__carbon_thunk: %operator&=__carbon_thunk.type = struct_value () [concrete]
  1005. // CHECK:STDOUT: %operator|=__carbon_thunk.type: type = fn_type @operator|=__carbon_thunk [concrete]
  1006. // CHECK:STDOUT: %operator|=__carbon_thunk: %operator|=__carbon_thunk.type = struct_value () [concrete]
  1007. // CHECK:STDOUT: %operator^=__carbon_thunk.type: type = fn_type @operator^=__carbon_thunk [concrete]
  1008. // CHECK:STDOUT: %operator^=__carbon_thunk: %operator^=__carbon_thunk.type = struct_value () [concrete]
  1009. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
  1010. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
  1011. // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete]
  1012. // CHECK:STDOUT: %ptr.bb2: type = ptr_type bool [concrete]
  1013. // CHECK:STDOUT: %operator==__carbon_thunk.type: type = fn_type @operator==__carbon_thunk [concrete]
  1014. // CHECK:STDOUT: %operator==__carbon_thunk: %operator==__carbon_thunk.type = struct_value () [concrete]
  1015. // CHECK:STDOUT: %operator!=__carbon_thunk.type: type = fn_type @operator!=__carbon_thunk [concrete]
  1016. // CHECK:STDOUT: %operator!=__carbon_thunk: %operator!=__carbon_thunk.type = struct_value () [concrete]
  1017. // CHECK:STDOUT: %operator>__carbon_thunk.type: type = fn_type @operator>__carbon_thunk [concrete]
  1018. // CHECK:STDOUT: %operator>__carbon_thunk: %operator>__carbon_thunk.type = struct_value () [concrete]
  1019. // CHECK:STDOUT: %operator<__carbon_thunk.type: type = fn_type @operator<__carbon_thunk [concrete]
  1020. // CHECK:STDOUT: %operator<__carbon_thunk: %operator<__carbon_thunk.type = struct_value () [concrete]
  1021. // CHECK:STDOUT: %operator>=__carbon_thunk.type: type = fn_type @operator>=__carbon_thunk [concrete]
  1022. // CHECK:STDOUT: %operator>=__carbon_thunk: %operator>=__carbon_thunk.type = struct_value () [concrete]
  1023. // CHECK:STDOUT: %operator<=__carbon_thunk.type: type = fn_type @operator<=__carbon_thunk [concrete]
  1024. // CHECK:STDOUT: %operator<=__carbon_thunk: %operator<=__carbon_thunk.type = struct_value () [concrete]
  1025. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  1026. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  1027. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b92: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  1028. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.841: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b92 = struct_value () [concrete]
  1029. // CHECK:STDOUT: }
  1030. // CHECK:STDOUT:
  1031. // CHECK:STDOUT: imports {
  1032. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  1033. // CHECK:STDOUT: .C = %C.decl
  1034. // CHECK:STDOUT: import Cpp//...
  1035. // CHECK:STDOUT: }
  1036. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1037. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete = constants.%C.C.cpp_overload_set.value]
  1038. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  1039. // CHECK:STDOUT: <elided>
  1040. // CHECK:STDOUT: } {
  1041. // CHECK:STDOUT: <elided>
  1042. // CHECK:STDOUT: }
  1043. // CHECK:STDOUT: %operator+__carbon_thunk.decl: %operator+__carbon_thunk.type = fn_decl @operator+__carbon_thunk [concrete = constants.%operator+__carbon_thunk] {
  1044. // CHECK:STDOUT: <elided>
  1045. // CHECK:STDOUT: } {
  1046. // CHECK:STDOUT: <elided>
  1047. // CHECK:STDOUT: }
  1048. // CHECK:STDOUT: %operator-__carbon_thunk.decl: %operator-__carbon_thunk.type = fn_decl @operator-__carbon_thunk [concrete = constants.%operator-__carbon_thunk] {
  1049. // CHECK:STDOUT: <elided>
  1050. // CHECK:STDOUT: } {
  1051. // CHECK:STDOUT: <elided>
  1052. // CHECK:STDOUT: }
  1053. // CHECK:STDOUT: %operator*__carbon_thunk.decl: %operator*__carbon_thunk.type = fn_decl @operator*__carbon_thunk [concrete = constants.%operator*__carbon_thunk] {
  1054. // CHECK:STDOUT: <elided>
  1055. // CHECK:STDOUT: } {
  1056. // CHECK:STDOUT: <elided>
  1057. // CHECK:STDOUT: }
  1058. // CHECK:STDOUT: %operator/__carbon_thunk.decl: %operator/__carbon_thunk.type = fn_decl @operator/__carbon_thunk [concrete = constants.%operator/__carbon_thunk] {
  1059. // CHECK:STDOUT: <elided>
  1060. // CHECK:STDOUT: } {
  1061. // CHECK:STDOUT: <elided>
  1062. // CHECK:STDOUT: }
  1063. // CHECK:STDOUT: %operator%__carbon_thunk.decl: %operator%__carbon_thunk.type = fn_decl @operator%__carbon_thunk [concrete = constants.%operator%__carbon_thunk] {
  1064. // CHECK:STDOUT: <elided>
  1065. // CHECK:STDOUT: } {
  1066. // CHECK:STDOUT: <elided>
  1067. // CHECK:STDOUT: }
  1068. // CHECK:STDOUT: %operator&__carbon_thunk.decl: %operator&__carbon_thunk.type = fn_decl @operator&__carbon_thunk [concrete = constants.%operator&__carbon_thunk] {
  1069. // CHECK:STDOUT: <elided>
  1070. // CHECK:STDOUT: } {
  1071. // CHECK:STDOUT: <elided>
  1072. // CHECK:STDOUT: }
  1073. // CHECK:STDOUT: %operator|__carbon_thunk.decl: %operator|__carbon_thunk.type = fn_decl @operator|__carbon_thunk [concrete = constants.%operator|__carbon_thunk] {
  1074. // CHECK:STDOUT: <elided>
  1075. // CHECK:STDOUT: } {
  1076. // CHECK:STDOUT: <elided>
  1077. // CHECK:STDOUT: }
  1078. // CHECK:STDOUT: %operator^__carbon_thunk.decl: %operator^__carbon_thunk.type = fn_decl @operator^__carbon_thunk [concrete = constants.%operator^__carbon_thunk] {
  1079. // CHECK:STDOUT: <elided>
  1080. // CHECK:STDOUT: } {
  1081. // CHECK:STDOUT: <elided>
  1082. // CHECK:STDOUT: }
  1083. // CHECK:STDOUT: %operator<<__carbon_thunk.decl: %operator<<__carbon_thunk.type = fn_decl @operator<<__carbon_thunk [concrete = constants.%operator<<__carbon_thunk] {
  1084. // CHECK:STDOUT: <elided>
  1085. // CHECK:STDOUT: } {
  1086. // CHECK:STDOUT: <elided>
  1087. // CHECK:STDOUT: }
  1088. // CHECK:STDOUT: %Core.import_ref.ee7: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0)]
  1089. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.9e9 = impl_witness_table (%Core.import_ref.ee7), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  1090. // CHECK:STDOUT: %operator>>__carbon_thunk.decl: %operator>>__carbon_thunk.type = fn_decl @operator>>__carbon_thunk [concrete = constants.%operator>>__carbon_thunk] {
  1091. // CHECK:STDOUT: <elided>
  1092. // CHECK:STDOUT: } {
  1093. // CHECK:STDOUT: <elided>
  1094. // CHECK:STDOUT: }
  1095. // CHECK:STDOUT: %operator+=__carbon_thunk.decl: %operator+=__carbon_thunk.type = fn_decl @operator+=__carbon_thunk [concrete = constants.%operator+=__carbon_thunk] {
  1096. // CHECK:STDOUT: <elided>
  1097. // CHECK:STDOUT: } {
  1098. // CHECK:STDOUT: <elided>
  1099. // CHECK:STDOUT: }
  1100. // CHECK:STDOUT: %operator-=__carbon_thunk.decl: %operator-=__carbon_thunk.type = fn_decl @operator-=__carbon_thunk [concrete = constants.%operator-=__carbon_thunk] {
  1101. // CHECK:STDOUT: <elided>
  1102. // CHECK:STDOUT: } {
  1103. // CHECK:STDOUT: <elided>
  1104. // CHECK:STDOUT: }
  1105. // CHECK:STDOUT: %operator*=__carbon_thunk.decl: %operator*=__carbon_thunk.type = fn_decl @operator*=__carbon_thunk [concrete = constants.%operator*=__carbon_thunk] {
  1106. // CHECK:STDOUT: <elided>
  1107. // CHECK:STDOUT: } {
  1108. // CHECK:STDOUT: <elided>
  1109. // CHECK:STDOUT: }
  1110. // CHECK:STDOUT: %operator/=__carbon_thunk.decl: %operator/=__carbon_thunk.type = fn_decl @operator/=__carbon_thunk [concrete = constants.%operator/=__carbon_thunk] {
  1111. // CHECK:STDOUT: <elided>
  1112. // CHECK:STDOUT: } {
  1113. // CHECK:STDOUT: <elided>
  1114. // CHECK:STDOUT: }
  1115. // CHECK:STDOUT: %operator%=__carbon_thunk.decl: %operator%=__carbon_thunk.type = fn_decl @operator%=__carbon_thunk [concrete = constants.%operator%=__carbon_thunk] {
  1116. // CHECK:STDOUT: <elided>
  1117. // CHECK:STDOUT: } {
  1118. // CHECK:STDOUT: <elided>
  1119. // CHECK:STDOUT: }
  1120. // CHECK:STDOUT: %operator&=__carbon_thunk.decl: %operator&=__carbon_thunk.type = fn_decl @operator&=__carbon_thunk [concrete = constants.%operator&=__carbon_thunk] {
  1121. // CHECK:STDOUT: <elided>
  1122. // CHECK:STDOUT: } {
  1123. // CHECK:STDOUT: <elided>
  1124. // CHECK:STDOUT: }
  1125. // CHECK:STDOUT: %operator|=__carbon_thunk.decl: %operator|=__carbon_thunk.type = fn_decl @operator|=__carbon_thunk [concrete = constants.%operator|=__carbon_thunk] {
  1126. // CHECK:STDOUT: <elided>
  1127. // CHECK:STDOUT: } {
  1128. // CHECK:STDOUT: <elided>
  1129. // CHECK:STDOUT: }
  1130. // CHECK:STDOUT: %operator^=__carbon_thunk.decl: %operator^=__carbon_thunk.type = fn_decl @operator^=__carbon_thunk [concrete = constants.%operator^=__carbon_thunk] {
  1131. // CHECK:STDOUT: <elided>
  1132. // CHECK:STDOUT: } {
  1133. // CHECK:STDOUT: <elided>
  1134. // CHECK:STDOUT: }
  1135. // CHECK:STDOUT: %operator==__carbon_thunk.decl: %operator==__carbon_thunk.type = fn_decl @operator==__carbon_thunk [concrete = constants.%operator==__carbon_thunk] {
  1136. // CHECK:STDOUT: <elided>
  1137. // CHECK:STDOUT: } {
  1138. // CHECK:STDOUT: <elided>
  1139. // CHECK:STDOUT: }
  1140. // CHECK:STDOUT: %operator!=__carbon_thunk.decl: %operator!=__carbon_thunk.type = fn_decl @operator!=__carbon_thunk [concrete = constants.%operator!=__carbon_thunk] {
  1141. // CHECK:STDOUT: <elided>
  1142. // CHECK:STDOUT: } {
  1143. // CHECK:STDOUT: <elided>
  1144. // CHECK:STDOUT: }
  1145. // CHECK:STDOUT: %operator>__carbon_thunk.decl: %operator>__carbon_thunk.type = fn_decl @operator>__carbon_thunk [concrete = constants.%operator>__carbon_thunk] {
  1146. // CHECK:STDOUT: <elided>
  1147. // CHECK:STDOUT: } {
  1148. // CHECK:STDOUT: <elided>
  1149. // CHECK:STDOUT: }
  1150. // CHECK:STDOUT: %operator<__carbon_thunk.decl: %operator<__carbon_thunk.type = fn_decl @operator<__carbon_thunk [concrete = constants.%operator<__carbon_thunk] {
  1151. // CHECK:STDOUT: <elided>
  1152. // CHECK:STDOUT: } {
  1153. // CHECK:STDOUT: <elided>
  1154. // CHECK:STDOUT: }
  1155. // CHECK:STDOUT: %operator>=__carbon_thunk.decl: %operator>=__carbon_thunk.type = fn_decl @operator>=__carbon_thunk [concrete = constants.%operator>=__carbon_thunk] {
  1156. // CHECK:STDOUT: <elided>
  1157. // CHECK:STDOUT: } {
  1158. // CHECK:STDOUT: <elided>
  1159. // CHECK:STDOUT: }
  1160. // CHECK:STDOUT: %operator<=__carbon_thunk.decl: %operator<=__carbon_thunk.type = fn_decl @operator<=__carbon_thunk [concrete = constants.%operator<=__carbon_thunk] {
  1161. // CHECK:STDOUT: <elided>
  1162. // CHECK:STDOUT: } {
  1163. // CHECK:STDOUT: <elided>
  1164. // CHECK:STDOUT: }
  1165. // CHECK:STDOUT: }
  1166. // CHECK:STDOUT:
  1167. // CHECK:STDOUT: fn @F() {
  1168. // CHECK:STDOUT: !entry:
  1169. // CHECK:STDOUT: name_binding_decl {
  1170. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = binding_pattern c1 [concrete]
  1171. // CHECK:STDOUT: %c1.var_patt: %pattern_type.217 = var_pattern %c1.patt [concrete]
  1172. // CHECK:STDOUT: }
  1173. // CHECK:STDOUT: %c1.var: ref %C = var %c1.var_patt
  1174. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1175. // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1176. // CHECK:STDOUT: %C.ref.loc8_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  1177. // CHECK:STDOUT: %.loc8_3.1: ref %C = splice_block %c1.var {}
  1178. // CHECK:STDOUT: %addr.loc8_27: %ptr.d9e = addr_of %.loc8_3.1
  1179. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_27)
  1180. // CHECK:STDOUT: %.loc8_27: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_3.1
  1181. // CHECK:STDOUT: assign %c1.var, %.loc8_27
  1182. // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] {
  1183. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1184. // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1185. // CHECK:STDOUT: }
  1186. // CHECK:STDOUT: %c1: ref %C = bind_name c1, %c1.var
  1187. // CHECK:STDOUT: name_binding_decl {
  1188. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = binding_pattern c2 [concrete]
  1189. // CHECK:STDOUT: %c2.var_patt: %pattern_type.217 = var_pattern %c2.patt [concrete]
  1190. // CHECK:STDOUT: }
  1191. // CHECK:STDOUT: %c2.var: ref %C = var %c2.var_patt
  1192. // CHECK:STDOUT: %Cpp.ref.loc9_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1193. // CHECK:STDOUT: %C.ref.loc9_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1194. // CHECK:STDOUT: %C.ref.loc9_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  1195. // CHECK:STDOUT: %.loc9_3.1: ref %C = splice_block %c2.var {}
  1196. // CHECK:STDOUT: %addr.loc9_27: %ptr.d9e = addr_of %.loc9_3.1
  1197. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc9_27)
  1198. // CHECK:STDOUT: %.loc9_27: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_3.1
  1199. // CHECK:STDOUT: assign %c2.var, %.loc9_27
  1200. // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] {
  1201. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1202. // CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1203. // CHECK:STDOUT: }
  1204. // CHECK:STDOUT: %c2: ref %C = bind_name c2, %c2.var
  1205. // CHECK:STDOUT: name_binding_decl {
  1206. // CHECK:STDOUT: %addition.patt: %pattern_type.217 = binding_pattern addition [concrete]
  1207. // CHECK:STDOUT: }
  1208. // CHECK:STDOUT: %c1.ref.loc12: ref %C = name_ref c1, %c1
  1209. // CHECK:STDOUT: %c2.ref.loc12: ref %C = name_ref c2, %c2
  1210. // CHECK:STDOUT: %.loc12_28.1: ref %C = temporary_storage
  1211. // CHECK:STDOUT: %.loc12_25.1: %C = bind_value %c1.ref.loc12
  1212. // CHECK:STDOUT: %.loc12_30.1: %C = bind_value %c2.ref.loc12
  1213. // CHECK:STDOUT: %.loc12_25.2: ref %C = value_as_ref %.loc12_25.1
  1214. // CHECK:STDOUT: %addr.loc12_28.1: %ptr.d9e = addr_of %.loc12_25.2
  1215. // CHECK:STDOUT: %.loc12_30.2: ref %C = value_as_ref %.loc12_30.1
  1216. // CHECK:STDOUT: %addr.loc12_28.2: %ptr.d9e = addr_of %.loc12_30.2
  1217. // CHECK:STDOUT: %addr.loc12_28.3: %ptr.d9e = addr_of %.loc12_28.1
  1218. // CHECK:STDOUT: %operator+__carbon_thunk.call: init %empty_tuple.type = call imports.%operator+__carbon_thunk.decl(%addr.loc12_28.1, %addr.loc12_28.2, %addr.loc12_28.3)
  1219. // CHECK:STDOUT: %.loc12_28.2: init %C = in_place_init %operator+__carbon_thunk.call, %.loc12_28.1
  1220. // CHECK:STDOUT: %.loc12_20: type = splice_block %C.ref.loc12 [concrete = constants.%C] {
  1221. // CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1222. // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1223. // CHECK:STDOUT: }
  1224. // CHECK:STDOUT: %.loc12_28.3: ref %C = temporary %.loc12_28.1, %.loc12_28.2
  1225. // CHECK:STDOUT: %.loc12_28.4: %C = bind_value %.loc12_28.3
  1226. // CHECK:STDOUT: %addition: %C = bind_name addition, %.loc12_28.4
  1227. // CHECK:STDOUT: name_binding_decl {
  1228. // CHECK:STDOUT: %subtraction.patt: %pattern_type.217 = binding_pattern subtraction [concrete]
  1229. // CHECK:STDOUT: }
  1230. // CHECK:STDOUT: %c1.ref.loc13: ref %C = name_ref c1, %c1
  1231. // CHECK:STDOUT: %c2.ref.loc13: ref %C = name_ref c2, %c2
  1232. // CHECK:STDOUT: %.loc13_31.1: ref %C = temporary_storage
  1233. // CHECK:STDOUT: %.loc13_28.1: %C = bind_value %c1.ref.loc13
  1234. // CHECK:STDOUT: %.loc13_33.1: %C = bind_value %c2.ref.loc13
  1235. // CHECK:STDOUT: %.loc13_28.2: ref %C = value_as_ref %.loc13_28.1
  1236. // CHECK:STDOUT: %addr.loc13_31.1: %ptr.d9e = addr_of %.loc13_28.2
  1237. // CHECK:STDOUT: %.loc13_33.2: ref %C = value_as_ref %.loc13_33.1
  1238. // CHECK:STDOUT: %addr.loc13_31.2: %ptr.d9e = addr_of %.loc13_33.2
  1239. // CHECK:STDOUT: %addr.loc13_31.3: %ptr.d9e = addr_of %.loc13_31.1
  1240. // CHECK:STDOUT: %operator-__carbon_thunk.call: init %empty_tuple.type = call imports.%operator-__carbon_thunk.decl(%addr.loc13_31.1, %addr.loc13_31.2, %addr.loc13_31.3)
  1241. // CHECK:STDOUT: %.loc13_31.2: init %C = in_place_init %operator-__carbon_thunk.call, %.loc13_31.1
  1242. // CHECK:STDOUT: %.loc13_23: type = splice_block %C.ref.loc13 [concrete = constants.%C] {
  1243. // CHECK:STDOUT: %Cpp.ref.loc13: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1244. // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1245. // CHECK:STDOUT: }
  1246. // CHECK:STDOUT: %.loc13_31.3: ref %C = temporary %.loc13_31.1, %.loc13_31.2
  1247. // CHECK:STDOUT: %.loc13_31.4: %C = bind_value %.loc13_31.3
  1248. // CHECK:STDOUT: %subtraction: %C = bind_name subtraction, %.loc13_31.4
  1249. // CHECK:STDOUT: name_binding_decl {
  1250. // CHECK:STDOUT: %multiplication.patt: %pattern_type.217 = binding_pattern multiplication [concrete]
  1251. // CHECK:STDOUT: }
  1252. // CHECK:STDOUT: %c1.ref.loc14: ref %C = name_ref c1, %c1
  1253. // CHECK:STDOUT: %c2.ref.loc14: ref %C = name_ref c2, %c2
  1254. // CHECK:STDOUT: %.loc14_34.1: ref %C = temporary_storage
  1255. // CHECK:STDOUT: %.loc14_31.1: %C = bind_value %c1.ref.loc14
  1256. // CHECK:STDOUT: %.loc14_36.1: %C = bind_value %c2.ref.loc14
  1257. // CHECK:STDOUT: %.loc14_31.2: ref %C = value_as_ref %.loc14_31.1
  1258. // CHECK:STDOUT: %addr.loc14_34.1: %ptr.d9e = addr_of %.loc14_31.2
  1259. // CHECK:STDOUT: %.loc14_36.2: ref %C = value_as_ref %.loc14_36.1
  1260. // CHECK:STDOUT: %addr.loc14_34.2: %ptr.d9e = addr_of %.loc14_36.2
  1261. // CHECK:STDOUT: %addr.loc14_34.3: %ptr.d9e = addr_of %.loc14_34.1
  1262. // CHECK:STDOUT: %operator*__carbon_thunk.call: init %empty_tuple.type = call imports.%operator*__carbon_thunk.decl(%addr.loc14_34.1, %addr.loc14_34.2, %addr.loc14_34.3)
  1263. // CHECK:STDOUT: %.loc14_34.2: init %C = in_place_init %operator*__carbon_thunk.call, %.loc14_34.1
  1264. // CHECK:STDOUT: %.loc14_26: type = splice_block %C.ref.loc14 [concrete = constants.%C] {
  1265. // CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1266. // CHECK:STDOUT: %C.ref.loc14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1267. // CHECK:STDOUT: }
  1268. // CHECK:STDOUT: %.loc14_34.3: ref %C = temporary %.loc14_34.1, %.loc14_34.2
  1269. // CHECK:STDOUT: %.loc14_34.4: %C = bind_value %.loc14_34.3
  1270. // CHECK:STDOUT: %multiplication: %C = bind_name multiplication, %.loc14_34.4
  1271. // CHECK:STDOUT: name_binding_decl {
  1272. // CHECK:STDOUT: %division.patt: %pattern_type.217 = binding_pattern division [concrete]
  1273. // CHECK:STDOUT: }
  1274. // CHECK:STDOUT: %c1.ref.loc15: ref %C = name_ref c1, %c1
  1275. // CHECK:STDOUT: %c2.ref.loc15: ref %C = name_ref c2, %c2
  1276. // CHECK:STDOUT: %.loc15_28.1: ref %C = temporary_storage
  1277. // CHECK:STDOUT: %.loc15_25.1: %C = bind_value %c1.ref.loc15
  1278. // CHECK:STDOUT: %.loc15_30.1: %C = bind_value %c2.ref.loc15
  1279. // CHECK:STDOUT: %.loc15_25.2: ref %C = value_as_ref %.loc15_25.1
  1280. // CHECK:STDOUT: %addr.loc15_28.1: %ptr.d9e = addr_of %.loc15_25.2
  1281. // CHECK:STDOUT: %.loc15_30.2: ref %C = value_as_ref %.loc15_30.1
  1282. // CHECK:STDOUT: %addr.loc15_28.2: %ptr.d9e = addr_of %.loc15_30.2
  1283. // CHECK:STDOUT: %addr.loc15_28.3: %ptr.d9e = addr_of %.loc15_28.1
  1284. // CHECK:STDOUT: %operator/__carbon_thunk.call: init %empty_tuple.type = call imports.%operator/__carbon_thunk.decl(%addr.loc15_28.1, %addr.loc15_28.2, %addr.loc15_28.3)
  1285. // CHECK:STDOUT: %.loc15_28.2: init %C = in_place_init %operator/__carbon_thunk.call, %.loc15_28.1
  1286. // CHECK:STDOUT: %.loc15_20: type = splice_block %C.ref.loc15 [concrete = constants.%C] {
  1287. // CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1288. // CHECK:STDOUT: %C.ref.loc15: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1289. // CHECK:STDOUT: }
  1290. // CHECK:STDOUT: %.loc15_28.3: ref %C = temporary %.loc15_28.1, %.loc15_28.2
  1291. // CHECK:STDOUT: %.loc15_28.4: %C = bind_value %.loc15_28.3
  1292. // CHECK:STDOUT: %division: %C = bind_name division, %.loc15_28.4
  1293. // CHECK:STDOUT: name_binding_decl {
  1294. // CHECK:STDOUT: %modulo.patt: %pattern_type.217 = binding_pattern modulo [concrete]
  1295. // CHECK:STDOUT: }
  1296. // CHECK:STDOUT: %c1.ref.loc16: ref %C = name_ref c1, %c1
  1297. // CHECK:STDOUT: %c2.ref.loc16: ref %C = name_ref c2, %c2
  1298. // CHECK:STDOUT: %.loc16_26.1: ref %C = temporary_storage
  1299. // CHECK:STDOUT: %.loc16_23.1: %C = bind_value %c1.ref.loc16
  1300. // CHECK:STDOUT: %.loc16_28.1: %C = bind_value %c2.ref.loc16
  1301. // CHECK:STDOUT: %.loc16_23.2: ref %C = value_as_ref %.loc16_23.1
  1302. // CHECK:STDOUT: %addr.loc16_26.1: %ptr.d9e = addr_of %.loc16_23.2
  1303. // CHECK:STDOUT: %.loc16_28.2: ref %C = value_as_ref %.loc16_28.1
  1304. // CHECK:STDOUT: %addr.loc16_26.2: %ptr.d9e = addr_of %.loc16_28.2
  1305. // CHECK:STDOUT: %addr.loc16_26.3: %ptr.d9e = addr_of %.loc16_26.1
  1306. // CHECK:STDOUT: %operator%__carbon_thunk.call: init %empty_tuple.type = call imports.%operator%__carbon_thunk.decl(%addr.loc16_26.1, %addr.loc16_26.2, %addr.loc16_26.3)
  1307. // CHECK:STDOUT: %.loc16_26.2: init %C = in_place_init %operator%__carbon_thunk.call, %.loc16_26.1
  1308. // CHECK:STDOUT: %.loc16_18: type = splice_block %C.ref.loc16 [concrete = constants.%C] {
  1309. // CHECK:STDOUT: %Cpp.ref.loc16: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1310. // CHECK:STDOUT: %C.ref.loc16: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1311. // CHECK:STDOUT: }
  1312. // CHECK:STDOUT: %.loc16_26.3: ref %C = temporary %.loc16_26.1, %.loc16_26.2
  1313. // CHECK:STDOUT: %.loc16_26.4: %C = bind_value %.loc16_26.3
  1314. // CHECK:STDOUT: %modulo: %C = bind_name modulo, %.loc16_26.4
  1315. // CHECK:STDOUT: name_binding_decl {
  1316. // CHECK:STDOUT: %bitwise_and.patt: %pattern_type.217 = binding_pattern bitwise_and [concrete]
  1317. // CHECK:STDOUT: }
  1318. // CHECK:STDOUT: %c1.ref.loc19: ref %C = name_ref c1, %c1
  1319. // CHECK:STDOUT: %c2.ref.loc19: ref %C = name_ref c2, %c2
  1320. // CHECK:STDOUT: %.loc19_31.1: ref %C = temporary_storage
  1321. // CHECK:STDOUT: %.loc19_28.1: %C = bind_value %c1.ref.loc19
  1322. // CHECK:STDOUT: %.loc19_33.1: %C = bind_value %c2.ref.loc19
  1323. // CHECK:STDOUT: %.loc19_28.2: ref %C = value_as_ref %.loc19_28.1
  1324. // CHECK:STDOUT: %addr.loc19_31.1: %ptr.d9e = addr_of %.loc19_28.2
  1325. // CHECK:STDOUT: %.loc19_33.2: ref %C = value_as_ref %.loc19_33.1
  1326. // CHECK:STDOUT: %addr.loc19_31.2: %ptr.d9e = addr_of %.loc19_33.2
  1327. // CHECK:STDOUT: %addr.loc19_31.3: %ptr.d9e = addr_of %.loc19_31.1
  1328. // CHECK:STDOUT: %operator&__carbon_thunk.call: init %empty_tuple.type = call imports.%operator&__carbon_thunk.decl(%addr.loc19_31.1, %addr.loc19_31.2, %addr.loc19_31.3)
  1329. // CHECK:STDOUT: %.loc19_31.2: init %C = in_place_init %operator&__carbon_thunk.call, %.loc19_31.1
  1330. // CHECK:STDOUT: %.loc19_23: type = splice_block %C.ref.loc19 [concrete = constants.%C] {
  1331. // CHECK:STDOUT: %Cpp.ref.loc19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1332. // CHECK:STDOUT: %C.ref.loc19: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1333. // CHECK:STDOUT: }
  1334. // CHECK:STDOUT: %.loc19_31.3: ref %C = temporary %.loc19_31.1, %.loc19_31.2
  1335. // CHECK:STDOUT: %.loc19_31.4: %C = bind_value %.loc19_31.3
  1336. // CHECK:STDOUT: %bitwise_and: %C = bind_name bitwise_and, %.loc19_31.4
  1337. // CHECK:STDOUT: name_binding_decl {
  1338. // CHECK:STDOUT: %bitwise_or.patt: %pattern_type.217 = binding_pattern bitwise_or [concrete]
  1339. // CHECK:STDOUT: }
  1340. // CHECK:STDOUT: %c1.ref.loc20: ref %C = name_ref c1, %c1
  1341. // CHECK:STDOUT: %c2.ref.loc20: ref %C = name_ref c2, %c2
  1342. // CHECK:STDOUT: %.loc20_30.1: ref %C = temporary_storage
  1343. // CHECK:STDOUT: %.loc20_27.1: %C = bind_value %c1.ref.loc20
  1344. // CHECK:STDOUT: %.loc20_32.1: %C = bind_value %c2.ref.loc20
  1345. // CHECK:STDOUT: %.loc20_27.2: ref %C = value_as_ref %.loc20_27.1
  1346. // CHECK:STDOUT: %addr.loc20_30.1: %ptr.d9e = addr_of %.loc20_27.2
  1347. // CHECK:STDOUT: %.loc20_32.2: ref %C = value_as_ref %.loc20_32.1
  1348. // CHECK:STDOUT: %addr.loc20_30.2: %ptr.d9e = addr_of %.loc20_32.2
  1349. // CHECK:STDOUT: %addr.loc20_30.3: %ptr.d9e = addr_of %.loc20_30.1
  1350. // CHECK:STDOUT: %operator|__carbon_thunk.call: init %empty_tuple.type = call imports.%operator|__carbon_thunk.decl(%addr.loc20_30.1, %addr.loc20_30.2, %addr.loc20_30.3)
  1351. // CHECK:STDOUT: %.loc20_30.2: init %C = in_place_init %operator|__carbon_thunk.call, %.loc20_30.1
  1352. // CHECK:STDOUT: %.loc20_22: type = splice_block %C.ref.loc20 [concrete = constants.%C] {
  1353. // CHECK:STDOUT: %Cpp.ref.loc20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1354. // CHECK:STDOUT: %C.ref.loc20: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1355. // CHECK:STDOUT: }
  1356. // CHECK:STDOUT: %.loc20_30.3: ref %C = temporary %.loc20_30.1, %.loc20_30.2
  1357. // CHECK:STDOUT: %.loc20_30.4: %C = bind_value %.loc20_30.3
  1358. // CHECK:STDOUT: %bitwise_or: %C = bind_name bitwise_or, %.loc20_30.4
  1359. // CHECK:STDOUT: name_binding_decl {
  1360. // CHECK:STDOUT: %bitwise_xor.patt: %pattern_type.217 = binding_pattern bitwise_xor [concrete]
  1361. // CHECK:STDOUT: }
  1362. // CHECK:STDOUT: %c1.ref.loc21: ref %C = name_ref c1, %c1
  1363. // CHECK:STDOUT: %c2.ref.loc21: ref %C = name_ref c2, %c2
  1364. // CHECK:STDOUT: %.loc21_31.1: ref %C = temporary_storage
  1365. // CHECK:STDOUT: %.loc21_28.1: %C = bind_value %c1.ref.loc21
  1366. // CHECK:STDOUT: %.loc21_33.1: %C = bind_value %c2.ref.loc21
  1367. // CHECK:STDOUT: %.loc21_28.2: ref %C = value_as_ref %.loc21_28.1
  1368. // CHECK:STDOUT: %addr.loc21_31.1: %ptr.d9e = addr_of %.loc21_28.2
  1369. // CHECK:STDOUT: %.loc21_33.2: ref %C = value_as_ref %.loc21_33.1
  1370. // CHECK:STDOUT: %addr.loc21_31.2: %ptr.d9e = addr_of %.loc21_33.2
  1371. // CHECK:STDOUT: %addr.loc21_31.3: %ptr.d9e = addr_of %.loc21_31.1
  1372. // CHECK:STDOUT: %operator^__carbon_thunk.call: init %empty_tuple.type = call imports.%operator^__carbon_thunk.decl(%addr.loc21_31.1, %addr.loc21_31.2, %addr.loc21_31.3)
  1373. // CHECK:STDOUT: %.loc21_31.2: init %C = in_place_init %operator^__carbon_thunk.call, %.loc21_31.1
  1374. // CHECK:STDOUT: %.loc21_23: type = splice_block %C.ref.loc21 [concrete = constants.%C] {
  1375. // CHECK:STDOUT: %Cpp.ref.loc21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1376. // CHECK:STDOUT: %C.ref.loc21: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1377. // CHECK:STDOUT: }
  1378. // CHECK:STDOUT: %.loc21_31.3: ref %C = temporary %.loc21_31.1, %.loc21_31.2
  1379. // CHECK:STDOUT: %.loc21_31.4: %C = bind_value %.loc21_31.3
  1380. // CHECK:STDOUT: %bitwise_xor: %C = bind_name bitwise_xor, %.loc21_31.4
  1381. // CHECK:STDOUT: name_binding_decl {
  1382. // CHECK:STDOUT: %left_shift.patt: %pattern_type.217 = binding_pattern left_shift [concrete]
  1383. // CHECK:STDOUT: }
  1384. // CHECK:STDOUT: %c1.ref.loc22: ref %C = name_ref c1, %c1
  1385. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
  1386. // CHECK:STDOUT: %.loc22_30.1: ref %C = temporary_storage
  1387. // CHECK:STDOUT: %.loc22_27.1: %C = bind_value %c1.ref.loc22
  1388. // CHECK:STDOUT: %impl.elem0.loc22: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  1389. // CHECK:STDOUT: %bound_method.loc22_33.1: <bound method> = bound_method %int_3, %impl.elem0.loc22 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.595]
  1390. // CHECK:STDOUT: %specific_fn.loc22: <specific function> = specific_function %impl.elem0.loc22, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  1391. // CHECK:STDOUT: %bound_method.loc22_33.2: <bound method> = bound_method %int_3, %specific_fn.loc22 [concrete = constants.%bound_method.f36]
  1392. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22: init %i32 = call %bound_method.loc22_33.2(%int_3) [concrete = constants.%int_3.822]
  1393. // CHECK:STDOUT: %.loc22_33.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22 [concrete = constants.%int_3.822]
  1394. // CHECK:STDOUT: %.loc22_33.2: %i32 = converted %int_3, %.loc22_33.1 [concrete = constants.%int_3.822]
  1395. // CHECK:STDOUT: %.loc22_27.2: ref %C = value_as_ref %.loc22_27.1
  1396. // CHECK:STDOUT: %addr.loc22_30.1: %ptr.d9e = addr_of %.loc22_27.2
  1397. // CHECK:STDOUT: %addr.loc22_30.2: %ptr.d9e = addr_of %.loc22_30.1
  1398. // CHECK:STDOUT: %operator<<__carbon_thunk.call: init %empty_tuple.type = call imports.%operator<<__carbon_thunk.decl(%addr.loc22_30.1, %.loc22_33.2, %addr.loc22_30.2)
  1399. // CHECK:STDOUT: %.loc22_30.2: init %C = in_place_init %operator<<__carbon_thunk.call, %.loc22_30.1
  1400. // CHECK:STDOUT: %.loc22_22: type = splice_block %C.ref.loc22 [concrete = constants.%C] {
  1401. // CHECK:STDOUT: %Cpp.ref.loc22: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1402. // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1403. // CHECK:STDOUT: }
  1404. // CHECK:STDOUT: %.loc22_30.3: ref %C = temporary %.loc22_30.1, %.loc22_30.2
  1405. // CHECK:STDOUT: %.loc22_30.4: %C = bind_value %.loc22_30.3
  1406. // CHECK:STDOUT: %left_shift: %C = bind_name left_shift, %.loc22_30.4
  1407. // CHECK:STDOUT: name_binding_decl {
  1408. // CHECK:STDOUT: %right_shift.patt: %pattern_type.217 = binding_pattern right_shift [concrete]
  1409. // CHECK:STDOUT: }
  1410. // CHECK:STDOUT: %c1.ref.loc23: ref %C = name_ref c1, %c1
  1411. // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b]
  1412. // CHECK:STDOUT: %.loc23_31.1: ref %C = temporary_storage
  1413. // CHECK:STDOUT: %.loc23_28.1: %C = bind_value %c1.ref.loc23
  1414. // CHECK:STDOUT: %impl.elem0.loc23: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  1415. // CHECK:STDOUT: %bound_method.loc23_34.1: <bound method> = bound_method %int_5, %impl.elem0.loc23 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.23d]
  1416. // CHECK:STDOUT: %specific_fn.loc23: <specific function> = specific_function %impl.elem0.loc23, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  1417. // CHECK:STDOUT: %bound_method.loc23_34.2: <bound method> = bound_method %int_5, %specific_fn.loc23 [concrete = constants.%bound_method.724]
  1418. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23: init %i32 = call %bound_method.loc23_34.2(%int_5) [concrete = constants.%int_5.0f6]
  1419. // CHECK:STDOUT: %.loc23_34.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23 [concrete = constants.%int_5.0f6]
  1420. // CHECK:STDOUT: %.loc23_34.2: %i32 = converted %int_5, %.loc23_34.1 [concrete = constants.%int_5.0f6]
  1421. // CHECK:STDOUT: %.loc23_28.2: ref %C = value_as_ref %.loc23_28.1
  1422. // CHECK:STDOUT: %addr.loc23_31.1: %ptr.d9e = addr_of %.loc23_28.2
  1423. // CHECK:STDOUT: %addr.loc23_31.2: %ptr.d9e = addr_of %.loc23_31.1
  1424. // CHECK:STDOUT: %operator>>__carbon_thunk.call: init %empty_tuple.type = call imports.%operator>>__carbon_thunk.decl(%addr.loc23_31.1, %.loc23_34.2, %addr.loc23_31.2)
  1425. // CHECK:STDOUT: %.loc23_31.2: init %C = in_place_init %operator>>__carbon_thunk.call, %.loc23_31.1
  1426. // CHECK:STDOUT: %.loc23_23: type = splice_block %C.ref.loc23 [concrete = constants.%C] {
  1427. // CHECK:STDOUT: %Cpp.ref.loc23: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1428. // CHECK:STDOUT: %C.ref.loc23: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1429. // CHECK:STDOUT: }
  1430. // CHECK:STDOUT: %.loc23_31.3: ref %C = temporary %.loc23_31.1, %.loc23_31.2
  1431. // CHECK:STDOUT: %.loc23_31.4: %C = bind_value %.loc23_31.3
  1432. // CHECK:STDOUT: %right_shift: %C = bind_name right_shift, %.loc23_31.4
  1433. // CHECK:STDOUT: %c1.ref.loc26: ref %C = name_ref c1, %c1
  1434. // CHECK:STDOUT: %c2.ref.loc26: ref %C = name_ref c2, %c2
  1435. // CHECK:STDOUT: %.loc26_6.1: ref %C = temporary_storage
  1436. // CHECK:STDOUT: %addr.loc26_3: %ptr.d9e = addr_of %c1.ref.loc26
  1437. // CHECK:STDOUT: %.loc26_9.1: %C = bind_value %c2.ref.loc26
  1438. // CHECK:STDOUT: %.loc26_9.2: ref %C = value_as_ref %.loc26_9.1
  1439. // CHECK:STDOUT: %addr.loc26_6.1: %ptr.d9e = addr_of %.loc26_9.2
  1440. // CHECK:STDOUT: %addr.loc26_6.2: %ptr.d9e = addr_of %.loc26_6.1
  1441. // CHECK:STDOUT: %operator+=__carbon_thunk.call: init %empty_tuple.type = call imports.%operator+=__carbon_thunk.decl(%addr.loc26_3, %addr.loc26_6.1, %addr.loc26_6.2)
  1442. // CHECK:STDOUT: %.loc26_6.2: init %C = in_place_init %operator+=__carbon_thunk.call, %.loc26_6.1
  1443. // CHECK:STDOUT: %.loc26_6.3: ref %C = temporary %.loc26_6.1, %.loc26_6.2
  1444. // CHECK:STDOUT: %c1.ref.loc27: ref %C = name_ref c1, %c1
  1445. // CHECK:STDOUT: %c2.ref.loc27: ref %C = name_ref c2, %c2
  1446. // CHECK:STDOUT: %.loc27_6.1: ref %C = temporary_storage
  1447. // CHECK:STDOUT: %addr.loc27_3: %ptr.d9e = addr_of %c1.ref.loc27
  1448. // CHECK:STDOUT: %.loc27_9.1: %C = bind_value %c2.ref.loc27
  1449. // CHECK:STDOUT: %.loc27_9.2: ref %C = value_as_ref %.loc27_9.1
  1450. // CHECK:STDOUT: %addr.loc27_6.1: %ptr.d9e = addr_of %.loc27_9.2
  1451. // CHECK:STDOUT: %addr.loc27_6.2: %ptr.d9e = addr_of %.loc27_6.1
  1452. // CHECK:STDOUT: %operator-=__carbon_thunk.call: init %empty_tuple.type = call imports.%operator-=__carbon_thunk.decl(%addr.loc27_3, %addr.loc27_6.1, %addr.loc27_6.2)
  1453. // CHECK:STDOUT: %.loc27_6.2: init %C = in_place_init %operator-=__carbon_thunk.call, %.loc27_6.1
  1454. // CHECK:STDOUT: %.loc27_6.3: ref %C = temporary %.loc27_6.1, %.loc27_6.2
  1455. // CHECK:STDOUT: %c1.ref.loc28: ref %C = name_ref c1, %c1
  1456. // CHECK:STDOUT: %c2.ref.loc28: ref %C = name_ref c2, %c2
  1457. // CHECK:STDOUT: %.loc28_6.1: ref %C = temporary_storage
  1458. // CHECK:STDOUT: %addr.loc28_3: %ptr.d9e = addr_of %c1.ref.loc28
  1459. // CHECK:STDOUT: %.loc28_9.1: %C = bind_value %c2.ref.loc28
  1460. // CHECK:STDOUT: %.loc28_9.2: ref %C = value_as_ref %.loc28_9.1
  1461. // CHECK:STDOUT: %addr.loc28_6.1: %ptr.d9e = addr_of %.loc28_9.2
  1462. // CHECK:STDOUT: %addr.loc28_6.2: %ptr.d9e = addr_of %.loc28_6.1
  1463. // CHECK:STDOUT: %operator*=__carbon_thunk.call: init %empty_tuple.type = call imports.%operator*=__carbon_thunk.decl(%addr.loc28_3, %addr.loc28_6.1, %addr.loc28_6.2)
  1464. // CHECK:STDOUT: %.loc28_6.2: init %C = in_place_init %operator*=__carbon_thunk.call, %.loc28_6.1
  1465. // CHECK:STDOUT: %.loc28_6.3: ref %C = temporary %.loc28_6.1, %.loc28_6.2
  1466. // CHECK:STDOUT: %c1.ref.loc29: ref %C = name_ref c1, %c1
  1467. // CHECK:STDOUT: %c2.ref.loc29: ref %C = name_ref c2, %c2
  1468. // CHECK:STDOUT: %.loc29_6.1: ref %C = temporary_storage
  1469. // CHECK:STDOUT: %addr.loc29_3: %ptr.d9e = addr_of %c1.ref.loc29
  1470. // CHECK:STDOUT: %.loc29_9.1: %C = bind_value %c2.ref.loc29
  1471. // CHECK:STDOUT: %.loc29_9.2: ref %C = value_as_ref %.loc29_9.1
  1472. // CHECK:STDOUT: %addr.loc29_6.1: %ptr.d9e = addr_of %.loc29_9.2
  1473. // CHECK:STDOUT: %addr.loc29_6.2: %ptr.d9e = addr_of %.loc29_6.1
  1474. // CHECK:STDOUT: %operator/=__carbon_thunk.call: init %empty_tuple.type = call imports.%operator/=__carbon_thunk.decl(%addr.loc29_3, %addr.loc29_6.1, %addr.loc29_6.2)
  1475. // CHECK:STDOUT: %.loc29_6.2: init %C = in_place_init %operator/=__carbon_thunk.call, %.loc29_6.1
  1476. // CHECK:STDOUT: %.loc29_6.3: ref %C = temporary %.loc29_6.1, %.loc29_6.2
  1477. // CHECK:STDOUT: %c1.ref.loc30: ref %C = name_ref c1, %c1
  1478. // CHECK:STDOUT: %c2.ref.loc30: ref %C = name_ref c2, %c2
  1479. // CHECK:STDOUT: %.loc30_6.1: ref %C = temporary_storage
  1480. // CHECK:STDOUT: %addr.loc30_3: %ptr.d9e = addr_of %c1.ref.loc30
  1481. // CHECK:STDOUT: %.loc30_9.1: %C = bind_value %c2.ref.loc30
  1482. // CHECK:STDOUT: %.loc30_9.2: ref %C = value_as_ref %.loc30_9.1
  1483. // CHECK:STDOUT: %addr.loc30_6.1: %ptr.d9e = addr_of %.loc30_9.2
  1484. // CHECK:STDOUT: %addr.loc30_6.2: %ptr.d9e = addr_of %.loc30_6.1
  1485. // CHECK:STDOUT: %operator%=__carbon_thunk.call: init %empty_tuple.type = call imports.%operator%=__carbon_thunk.decl(%addr.loc30_3, %addr.loc30_6.1, %addr.loc30_6.2)
  1486. // CHECK:STDOUT: %.loc30_6.2: init %C = in_place_init %operator%=__carbon_thunk.call, %.loc30_6.1
  1487. // CHECK:STDOUT: %.loc30_6.3: ref %C = temporary %.loc30_6.1, %.loc30_6.2
  1488. // CHECK:STDOUT: %c1.ref.loc33: ref %C = name_ref c1, %c1
  1489. // CHECK:STDOUT: %c2.ref.loc33: ref %C = name_ref c2, %c2
  1490. // CHECK:STDOUT: %.loc33_6.1: ref %C = temporary_storage
  1491. // CHECK:STDOUT: %addr.loc33_3: %ptr.d9e = addr_of %c1.ref.loc33
  1492. // CHECK:STDOUT: %.loc33_9.1: %C = bind_value %c2.ref.loc33
  1493. // CHECK:STDOUT: %.loc33_9.2: ref %C = value_as_ref %.loc33_9.1
  1494. // CHECK:STDOUT: %addr.loc33_6.1: %ptr.d9e = addr_of %.loc33_9.2
  1495. // CHECK:STDOUT: %addr.loc33_6.2: %ptr.d9e = addr_of %.loc33_6.1
  1496. // CHECK:STDOUT: %operator&=__carbon_thunk.call: init %empty_tuple.type = call imports.%operator&=__carbon_thunk.decl(%addr.loc33_3, %addr.loc33_6.1, %addr.loc33_6.2)
  1497. // CHECK:STDOUT: %.loc33_6.2: init %C = in_place_init %operator&=__carbon_thunk.call, %.loc33_6.1
  1498. // CHECK:STDOUT: %.loc33_6.3: ref %C = temporary %.loc33_6.1, %.loc33_6.2
  1499. // CHECK:STDOUT: %c1.ref.loc34: ref %C = name_ref c1, %c1
  1500. // CHECK:STDOUT: %c2.ref.loc34: ref %C = name_ref c2, %c2
  1501. // CHECK:STDOUT: %.loc34_6.1: ref %C = temporary_storage
  1502. // CHECK:STDOUT: %addr.loc34_3: %ptr.d9e = addr_of %c1.ref.loc34
  1503. // CHECK:STDOUT: %.loc34_9.1: %C = bind_value %c2.ref.loc34
  1504. // CHECK:STDOUT: %.loc34_9.2: ref %C = value_as_ref %.loc34_9.1
  1505. // CHECK:STDOUT: %addr.loc34_6.1: %ptr.d9e = addr_of %.loc34_9.2
  1506. // CHECK:STDOUT: %addr.loc34_6.2: %ptr.d9e = addr_of %.loc34_6.1
  1507. // CHECK:STDOUT: %operator|=__carbon_thunk.call: init %empty_tuple.type = call imports.%operator|=__carbon_thunk.decl(%addr.loc34_3, %addr.loc34_6.1, %addr.loc34_6.2)
  1508. // CHECK:STDOUT: %.loc34_6.2: init %C = in_place_init %operator|=__carbon_thunk.call, %.loc34_6.1
  1509. // CHECK:STDOUT: %.loc34_6.3: ref %C = temporary %.loc34_6.1, %.loc34_6.2
  1510. // CHECK:STDOUT: %c1.ref.loc35: ref %C = name_ref c1, %c1
  1511. // CHECK:STDOUT: %c2.ref.loc35: ref %C = name_ref c2, %c2
  1512. // CHECK:STDOUT: %.loc35_6.1: ref %C = temporary_storage
  1513. // CHECK:STDOUT: %addr.loc35_3: %ptr.d9e = addr_of %c1.ref.loc35
  1514. // CHECK:STDOUT: %.loc35_9.1: %C = bind_value %c2.ref.loc35
  1515. // CHECK:STDOUT: %.loc35_9.2: ref %C = value_as_ref %.loc35_9.1
  1516. // CHECK:STDOUT: %addr.loc35_6.1: %ptr.d9e = addr_of %.loc35_9.2
  1517. // CHECK:STDOUT: %addr.loc35_6.2: %ptr.d9e = addr_of %.loc35_6.1
  1518. // CHECK:STDOUT: %operator^=__carbon_thunk.call: init %empty_tuple.type = call imports.%operator^=__carbon_thunk.decl(%addr.loc35_3, %addr.loc35_6.1, %addr.loc35_6.2)
  1519. // CHECK:STDOUT: %.loc35_6.2: init %C = in_place_init %operator^=__carbon_thunk.call, %.loc35_6.1
  1520. // CHECK:STDOUT: %.loc35_6.3: ref %C = temporary %.loc35_6.1, %.loc35_6.2
  1521. // CHECK:STDOUT: name_binding_decl {
  1522. // CHECK:STDOUT: %equal.patt: %pattern_type.831 = binding_pattern equal [concrete]
  1523. // CHECK:STDOUT: }
  1524. // CHECK:STDOUT: %c1.ref.loc38: ref %C = name_ref c1, %c1
  1525. // CHECK:STDOUT: %c2.ref.loc38: ref %C = name_ref c2, %c2
  1526. // CHECK:STDOUT: %.loc38_21.1: %C = bind_value %c1.ref.loc38
  1527. // CHECK:STDOUT: %.loc38_27.1: %C = bind_value %c2.ref.loc38
  1528. // CHECK:STDOUT: %.loc38_21.2: ref %C = value_as_ref %.loc38_21.1
  1529. // CHECK:STDOUT: %addr.loc38_24.1: %ptr.d9e = addr_of %.loc38_21.2
  1530. // CHECK:STDOUT: %.loc38_27.2: ref %C = value_as_ref %.loc38_27.1
  1531. // CHECK:STDOUT: %addr.loc38_24.2: %ptr.d9e = addr_of %.loc38_27.2
  1532. // CHECK:STDOUT: %.loc38_24.1: ref bool = temporary_storage
  1533. // CHECK:STDOUT: %addr.loc38_24.3: %ptr.bb2 = addr_of %.loc38_24.1
  1534. // CHECK:STDOUT: %operator==__carbon_thunk.call: init %empty_tuple.type = call imports.%operator==__carbon_thunk.decl(%addr.loc38_24.1, %addr.loc38_24.2, %addr.loc38_24.3)
  1535. // CHECK:STDOUT: %.loc38_24.2: init bool = in_place_init %operator==__carbon_thunk.call, %.loc38_24.1
  1536. // CHECK:STDOUT: %.loc38_14.1: type = splice_block %.loc38_14.3 [concrete = bool] {
  1537. // CHECK:STDOUT: %Bool.call.loc38: init type = call constants.%Bool() [concrete = bool]
  1538. // CHECK:STDOUT: %.loc38_14.2: type = value_of_initializer %Bool.call.loc38 [concrete = bool]
  1539. // CHECK:STDOUT: %.loc38_14.3: type = converted %Bool.call.loc38, %.loc38_14.2 [concrete = bool]
  1540. // CHECK:STDOUT: }
  1541. // CHECK:STDOUT: %.loc38_24.3: bool = value_of_initializer %.loc38_24.2
  1542. // CHECK:STDOUT: %.loc38_24.4: bool = converted %.loc38_24.2, %.loc38_24.3
  1543. // CHECK:STDOUT: %equal: bool = bind_name equal, %.loc38_24.4
  1544. // CHECK:STDOUT: name_binding_decl {
  1545. // CHECK:STDOUT: %not_equal.patt: %pattern_type.831 = binding_pattern not_equal [concrete]
  1546. // CHECK:STDOUT: }
  1547. // CHECK:STDOUT: %c1.ref.loc39: ref %C = name_ref c1, %c1
  1548. // CHECK:STDOUT: %c2.ref.loc39: ref %C = name_ref c2, %c2
  1549. // CHECK:STDOUT: %.loc39_25.1: %C = bind_value %c1.ref.loc39
  1550. // CHECK:STDOUT: %.loc39_31.1: %C = bind_value %c2.ref.loc39
  1551. // CHECK:STDOUT: %.loc39_25.2: ref %C = value_as_ref %.loc39_25.1
  1552. // CHECK:STDOUT: %addr.loc39_28.1: %ptr.d9e = addr_of %.loc39_25.2
  1553. // CHECK:STDOUT: %.loc39_31.2: ref %C = value_as_ref %.loc39_31.1
  1554. // CHECK:STDOUT: %addr.loc39_28.2: %ptr.d9e = addr_of %.loc39_31.2
  1555. // CHECK:STDOUT: %.loc39_28.1: ref bool = temporary_storage
  1556. // CHECK:STDOUT: %addr.loc39_28.3: %ptr.bb2 = addr_of %.loc39_28.1
  1557. // CHECK:STDOUT: %operator!=__carbon_thunk.call: init %empty_tuple.type = call imports.%operator!=__carbon_thunk.decl(%addr.loc39_28.1, %addr.loc39_28.2, %addr.loc39_28.3)
  1558. // CHECK:STDOUT: %.loc39_28.2: init bool = in_place_init %operator!=__carbon_thunk.call, %.loc39_28.1
  1559. // CHECK:STDOUT: %.loc39_18.1: type = splice_block %.loc39_18.3 [concrete = bool] {
  1560. // CHECK:STDOUT: %Bool.call.loc39: init type = call constants.%Bool() [concrete = bool]
  1561. // CHECK:STDOUT: %.loc39_18.2: type = value_of_initializer %Bool.call.loc39 [concrete = bool]
  1562. // CHECK:STDOUT: %.loc39_18.3: type = converted %Bool.call.loc39, %.loc39_18.2 [concrete = bool]
  1563. // CHECK:STDOUT: }
  1564. // CHECK:STDOUT: %.loc39_28.3: bool = value_of_initializer %.loc39_28.2
  1565. // CHECK:STDOUT: %.loc39_28.4: bool = converted %.loc39_28.2, %.loc39_28.3
  1566. // CHECK:STDOUT: %not_equal: bool = bind_name not_equal, %.loc39_28.4
  1567. // CHECK:STDOUT: name_binding_decl {
  1568. // CHECK:STDOUT: %greater_than.patt: %pattern_type.831 = binding_pattern greater_than [concrete]
  1569. // CHECK:STDOUT: }
  1570. // CHECK:STDOUT: %c1.ref.loc40: ref %C = name_ref c1, %c1
  1571. // CHECK:STDOUT: %c2.ref.loc40: ref %C = name_ref c2, %c2
  1572. // CHECK:STDOUT: %.loc40_28.1: %C = bind_value %c1.ref.loc40
  1573. // CHECK:STDOUT: %.loc40_33.1: %C = bind_value %c2.ref.loc40
  1574. // CHECK:STDOUT: %.loc40_28.2: ref %C = value_as_ref %.loc40_28.1
  1575. // CHECK:STDOUT: %addr.loc40_31.1: %ptr.d9e = addr_of %.loc40_28.2
  1576. // CHECK:STDOUT: %.loc40_33.2: ref %C = value_as_ref %.loc40_33.1
  1577. // CHECK:STDOUT: %addr.loc40_31.2: %ptr.d9e = addr_of %.loc40_33.2
  1578. // CHECK:STDOUT: %.loc40_31.1: ref bool = temporary_storage
  1579. // CHECK:STDOUT: %addr.loc40_31.3: %ptr.bb2 = addr_of %.loc40_31.1
  1580. // CHECK:STDOUT: %operator>__carbon_thunk.call: init %empty_tuple.type = call imports.%operator>__carbon_thunk.decl(%addr.loc40_31.1, %addr.loc40_31.2, %addr.loc40_31.3)
  1581. // CHECK:STDOUT: %.loc40_31.2: init bool = in_place_init %operator>__carbon_thunk.call, %.loc40_31.1
  1582. // CHECK:STDOUT: %.loc40_21.1: type = splice_block %.loc40_21.3 [concrete = bool] {
  1583. // CHECK:STDOUT: %Bool.call.loc40: init type = call constants.%Bool() [concrete = bool]
  1584. // CHECK:STDOUT: %.loc40_21.2: type = value_of_initializer %Bool.call.loc40 [concrete = bool]
  1585. // CHECK:STDOUT: %.loc40_21.3: type = converted %Bool.call.loc40, %.loc40_21.2 [concrete = bool]
  1586. // CHECK:STDOUT: }
  1587. // CHECK:STDOUT: %.loc40_31.3: bool = value_of_initializer %.loc40_31.2
  1588. // CHECK:STDOUT: %.loc40_31.4: bool = converted %.loc40_31.2, %.loc40_31.3
  1589. // CHECK:STDOUT: %greater_than: bool = bind_name greater_than, %.loc40_31.4
  1590. // CHECK:STDOUT: name_binding_decl {
  1591. // CHECK:STDOUT: %less_than.patt: %pattern_type.831 = binding_pattern less_than [concrete]
  1592. // CHECK:STDOUT: }
  1593. // CHECK:STDOUT: %c1.ref.loc41: ref %C = name_ref c1, %c1
  1594. // CHECK:STDOUT: %c2.ref.loc41: ref %C = name_ref c2, %c2
  1595. // CHECK:STDOUT: %.loc41_25.1: %C = bind_value %c1.ref.loc41
  1596. // CHECK:STDOUT: %.loc41_30.1: %C = bind_value %c2.ref.loc41
  1597. // CHECK:STDOUT: %.loc41_25.2: ref %C = value_as_ref %.loc41_25.1
  1598. // CHECK:STDOUT: %addr.loc41_28.1: %ptr.d9e = addr_of %.loc41_25.2
  1599. // CHECK:STDOUT: %.loc41_30.2: ref %C = value_as_ref %.loc41_30.1
  1600. // CHECK:STDOUT: %addr.loc41_28.2: %ptr.d9e = addr_of %.loc41_30.2
  1601. // CHECK:STDOUT: %.loc41_28.1: ref bool = temporary_storage
  1602. // CHECK:STDOUT: %addr.loc41_28.3: %ptr.bb2 = addr_of %.loc41_28.1
  1603. // CHECK:STDOUT: %operator<__carbon_thunk.call: init %empty_tuple.type = call imports.%operator<__carbon_thunk.decl(%addr.loc41_28.1, %addr.loc41_28.2, %addr.loc41_28.3)
  1604. // CHECK:STDOUT: %.loc41_28.2: init bool = in_place_init %operator<__carbon_thunk.call, %.loc41_28.1
  1605. // CHECK:STDOUT: %.loc41_18.1: type = splice_block %.loc41_18.3 [concrete = bool] {
  1606. // CHECK:STDOUT: %Bool.call.loc41: init type = call constants.%Bool() [concrete = bool]
  1607. // CHECK:STDOUT: %.loc41_18.2: type = value_of_initializer %Bool.call.loc41 [concrete = bool]
  1608. // CHECK:STDOUT: %.loc41_18.3: type = converted %Bool.call.loc41, %.loc41_18.2 [concrete = bool]
  1609. // CHECK:STDOUT: }
  1610. // CHECK:STDOUT: %.loc41_28.3: bool = value_of_initializer %.loc41_28.2
  1611. // CHECK:STDOUT: %.loc41_28.4: bool = converted %.loc41_28.2, %.loc41_28.3
  1612. // CHECK:STDOUT: %less_than: bool = bind_name less_than, %.loc41_28.4
  1613. // CHECK:STDOUT: name_binding_decl {
  1614. // CHECK:STDOUT: %greater_than_or_equal.patt: %pattern_type.831 = binding_pattern greater_than_or_equal [concrete]
  1615. // CHECK:STDOUT: }
  1616. // CHECK:STDOUT: %c1.ref.loc42: ref %C = name_ref c1, %c1
  1617. // CHECK:STDOUT: %c2.ref.loc42: ref %C = name_ref c2, %c2
  1618. // CHECK:STDOUT: %.loc42_37.1: %C = bind_value %c1.ref.loc42
  1619. // CHECK:STDOUT: %.loc42_43.1: %C = bind_value %c2.ref.loc42
  1620. // CHECK:STDOUT: %.loc42_37.2: ref %C = value_as_ref %.loc42_37.1
  1621. // CHECK:STDOUT: %addr.loc42_40.1: %ptr.d9e = addr_of %.loc42_37.2
  1622. // CHECK:STDOUT: %.loc42_43.2: ref %C = value_as_ref %.loc42_43.1
  1623. // CHECK:STDOUT: %addr.loc42_40.2: %ptr.d9e = addr_of %.loc42_43.2
  1624. // CHECK:STDOUT: %.loc42_40.1: ref bool = temporary_storage
  1625. // CHECK:STDOUT: %addr.loc42_40.3: %ptr.bb2 = addr_of %.loc42_40.1
  1626. // CHECK:STDOUT: %operator>=__carbon_thunk.call: init %empty_tuple.type = call imports.%operator>=__carbon_thunk.decl(%addr.loc42_40.1, %addr.loc42_40.2, %addr.loc42_40.3)
  1627. // CHECK:STDOUT: %.loc42_40.2: init bool = in_place_init %operator>=__carbon_thunk.call, %.loc42_40.1
  1628. // CHECK:STDOUT: %.loc42_30.1: type = splice_block %.loc42_30.3 [concrete = bool] {
  1629. // CHECK:STDOUT: %Bool.call.loc42: init type = call constants.%Bool() [concrete = bool]
  1630. // CHECK:STDOUT: %.loc42_30.2: type = value_of_initializer %Bool.call.loc42 [concrete = bool]
  1631. // CHECK:STDOUT: %.loc42_30.3: type = converted %Bool.call.loc42, %.loc42_30.2 [concrete = bool]
  1632. // CHECK:STDOUT: }
  1633. // CHECK:STDOUT: %.loc42_40.3: bool = value_of_initializer %.loc42_40.2
  1634. // CHECK:STDOUT: %.loc42_40.4: bool = converted %.loc42_40.2, %.loc42_40.3
  1635. // CHECK:STDOUT: %greater_than_or_equal: bool = bind_name greater_than_or_equal, %.loc42_40.4
  1636. // CHECK:STDOUT: name_binding_decl {
  1637. // CHECK:STDOUT: %less_than_or_equal.patt: %pattern_type.831 = binding_pattern less_than_or_equal [concrete]
  1638. // CHECK:STDOUT: }
  1639. // CHECK:STDOUT: %c1.ref.loc43: ref %C = name_ref c1, %c1
  1640. // CHECK:STDOUT: %c2.ref.loc43: ref %C = name_ref c2, %c2
  1641. // CHECK:STDOUT: %.loc43_34.1: %C = bind_value %c1.ref.loc43
  1642. // CHECK:STDOUT: %.loc43_40.1: %C = bind_value %c2.ref.loc43
  1643. // CHECK:STDOUT: %.loc43_34.2: ref %C = value_as_ref %.loc43_34.1
  1644. // CHECK:STDOUT: %addr.loc43_37.1: %ptr.d9e = addr_of %.loc43_34.2
  1645. // CHECK:STDOUT: %.loc43_40.2: ref %C = value_as_ref %.loc43_40.1
  1646. // CHECK:STDOUT: %addr.loc43_37.2: %ptr.d9e = addr_of %.loc43_40.2
  1647. // CHECK:STDOUT: %.loc43_37.1: ref bool = temporary_storage
  1648. // CHECK:STDOUT: %addr.loc43_37.3: %ptr.bb2 = addr_of %.loc43_37.1
  1649. // CHECK:STDOUT: %operator<=__carbon_thunk.call: init %empty_tuple.type = call imports.%operator<=__carbon_thunk.decl(%addr.loc43_37.1, %addr.loc43_37.2, %addr.loc43_37.3)
  1650. // CHECK:STDOUT: %.loc43_37.2: init bool = in_place_init %operator<=__carbon_thunk.call, %.loc43_37.1
  1651. // CHECK:STDOUT: %.loc43_27.1: type = splice_block %.loc43_27.3 [concrete = bool] {
  1652. // CHECK:STDOUT: %Bool.call.loc43: init type = call constants.%Bool() [concrete = bool]
  1653. // CHECK:STDOUT: %.loc43_27.2: type = value_of_initializer %Bool.call.loc43 [concrete = bool]
  1654. // CHECK:STDOUT: %.loc43_27.3: type = converted %Bool.call.loc43, %.loc43_27.2 [concrete = bool]
  1655. // CHECK:STDOUT: }
  1656. // CHECK:STDOUT: %.loc43_37.3: bool = value_of_initializer %.loc43_37.2
  1657. // CHECK:STDOUT: %.loc43_37.4: bool = converted %.loc43_37.2, %.loc43_37.3
  1658. // CHECK:STDOUT: %less_than_or_equal: bool = bind_name less_than_or_equal, %.loc43_37.4
  1659. // CHECK:STDOUT: %facet_value.loc35: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1660. // CHECK:STDOUT: %.loc35_6.4: %type_where = converted constants.%C, %facet_value.loc35 [concrete = constants.%facet_value]
  1661. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc35: <bound method> = bound_method %.loc35_6.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1662. // CHECK:STDOUT: <elided>
  1663. // CHECK:STDOUT: %bound_method.loc35: <bound method> = bound_method %.loc35_6.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
  1664. // CHECK:STDOUT: %addr.loc35_6.3: %ptr.d9e = addr_of %.loc35_6.3
  1665. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc35: init %empty_tuple.type = call %bound_method.loc35(%addr.loc35_6.3)
  1666. // CHECK:STDOUT: %facet_value.loc34: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1667. // CHECK:STDOUT: %.loc34_6.4: %type_where = converted constants.%C, %facet_value.loc34 [concrete = constants.%facet_value]
  1668. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc34: <bound method> = bound_method %.loc34_6.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1669. // CHECK:STDOUT: <elided>
  1670. // CHECK:STDOUT: %bound_method.loc34: <bound method> = bound_method %.loc34_6.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2
  1671. // CHECK:STDOUT: %addr.loc34_6.3: %ptr.d9e = addr_of %.loc34_6.3
  1672. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc34: init %empty_tuple.type = call %bound_method.loc34(%addr.loc34_6.3)
  1673. // CHECK:STDOUT: %facet_value.loc33: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1674. // CHECK:STDOUT: %.loc33_6.4: %type_where = converted constants.%C, %facet_value.loc33 [concrete = constants.%facet_value]
  1675. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc33: <bound method> = bound_method %.loc33_6.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1676. // CHECK:STDOUT: <elided>
  1677. // CHECK:STDOUT: %bound_method.loc33: <bound method> = bound_method %.loc33_6.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3
  1678. // CHECK:STDOUT: %addr.loc33_6.3: %ptr.d9e = addr_of %.loc33_6.3
  1679. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc33: init %empty_tuple.type = call %bound_method.loc33(%addr.loc33_6.3)
  1680. // CHECK:STDOUT: %facet_value.loc30: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1681. // CHECK:STDOUT: %.loc30_6.4: %type_where = converted constants.%C, %facet_value.loc30 [concrete = constants.%facet_value]
  1682. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc30: <bound method> = bound_method %.loc30_6.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1683. // CHECK:STDOUT: <elided>
  1684. // CHECK:STDOUT: %bound_method.loc30: <bound method> = bound_method %.loc30_6.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.4
  1685. // CHECK:STDOUT: %addr.loc30_6.3: %ptr.d9e = addr_of %.loc30_6.3
  1686. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc30: init %empty_tuple.type = call %bound_method.loc30(%addr.loc30_6.3)
  1687. // CHECK:STDOUT: %facet_value.loc29: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1688. // CHECK:STDOUT: %.loc29_6.4: %type_where = converted constants.%C, %facet_value.loc29 [concrete = constants.%facet_value]
  1689. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc29: <bound method> = bound_method %.loc29_6.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1690. // CHECK:STDOUT: <elided>
  1691. // CHECK:STDOUT: %bound_method.loc29: <bound method> = bound_method %.loc29_6.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.5
  1692. // CHECK:STDOUT: %addr.loc29_6.3: %ptr.d9e = addr_of %.loc29_6.3
  1693. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc29: init %empty_tuple.type = call %bound_method.loc29(%addr.loc29_6.3)
  1694. // CHECK:STDOUT: %facet_value.loc28: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1695. // CHECK:STDOUT: %.loc28_6.4: %type_where = converted constants.%C, %facet_value.loc28 [concrete = constants.%facet_value]
  1696. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc28: <bound method> = bound_method %.loc28_6.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1697. // CHECK:STDOUT: <elided>
  1698. // CHECK:STDOUT: %bound_method.loc28: <bound method> = bound_method %.loc28_6.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.6
  1699. // CHECK:STDOUT: %addr.loc28_6.3: %ptr.d9e = addr_of %.loc28_6.3
  1700. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc28: init %empty_tuple.type = call %bound_method.loc28(%addr.loc28_6.3)
  1701. // CHECK:STDOUT: %facet_value.loc27: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1702. // CHECK:STDOUT: %.loc27_6.4: %type_where = converted constants.%C, %facet_value.loc27 [concrete = constants.%facet_value]
  1703. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc27: <bound method> = bound_method %.loc27_6.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1704. // CHECK:STDOUT: <elided>
  1705. // CHECK:STDOUT: %bound_method.loc27: <bound method> = bound_method %.loc27_6.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.7
  1706. // CHECK:STDOUT: %addr.loc27_6.3: %ptr.d9e = addr_of %.loc27_6.3
  1707. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc27: init %empty_tuple.type = call %bound_method.loc27(%addr.loc27_6.3)
  1708. // CHECK:STDOUT: %facet_value.loc26: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1709. // CHECK:STDOUT: %.loc26_6.4: %type_where = converted constants.%C, %facet_value.loc26 [concrete = constants.%facet_value]
  1710. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc26: <bound method> = bound_method %.loc26_6.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1711. // CHECK:STDOUT: <elided>
  1712. // CHECK:STDOUT: %bound_method.loc26: <bound method> = bound_method %.loc26_6.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.8
  1713. // CHECK:STDOUT: %addr.loc26_6.3: %ptr.d9e = addr_of %.loc26_6.3
  1714. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc26: init %empty_tuple.type = call %bound_method.loc26(%addr.loc26_6.3)
  1715. // CHECK:STDOUT: %facet_value.loc23: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1716. // CHECK:STDOUT: %.loc23_31.5: %type_where = converted constants.%C, %facet_value.loc23 [concrete = constants.%facet_value]
  1717. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc23: <bound method> = bound_method %.loc23_31.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1718. // CHECK:STDOUT: <elided>
  1719. // CHECK:STDOUT: %bound_method.loc23_31: <bound method> = bound_method %.loc23_31.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.9
  1720. // CHECK:STDOUT: %addr.loc23_31.3: %ptr.d9e = addr_of %.loc23_31.3
  1721. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc23: init %empty_tuple.type = call %bound_method.loc23_31(%addr.loc23_31.3)
  1722. // CHECK:STDOUT: %facet_value.loc22: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1723. // CHECK:STDOUT: %.loc22_30.5: %type_where = converted constants.%C, %facet_value.loc22 [concrete = constants.%facet_value]
  1724. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc22: <bound method> = bound_method %.loc22_30.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1725. // CHECK:STDOUT: <elided>
  1726. // CHECK:STDOUT: %bound_method.loc22_30: <bound method> = bound_method %.loc22_30.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.10
  1727. // CHECK:STDOUT: %addr.loc22_30.3: %ptr.d9e = addr_of %.loc22_30.3
  1728. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc22: init %empty_tuple.type = call %bound_method.loc22_30(%addr.loc22_30.3)
  1729. // CHECK:STDOUT: %facet_value.loc21: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1730. // CHECK:STDOUT: %.loc21_31.5: %type_where = converted constants.%C, %facet_value.loc21 [concrete = constants.%facet_value]
  1731. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc21: <bound method> = bound_method %.loc21_31.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1732. // CHECK:STDOUT: <elided>
  1733. // CHECK:STDOUT: %bound_method.loc21: <bound method> = bound_method %.loc21_31.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.11
  1734. // CHECK:STDOUT: %addr.loc21_31.4: %ptr.d9e = addr_of %.loc21_31.3
  1735. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc21: init %empty_tuple.type = call %bound_method.loc21(%addr.loc21_31.4)
  1736. // CHECK:STDOUT: %facet_value.loc20: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1737. // CHECK:STDOUT: %.loc20_30.5: %type_where = converted constants.%C, %facet_value.loc20 [concrete = constants.%facet_value]
  1738. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc20: <bound method> = bound_method %.loc20_30.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1739. // CHECK:STDOUT: <elided>
  1740. // CHECK:STDOUT: %bound_method.loc20: <bound method> = bound_method %.loc20_30.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.12
  1741. // CHECK:STDOUT: %addr.loc20_30.4: %ptr.d9e = addr_of %.loc20_30.3
  1742. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc20: init %empty_tuple.type = call %bound_method.loc20(%addr.loc20_30.4)
  1743. // CHECK:STDOUT: %facet_value.loc19: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1744. // CHECK:STDOUT: %.loc19_31.5: %type_where = converted constants.%C, %facet_value.loc19 [concrete = constants.%facet_value]
  1745. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc19: <bound method> = bound_method %.loc19_31.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1746. // CHECK:STDOUT: <elided>
  1747. // CHECK:STDOUT: %bound_method.loc19: <bound method> = bound_method %.loc19_31.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.13
  1748. // CHECK:STDOUT: %addr.loc19_31.4: %ptr.d9e = addr_of %.loc19_31.3
  1749. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc19: init %empty_tuple.type = call %bound_method.loc19(%addr.loc19_31.4)
  1750. // CHECK:STDOUT: %facet_value.loc16: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1751. // CHECK:STDOUT: %.loc16_26.5: %type_where = converted constants.%C, %facet_value.loc16 [concrete = constants.%facet_value]
  1752. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc16: <bound method> = bound_method %.loc16_26.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1753. // CHECK:STDOUT: <elided>
  1754. // CHECK:STDOUT: %bound_method.loc16: <bound method> = bound_method %.loc16_26.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.14
  1755. // CHECK:STDOUT: %addr.loc16_26.4: %ptr.d9e = addr_of %.loc16_26.3
  1756. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc16: init %empty_tuple.type = call %bound_method.loc16(%addr.loc16_26.4)
  1757. // CHECK:STDOUT: %facet_value.loc15: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1758. // CHECK:STDOUT: %.loc15_28.5: %type_where = converted constants.%C, %facet_value.loc15 [concrete = constants.%facet_value]
  1759. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc15: <bound method> = bound_method %.loc15_28.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1760. // CHECK:STDOUT: <elided>
  1761. // CHECK:STDOUT: %bound_method.loc15: <bound method> = bound_method %.loc15_28.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.15
  1762. // CHECK:STDOUT: %addr.loc15_28.4: %ptr.d9e = addr_of %.loc15_28.3
  1763. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc15: init %empty_tuple.type = call %bound_method.loc15(%addr.loc15_28.4)
  1764. // CHECK:STDOUT: %facet_value.loc14: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1765. // CHECK:STDOUT: %.loc14_34.5: %type_where = converted constants.%C, %facet_value.loc14 [concrete = constants.%facet_value]
  1766. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc14: <bound method> = bound_method %.loc14_34.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1767. // CHECK:STDOUT: <elided>
  1768. // CHECK:STDOUT: %bound_method.loc14: <bound method> = bound_method %.loc14_34.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.16
  1769. // CHECK:STDOUT: %addr.loc14_34.4: %ptr.d9e = addr_of %.loc14_34.3
  1770. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc14: init %empty_tuple.type = call %bound_method.loc14(%addr.loc14_34.4)
  1771. // CHECK:STDOUT: %facet_value.loc13: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1772. // CHECK:STDOUT: %.loc13_31.5: %type_where = converted constants.%C, %facet_value.loc13 [concrete = constants.%facet_value]
  1773. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc13: <bound method> = bound_method %.loc13_31.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1774. // CHECK:STDOUT: <elided>
  1775. // CHECK:STDOUT: %bound_method.loc13: <bound method> = bound_method %.loc13_31.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.17
  1776. // CHECK:STDOUT: %addr.loc13_31.4: %ptr.d9e = addr_of %.loc13_31.3
  1777. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc13: init %empty_tuple.type = call %bound_method.loc13(%addr.loc13_31.4)
  1778. // CHECK:STDOUT: %facet_value.loc12: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1779. // CHECK:STDOUT: %.loc12_28.5: %type_where = converted constants.%C, %facet_value.loc12 [concrete = constants.%facet_value]
  1780. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc12: <bound method> = bound_method %.loc12_28.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1781. // CHECK:STDOUT: <elided>
  1782. // CHECK:STDOUT: %bound_method.loc12: <bound method> = bound_method %.loc12_28.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.18
  1783. // CHECK:STDOUT: %addr.loc12_28.4: %ptr.d9e = addr_of %.loc12_28.3
  1784. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc12: init %empty_tuple.type = call %bound_method.loc12(%addr.loc12_28.4)
  1785. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1786. // CHECK:STDOUT: %.loc9_3.2: %type_where = converted constants.%C, %facet_value.loc9 [concrete = constants.%facet_value]
  1787. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc9: <bound method> = bound_method %c2.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1788. // CHECK:STDOUT: <elided>
  1789. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %c2.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.19
  1790. // CHECK:STDOUT: %addr.loc9_3: %ptr.d9e = addr_of %c2.var
  1791. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9_3)
  1792. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1793. // CHECK:STDOUT: %.loc8_3.2: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  1794. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %c1.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1795. // CHECK:STDOUT: <elided>
  1796. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %c1.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.20
  1797. // CHECK:STDOUT: %addr.loc8_3: %ptr.d9e = addr_of %c1.var
  1798. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_3)
  1799. // CHECK:STDOUT: <elided>
  1800. // CHECK:STDOUT: }
  1801. // CHECK:STDOUT:
  1802. // CHECK:STDOUT: --- multiple_calls.carbon
  1803. // CHECK:STDOUT:
  1804. // CHECK:STDOUT: constants {
  1805. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1806. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1807. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  1808. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  1809. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  1810. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  1811. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  1812. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  1813. // CHECK:STDOUT: %operator+__carbon_thunk.type: type = fn_type @operator+__carbon_thunk [concrete]
  1814. // CHECK:STDOUT: %operator+__carbon_thunk: %operator+__carbon_thunk.type = struct_value () [concrete]
  1815. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  1816. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  1817. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b92: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  1818. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.841: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b92 = struct_value () [concrete]
  1819. // CHECK:STDOUT: }
  1820. // CHECK:STDOUT:
  1821. // CHECK:STDOUT: imports {
  1822. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  1823. // CHECK:STDOUT: .C = %C.decl
  1824. // CHECK:STDOUT: import Cpp//...
  1825. // CHECK:STDOUT: }
  1826. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1827. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete = constants.%C.C.cpp_overload_set.value]
  1828. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  1829. // CHECK:STDOUT: <elided>
  1830. // CHECK:STDOUT: } {
  1831. // CHECK:STDOUT: <elided>
  1832. // CHECK:STDOUT: }
  1833. // CHECK:STDOUT: %operator+__carbon_thunk.decl: %operator+__carbon_thunk.type = fn_decl @operator+__carbon_thunk [concrete = constants.%operator+__carbon_thunk] {
  1834. // CHECK:STDOUT: <elided>
  1835. // CHECK:STDOUT: } {
  1836. // CHECK:STDOUT: <elided>
  1837. // CHECK:STDOUT: }
  1838. // CHECK:STDOUT: }
  1839. // CHECK:STDOUT:
  1840. // CHECK:STDOUT: fn @F() {
  1841. // CHECK:STDOUT: !entry:
  1842. // CHECK:STDOUT: name_binding_decl {
  1843. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = binding_pattern c1 [concrete]
  1844. // CHECK:STDOUT: }
  1845. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1846. // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1847. // CHECK:STDOUT: %C.ref.loc8_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  1848. // CHECK:STDOUT: %.loc8_27.1: ref %C = temporary_storage
  1849. // CHECK:STDOUT: %addr.loc8_27.1: %ptr.d9e = addr_of %.loc8_27.1
  1850. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_27.1)
  1851. // CHECK:STDOUT: %.loc8_27.2: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_27.1
  1852. // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] {
  1853. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1854. // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1855. // CHECK:STDOUT: }
  1856. // CHECK:STDOUT: %.loc8_27.3: ref %C = temporary %.loc8_27.1, %.loc8_27.2
  1857. // CHECK:STDOUT: %.loc8_27.4: %C = bind_value %.loc8_27.3
  1858. // CHECK:STDOUT: %c1: %C = bind_name c1, %.loc8_27.4
  1859. // CHECK:STDOUT: name_binding_decl {
  1860. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = binding_pattern c2 [concrete]
  1861. // CHECK:STDOUT: }
  1862. // CHECK:STDOUT: %Cpp.ref.loc9_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1863. // CHECK:STDOUT: %C.ref.loc9_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1864. // CHECK:STDOUT: %C.ref.loc9_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  1865. // CHECK:STDOUT: %.loc9_27.1: ref %C = temporary_storage
  1866. // CHECK:STDOUT: %addr.loc9_27.1: %ptr.d9e = addr_of %.loc9_27.1
  1867. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc9_27.1)
  1868. // CHECK:STDOUT: %.loc9_27.2: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_27.1
  1869. // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] {
  1870. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1871. // CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1872. // CHECK:STDOUT: }
  1873. // CHECK:STDOUT: %.loc9_27.3: ref %C = temporary %.loc9_27.1, %.loc9_27.2
  1874. // CHECK:STDOUT: %.loc9_27.4: %C = bind_value %.loc9_27.3
  1875. // CHECK:STDOUT: %c2: %C = bind_name c2, %.loc9_27.4
  1876. // CHECK:STDOUT: name_binding_decl {
  1877. // CHECK:STDOUT: %c3.patt: %pattern_type.217 = binding_pattern c3 [concrete]
  1878. // CHECK:STDOUT: }
  1879. // CHECK:STDOUT: %c1.ref.loc10: %C = name_ref c1, %c1
  1880. // CHECK:STDOUT: %c2.ref: %C = name_ref c2, %c2
  1881. // CHECK:STDOUT: %.loc10_22.1: ref %C = temporary_storage
  1882. // CHECK:STDOUT: %.loc10_19: ref %C = value_as_ref %c1.ref.loc10
  1883. // CHECK:STDOUT: %addr.loc10_22.1: %ptr.d9e = addr_of %.loc10_19
  1884. // CHECK:STDOUT: %.loc10_24: ref %C = value_as_ref %c2.ref
  1885. // CHECK:STDOUT: %addr.loc10_22.2: %ptr.d9e = addr_of %.loc10_24
  1886. // CHECK:STDOUT: %addr.loc10_22.3: %ptr.d9e = addr_of %.loc10_22.1
  1887. // CHECK:STDOUT: %operator+__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%operator+__carbon_thunk.decl(%addr.loc10_22.1, %addr.loc10_22.2, %addr.loc10_22.3)
  1888. // CHECK:STDOUT: %.loc10_22.2: init %C = in_place_init %operator+__carbon_thunk.call.loc10, %.loc10_22.1
  1889. // CHECK:STDOUT: %.loc10_14: type = splice_block %C.ref.loc10 [concrete = constants.%C] {
  1890. // CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1891. // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1892. // CHECK:STDOUT: }
  1893. // CHECK:STDOUT: %.loc10_22.3: ref %C = temporary %.loc10_22.1, %.loc10_22.2
  1894. // CHECK:STDOUT: %.loc10_22.4: %C = bind_value %.loc10_22.3
  1895. // CHECK:STDOUT: %c3: %C = bind_name c3, %.loc10_22.4
  1896. // CHECK:STDOUT: name_binding_decl {
  1897. // CHECK:STDOUT: %c4.patt: %pattern_type.217 = binding_pattern c4 [concrete]
  1898. // CHECK:STDOUT: }
  1899. // CHECK:STDOUT: %c1.ref.loc11: %C = name_ref c1, %c1
  1900. // CHECK:STDOUT: %c3.ref.loc11: %C = name_ref c3, %c3
  1901. // CHECK:STDOUT: %.loc11_22.1: ref %C = temporary_storage
  1902. // CHECK:STDOUT: %.loc11_19: ref %C = value_as_ref %c1.ref.loc11
  1903. // CHECK:STDOUT: %addr.loc11_22.1: %ptr.d9e = addr_of %.loc11_19
  1904. // CHECK:STDOUT: %.loc11_24: ref %C = value_as_ref %c3.ref.loc11
  1905. // CHECK:STDOUT: %addr.loc11_22.2: %ptr.d9e = addr_of %.loc11_24
  1906. // CHECK:STDOUT: %addr.loc11_22.3: %ptr.d9e = addr_of %.loc11_22.1
  1907. // CHECK:STDOUT: %operator+__carbon_thunk.call.loc11: init %empty_tuple.type = call imports.%operator+__carbon_thunk.decl(%addr.loc11_22.1, %addr.loc11_22.2, %addr.loc11_22.3)
  1908. // CHECK:STDOUT: %.loc11_22.2: init %C = in_place_init %operator+__carbon_thunk.call.loc11, %.loc11_22.1
  1909. // CHECK:STDOUT: %.loc11_14: type = splice_block %C.ref.loc11 [concrete = constants.%C] {
  1910. // CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1911. // CHECK:STDOUT: %C.ref.loc11: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1912. // CHECK:STDOUT: }
  1913. // CHECK:STDOUT: %.loc11_22.3: ref %C = temporary %.loc11_22.1, %.loc11_22.2
  1914. // CHECK:STDOUT: %.loc11_22.4: %C = bind_value %.loc11_22.3
  1915. // CHECK:STDOUT: %c4: %C = bind_name c4, %.loc11_22.4
  1916. // CHECK:STDOUT: name_binding_decl {
  1917. // CHECK:STDOUT: %c5.patt: %pattern_type.217 = binding_pattern c5 [concrete]
  1918. // CHECK:STDOUT: }
  1919. // CHECK:STDOUT: %c4.ref: %C = name_ref c4, %c4
  1920. // CHECK:STDOUT: %c3.ref.loc12: %C = name_ref c3, %c3
  1921. // CHECK:STDOUT: %.loc12_22.1: ref %C = temporary_storage
  1922. // CHECK:STDOUT: %.loc12_19: ref %C = value_as_ref %c4.ref
  1923. // CHECK:STDOUT: %addr.loc12_22.1: %ptr.d9e = addr_of %.loc12_19
  1924. // CHECK:STDOUT: %.loc12_24: ref %C = value_as_ref %c3.ref.loc12
  1925. // CHECK:STDOUT: %addr.loc12_22.2: %ptr.d9e = addr_of %.loc12_24
  1926. // CHECK:STDOUT: %addr.loc12_22.3: %ptr.d9e = addr_of %.loc12_22.1
  1927. // CHECK:STDOUT: %operator+__carbon_thunk.call.loc12: init %empty_tuple.type = call imports.%operator+__carbon_thunk.decl(%addr.loc12_22.1, %addr.loc12_22.2, %addr.loc12_22.3)
  1928. // CHECK:STDOUT: %.loc12_22.2: init %C = in_place_init %operator+__carbon_thunk.call.loc12, %.loc12_22.1
  1929. // CHECK:STDOUT: %.loc12_14: type = splice_block %C.ref.loc12 [concrete = constants.%C] {
  1930. // CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1931. // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1932. // CHECK:STDOUT: }
  1933. // CHECK:STDOUT: %.loc12_22.3: ref %C = temporary %.loc12_22.1, %.loc12_22.2
  1934. // CHECK:STDOUT: %.loc12_22.4: %C = bind_value %.loc12_22.3
  1935. // CHECK:STDOUT: %c5: %C = bind_name c5, %.loc12_22.4
  1936. // CHECK:STDOUT: %facet_value.loc12: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1937. // CHECK:STDOUT: %.loc12_22.5: %type_where = converted constants.%C, %facet_value.loc12 [concrete = constants.%facet_value]
  1938. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc12: <bound method> = bound_method %.loc12_22.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1939. // CHECK:STDOUT: <elided>
  1940. // CHECK:STDOUT: %bound_method.loc12: <bound method> = bound_method %.loc12_22.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
  1941. // CHECK:STDOUT: %addr.loc12_22.4: %ptr.d9e = addr_of %.loc12_22.3
  1942. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc12: init %empty_tuple.type = call %bound_method.loc12(%addr.loc12_22.4)
  1943. // CHECK:STDOUT: %facet_value.loc11: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1944. // CHECK:STDOUT: %.loc11_22.5: %type_where = converted constants.%C, %facet_value.loc11 [concrete = constants.%facet_value]
  1945. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc11: <bound method> = bound_method %.loc11_22.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1946. // CHECK:STDOUT: <elided>
  1947. // CHECK:STDOUT: %bound_method.loc11: <bound method> = bound_method %.loc11_22.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2
  1948. // CHECK:STDOUT: %addr.loc11_22.4: %ptr.d9e = addr_of %.loc11_22.3
  1949. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc11: init %empty_tuple.type = call %bound_method.loc11(%addr.loc11_22.4)
  1950. // CHECK:STDOUT: %facet_value.loc10: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1951. // CHECK:STDOUT: %.loc10_22.5: %type_where = converted constants.%C, %facet_value.loc10 [concrete = constants.%facet_value]
  1952. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10: <bound method> = bound_method %.loc10_22.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1953. // CHECK:STDOUT: <elided>
  1954. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %.loc10_22.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3
  1955. // CHECK:STDOUT: %addr.loc10_22.4: %ptr.d9e = addr_of %.loc10_22.3
  1956. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10_22.4)
  1957. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1958. // CHECK:STDOUT: %.loc9_27.5: %type_where = converted constants.%C, %facet_value.loc9 [concrete = constants.%facet_value]
  1959. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc9: <bound method> = bound_method %.loc9_27.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1960. // CHECK:STDOUT: <elided>
  1961. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %.loc9_27.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.4
  1962. // CHECK:STDOUT: %addr.loc9_27.2: %ptr.d9e = addr_of %.loc9_27.3
  1963. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9_27.2)
  1964. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1965. // CHECK:STDOUT: %.loc8_27.5: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  1966. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %.loc8_27.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  1967. // CHECK:STDOUT: <elided>
  1968. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %.loc8_27.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.5
  1969. // CHECK:STDOUT: %addr.loc8_27.2: %ptr.d9e = addr_of %.loc8_27.3
  1970. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_27.2)
  1971. // CHECK:STDOUT: <elided>
  1972. // CHECK:STDOUT: }
  1973. // CHECK:STDOUT:
  1974. // CHECK:STDOUT: --- fail_todo_rewrite_spaceship.carbon
  1975. // CHECK:STDOUT:
  1976. // CHECK:STDOUT: constants {
  1977. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1978. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1979. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  1980. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  1981. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  1982. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  1983. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  1984. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  1985. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
  1986. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
  1987. // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete]
  1988. // CHECK:STDOUT: %ptr.bb2: type = ptr_type bool [concrete]
  1989. // CHECK:STDOUT: %operator>__carbon_thunk.type: type = fn_type @operator>__carbon_thunk [concrete]
  1990. // CHECK:STDOUT: %operator>__carbon_thunk: %operator>__carbon_thunk.type = struct_value () [concrete]
  1991. // CHECK:STDOUT: %operator<=__carbon_thunk.type: type = fn_type @operator<=__carbon_thunk [concrete]
  1992. // CHECK:STDOUT: %operator<=__carbon_thunk: %operator<=__carbon_thunk.type = struct_value () [concrete]
  1993. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  1994. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  1995. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b92: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  1996. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.841: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b92 = struct_value () [concrete]
  1997. // CHECK:STDOUT: }
  1998. // CHECK:STDOUT:
  1999. // CHECK:STDOUT: imports {
  2000. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  2001. // CHECK:STDOUT: .C = %C.decl
  2002. // CHECK:STDOUT: import Cpp//...
  2003. // CHECK:STDOUT: }
  2004. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  2005. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete = constants.%C.C.cpp_overload_set.value]
  2006. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  2007. // CHECK:STDOUT: <elided>
  2008. // CHECK:STDOUT: } {
  2009. // CHECK:STDOUT: <elided>
  2010. // CHECK:STDOUT: }
  2011. // CHECK:STDOUT: %operator>__carbon_thunk.decl: %operator>__carbon_thunk.type = fn_decl @operator>__carbon_thunk [concrete = constants.%operator>__carbon_thunk] {
  2012. // CHECK:STDOUT: <elided>
  2013. // CHECK:STDOUT: } {
  2014. // CHECK:STDOUT: <elided>
  2015. // CHECK:STDOUT: }
  2016. // CHECK:STDOUT: %operator<=__carbon_thunk.decl: %operator<=__carbon_thunk.type = fn_decl @operator<=__carbon_thunk [concrete = constants.%operator<=__carbon_thunk] {
  2017. // CHECK:STDOUT: <elided>
  2018. // CHECK:STDOUT: } {
  2019. // CHECK:STDOUT: <elided>
  2020. // CHECK:STDOUT: }
  2021. // CHECK:STDOUT: }
  2022. // CHECK:STDOUT:
  2023. // CHECK:STDOUT: fn @F() {
  2024. // CHECK:STDOUT: !entry:
  2025. // CHECK:STDOUT: name_binding_decl {
  2026. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = binding_pattern c1 [concrete]
  2027. // CHECK:STDOUT: %c1.var_patt: %pattern_type.217 = var_pattern %c1.patt [concrete]
  2028. // CHECK:STDOUT: }
  2029. // CHECK:STDOUT: %c1.var: ref %C = var %c1.var_patt
  2030. // CHECK:STDOUT: %Cpp.ref.loc15_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2031. // CHECK:STDOUT: %C.ref.loc15_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2032. // CHECK:STDOUT: %C.ref.loc15_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  2033. // CHECK:STDOUT: %.loc15_3.1: ref %C = splice_block %c1.var {}
  2034. // CHECK:STDOUT: %addr.loc15_27: %ptr.d9e = addr_of %.loc15_3.1
  2035. // CHECK:STDOUT: %C__carbon_thunk.call.loc15: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc15_27)
  2036. // CHECK:STDOUT: %.loc15_27: init %C = in_place_init %C__carbon_thunk.call.loc15, %.loc15_3.1
  2037. // CHECK:STDOUT: assign %c1.var, %.loc15_27
  2038. // CHECK:STDOUT: %.loc15_14: type = splice_block %C.ref.loc15_14 [concrete = constants.%C] {
  2039. // CHECK:STDOUT: %Cpp.ref.loc15_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2040. // CHECK:STDOUT: %C.ref.loc15_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2041. // CHECK:STDOUT: }
  2042. // CHECK:STDOUT: %c1: ref %C = bind_name c1, %c1.var
  2043. // CHECK:STDOUT: name_binding_decl {
  2044. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = binding_pattern c2 [concrete]
  2045. // CHECK:STDOUT: %c2.var_patt: %pattern_type.217 = var_pattern %c2.patt [concrete]
  2046. // CHECK:STDOUT: }
  2047. // CHECK:STDOUT: %c2.var: ref %C = var %c2.var_patt
  2048. // CHECK:STDOUT: %Cpp.ref.loc16_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2049. // CHECK:STDOUT: %C.ref.loc16_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2050. // CHECK:STDOUT: %C.ref.loc16_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  2051. // CHECK:STDOUT: %.loc16_3.1: ref %C = splice_block %c2.var {}
  2052. // CHECK:STDOUT: %addr.loc16_27: %ptr.d9e = addr_of %.loc16_3.1
  2053. // CHECK:STDOUT: %C__carbon_thunk.call.loc16: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc16_27)
  2054. // CHECK:STDOUT: %.loc16_27: init %C = in_place_init %C__carbon_thunk.call.loc16, %.loc16_3.1
  2055. // CHECK:STDOUT: assign %c2.var, %.loc16_27
  2056. // CHECK:STDOUT: %.loc16_14: type = splice_block %C.ref.loc16_14 [concrete = constants.%C] {
  2057. // CHECK:STDOUT: %Cpp.ref.loc16_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2058. // CHECK:STDOUT: %C.ref.loc16_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2059. // CHECK:STDOUT: }
  2060. // CHECK:STDOUT: %c2: ref %C = bind_name c2, %c2.var
  2061. // CHECK:STDOUT: name_binding_decl {
  2062. // CHECK:STDOUT: %greater_than.patt: %pattern_type.831 = binding_pattern greater_than [concrete]
  2063. // CHECK:STDOUT: }
  2064. // CHECK:STDOUT: %c1.ref.loc19: ref %C = name_ref c1, %c1
  2065. // CHECK:STDOUT: %c2.ref.loc19: ref %C = name_ref c2, %c2
  2066. // CHECK:STDOUT: %.loc19_28.1: %C = bind_value %c1.ref.loc19
  2067. // CHECK:STDOUT: %.loc19_33.1: %C = bind_value %c2.ref.loc19
  2068. // CHECK:STDOUT: %.loc19_28.2: ref %C = value_as_ref %.loc19_28.1
  2069. // CHECK:STDOUT: %addr.loc19_31.1: %ptr.d9e = addr_of %.loc19_28.2
  2070. // CHECK:STDOUT: %.loc19_33.2: ref %C = value_as_ref %.loc19_33.1
  2071. // CHECK:STDOUT: %addr.loc19_31.2: %ptr.d9e = addr_of %.loc19_33.2
  2072. // CHECK:STDOUT: %.loc19_31.1: ref bool = temporary_storage
  2073. // CHECK:STDOUT: %addr.loc19_31.3: %ptr.bb2 = addr_of %.loc19_31.1
  2074. // CHECK:STDOUT: %operator>__carbon_thunk.call: init %empty_tuple.type = call imports.%operator>__carbon_thunk.decl(%addr.loc19_31.1, %addr.loc19_31.2, %addr.loc19_31.3)
  2075. // CHECK:STDOUT: %.loc19_31.2: init bool = in_place_init %operator>__carbon_thunk.call, %.loc19_31.1
  2076. // CHECK:STDOUT: %.loc19_21.1: type = splice_block %.loc19_21.3 [concrete = bool] {
  2077. // CHECK:STDOUT: %Bool.call.loc19: init type = call constants.%Bool() [concrete = bool]
  2078. // CHECK:STDOUT: %.loc19_21.2: type = value_of_initializer %Bool.call.loc19 [concrete = bool]
  2079. // CHECK:STDOUT: %.loc19_21.3: type = converted %Bool.call.loc19, %.loc19_21.2 [concrete = bool]
  2080. // CHECK:STDOUT: }
  2081. // CHECK:STDOUT: %.loc19_31.3: bool = value_of_initializer %.loc19_31.2
  2082. // CHECK:STDOUT: %.loc19_31.4: bool = converted %.loc19_31.2, %.loc19_31.3
  2083. // CHECK:STDOUT: %greater_than: bool = bind_name greater_than, %.loc19_31.4
  2084. // CHECK:STDOUT: name_binding_decl {
  2085. // CHECK:STDOUT: %less_than.patt: %pattern_type.831 = binding_pattern less_than [concrete]
  2086. // CHECK:STDOUT: }
  2087. // CHECK:STDOUT: %c1.ref.loc26: ref %C = name_ref c1, %c1
  2088. // CHECK:STDOUT: %c2.ref.loc26: ref %C = name_ref c2, %c2
  2089. // CHECK:STDOUT: %.loc26_18.1: type = splice_block %.loc26_18.3 [concrete = bool] {
  2090. // CHECK:STDOUT: %Bool.call.loc26: init type = call constants.%Bool() [concrete = bool]
  2091. // CHECK:STDOUT: %.loc26_18.2: type = value_of_initializer %Bool.call.loc26 [concrete = bool]
  2092. // CHECK:STDOUT: %.loc26_18.3: type = converted %Bool.call.loc26, %.loc26_18.2 [concrete = bool]
  2093. // CHECK:STDOUT: }
  2094. // CHECK:STDOUT: %less_than: bool = bind_name less_than, <error> [concrete = <error>]
  2095. // CHECK:STDOUT: name_binding_decl {
  2096. // CHECK:STDOUT: %greater_than_or_equal.patt: %pattern_type.831 = binding_pattern greater_than_or_equal [concrete]
  2097. // CHECK:STDOUT: }
  2098. // CHECK:STDOUT: %c1.ref.loc33: ref %C = name_ref c1, %c1
  2099. // CHECK:STDOUT: %c2.ref.loc33: ref %C = name_ref c2, %c2
  2100. // CHECK:STDOUT: %.loc33_30.1: type = splice_block %.loc33_30.3 [concrete = bool] {
  2101. // CHECK:STDOUT: %Bool.call.loc33: init type = call constants.%Bool() [concrete = bool]
  2102. // CHECK:STDOUT: %.loc33_30.2: type = value_of_initializer %Bool.call.loc33 [concrete = bool]
  2103. // CHECK:STDOUT: %.loc33_30.3: type = converted %Bool.call.loc33, %.loc33_30.2 [concrete = bool]
  2104. // CHECK:STDOUT: }
  2105. // CHECK:STDOUT: %greater_than_or_equal: bool = bind_name greater_than_or_equal, <error> [concrete = <error>]
  2106. // CHECK:STDOUT: name_binding_decl {
  2107. // CHECK:STDOUT: %less_than_or_equal.patt: %pattern_type.831 = binding_pattern less_than_or_equal [concrete]
  2108. // CHECK:STDOUT: }
  2109. // CHECK:STDOUT: %c1.ref.loc36: ref %C = name_ref c1, %c1
  2110. // CHECK:STDOUT: %c2.ref.loc36: ref %C = name_ref c2, %c2
  2111. // CHECK:STDOUT: %.loc36_34.1: %C = bind_value %c1.ref.loc36
  2112. // CHECK:STDOUT: %.loc36_40.1: %C = bind_value %c2.ref.loc36
  2113. // CHECK:STDOUT: %.loc36_34.2: ref %C = value_as_ref %.loc36_34.1
  2114. // CHECK:STDOUT: %addr.loc36_37.1: %ptr.d9e = addr_of %.loc36_34.2
  2115. // CHECK:STDOUT: %.loc36_40.2: ref %C = value_as_ref %.loc36_40.1
  2116. // CHECK:STDOUT: %addr.loc36_37.2: %ptr.d9e = addr_of %.loc36_40.2
  2117. // CHECK:STDOUT: %.loc36_37.1: ref bool = temporary_storage
  2118. // CHECK:STDOUT: %addr.loc36_37.3: %ptr.bb2 = addr_of %.loc36_37.1
  2119. // CHECK:STDOUT: %operator<=__carbon_thunk.call: init %empty_tuple.type = call imports.%operator<=__carbon_thunk.decl(%addr.loc36_37.1, %addr.loc36_37.2, %addr.loc36_37.3)
  2120. // CHECK:STDOUT: %.loc36_37.2: init bool = in_place_init %operator<=__carbon_thunk.call, %.loc36_37.1
  2121. // CHECK:STDOUT: %.loc36_27.1: type = splice_block %.loc36_27.3 [concrete = bool] {
  2122. // CHECK:STDOUT: %Bool.call.loc36: init type = call constants.%Bool() [concrete = bool]
  2123. // CHECK:STDOUT: %.loc36_27.2: type = value_of_initializer %Bool.call.loc36 [concrete = bool]
  2124. // CHECK:STDOUT: %.loc36_27.3: type = converted %Bool.call.loc36, %.loc36_27.2 [concrete = bool]
  2125. // CHECK:STDOUT: }
  2126. // CHECK:STDOUT: %.loc36_37.3: bool = value_of_initializer %.loc36_37.2
  2127. // CHECK:STDOUT: %.loc36_37.4: bool = converted %.loc36_37.2, %.loc36_37.3
  2128. // CHECK:STDOUT: %less_than_or_equal: bool = bind_name less_than_or_equal, %.loc36_37.4
  2129. // CHECK:STDOUT: %facet_value.loc16: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2130. // CHECK:STDOUT: %.loc16_3.2: %type_where = converted constants.%C, %facet_value.loc16 [concrete = constants.%facet_value]
  2131. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc16: <bound method> = bound_method %c2.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  2132. // CHECK:STDOUT: <elided>
  2133. // CHECK:STDOUT: %bound_method.loc16: <bound method> = bound_method %c2.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
  2134. // CHECK:STDOUT: %addr.loc16_3: %ptr.d9e = addr_of %c2.var
  2135. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc16: init %empty_tuple.type = call %bound_method.loc16(%addr.loc16_3)
  2136. // CHECK:STDOUT: %facet_value.loc15: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2137. // CHECK:STDOUT: %.loc15_3.2: %type_where = converted constants.%C, %facet_value.loc15 [concrete = constants.%facet_value]
  2138. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc15: <bound method> = bound_method %c1.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  2139. // CHECK:STDOUT: <elided>
  2140. // CHECK:STDOUT: %bound_method.loc15: <bound method> = bound_method %c1.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2
  2141. // CHECK:STDOUT: %addr.loc15_3: %ptr.d9e = addr_of %c1.var
  2142. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc15: init %empty_tuple.type = call %bound_method.loc15(%addr.loc15_3)
  2143. // CHECK:STDOUT: <elided>
  2144. // CHECK:STDOUT: }
  2145. // CHECK:STDOUT:
  2146. // CHECK:STDOUT: --- fail_todo_rewrite_equal.carbon
  2147. // CHECK:STDOUT:
  2148. // CHECK:STDOUT: constants {
  2149. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2150. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  2151. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  2152. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  2153. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  2154. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  2155. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  2156. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  2157. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
  2158. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
  2159. // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete]
  2160. // CHECK:STDOUT: %ptr.bb2: type = ptr_type bool [concrete]
  2161. // CHECK:STDOUT: %operator==__carbon_thunk.type: type = fn_type @operator==__carbon_thunk [concrete]
  2162. // CHECK:STDOUT: %operator==__carbon_thunk: %operator==__carbon_thunk.type = struct_value () [concrete]
  2163. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  2164. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  2165. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b92: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  2166. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.841: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b92 = struct_value () [concrete]
  2167. // CHECK:STDOUT: }
  2168. // CHECK:STDOUT:
  2169. // CHECK:STDOUT: imports {
  2170. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  2171. // CHECK:STDOUT: .C = %C.decl
  2172. // CHECK:STDOUT: import Cpp//...
  2173. // CHECK:STDOUT: }
  2174. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  2175. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete = constants.%C.C.cpp_overload_set.value]
  2176. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  2177. // CHECK:STDOUT: <elided>
  2178. // CHECK:STDOUT: } {
  2179. // CHECK:STDOUT: <elided>
  2180. // CHECK:STDOUT: }
  2181. // CHECK:STDOUT: %operator==__carbon_thunk.decl: %operator==__carbon_thunk.type = fn_decl @operator==__carbon_thunk [concrete = constants.%operator==__carbon_thunk] {
  2182. // CHECK:STDOUT: <elided>
  2183. // CHECK:STDOUT: } {
  2184. // CHECK:STDOUT: <elided>
  2185. // CHECK:STDOUT: }
  2186. // CHECK:STDOUT: }
  2187. // CHECK:STDOUT:
  2188. // CHECK:STDOUT: fn @F() {
  2189. // CHECK:STDOUT: !entry:
  2190. // CHECK:STDOUT: name_binding_decl {
  2191. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = binding_pattern c1 [concrete]
  2192. // CHECK:STDOUT: %c1.var_patt: %pattern_type.217 = var_pattern %c1.patt [concrete]
  2193. // CHECK:STDOUT: }
  2194. // CHECK:STDOUT: %c1.var: ref %C = var %c1.var_patt
  2195. // CHECK:STDOUT: %Cpp.ref.loc12_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2196. // CHECK:STDOUT: %C.ref.loc12_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2197. // CHECK:STDOUT: %C.ref.loc12_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  2198. // CHECK:STDOUT: %.loc12_3.1: ref %C = splice_block %c1.var {}
  2199. // CHECK:STDOUT: %addr.loc12_27: %ptr.d9e = addr_of %.loc12_3.1
  2200. // CHECK:STDOUT: %C__carbon_thunk.call.loc12: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc12_27)
  2201. // CHECK:STDOUT: %.loc12_27: init %C = in_place_init %C__carbon_thunk.call.loc12, %.loc12_3.1
  2202. // CHECK:STDOUT: assign %c1.var, %.loc12_27
  2203. // CHECK:STDOUT: %.loc12_14: type = splice_block %C.ref.loc12_14 [concrete = constants.%C] {
  2204. // CHECK:STDOUT: %Cpp.ref.loc12_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2205. // CHECK:STDOUT: %C.ref.loc12_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2206. // CHECK:STDOUT: }
  2207. // CHECK:STDOUT: %c1: ref %C = bind_name c1, %c1.var
  2208. // CHECK:STDOUT: name_binding_decl {
  2209. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = binding_pattern c2 [concrete]
  2210. // CHECK:STDOUT: %c2.var_patt: %pattern_type.217 = var_pattern %c2.patt [concrete]
  2211. // CHECK:STDOUT: }
  2212. // CHECK:STDOUT: %c2.var: ref %C = var %c2.var_patt
  2213. // CHECK:STDOUT: %Cpp.ref.loc13_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2214. // CHECK:STDOUT: %C.ref.loc13_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2215. // CHECK:STDOUT: %C.ref.loc13_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  2216. // CHECK:STDOUT: %.loc13_3.1: ref %C = splice_block %c2.var {}
  2217. // CHECK:STDOUT: %addr.loc13_27: %ptr.d9e = addr_of %.loc13_3.1
  2218. // CHECK:STDOUT: %C__carbon_thunk.call.loc13: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc13_27)
  2219. // CHECK:STDOUT: %.loc13_27: init %C = in_place_init %C__carbon_thunk.call.loc13, %.loc13_3.1
  2220. // CHECK:STDOUT: assign %c2.var, %.loc13_27
  2221. // CHECK:STDOUT: %.loc13_14: type = splice_block %C.ref.loc13_14 [concrete = constants.%C] {
  2222. // CHECK:STDOUT: %Cpp.ref.loc13_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2223. // CHECK:STDOUT: %C.ref.loc13_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2224. // CHECK:STDOUT: }
  2225. // CHECK:STDOUT: %c2: ref %C = bind_name c2, %c2.var
  2226. // CHECK:STDOUT: name_binding_decl {
  2227. // CHECK:STDOUT: %equal.patt: %pattern_type.831 = binding_pattern equal [concrete]
  2228. // CHECK:STDOUT: }
  2229. // CHECK:STDOUT: %c1.ref.loc16: ref %C = name_ref c1, %c1
  2230. // CHECK:STDOUT: %c2.ref.loc16: ref %C = name_ref c2, %c2
  2231. // CHECK:STDOUT: %.loc16_21.1: %C = bind_value %c1.ref.loc16
  2232. // CHECK:STDOUT: %.loc16_27.1: %C = bind_value %c2.ref.loc16
  2233. // CHECK:STDOUT: %.loc16_21.2: ref %C = value_as_ref %.loc16_21.1
  2234. // CHECK:STDOUT: %addr.loc16_24.1: %ptr.d9e = addr_of %.loc16_21.2
  2235. // CHECK:STDOUT: %.loc16_27.2: ref %C = value_as_ref %.loc16_27.1
  2236. // CHECK:STDOUT: %addr.loc16_24.2: %ptr.d9e = addr_of %.loc16_27.2
  2237. // CHECK:STDOUT: %.loc16_24.1: ref bool = temporary_storage
  2238. // CHECK:STDOUT: %addr.loc16_24.3: %ptr.bb2 = addr_of %.loc16_24.1
  2239. // CHECK:STDOUT: %operator==__carbon_thunk.call: init %empty_tuple.type = call imports.%operator==__carbon_thunk.decl(%addr.loc16_24.1, %addr.loc16_24.2, %addr.loc16_24.3)
  2240. // CHECK:STDOUT: %.loc16_24.2: init bool = in_place_init %operator==__carbon_thunk.call, %.loc16_24.1
  2241. // CHECK:STDOUT: %.loc16_14.1: type = splice_block %.loc16_14.3 [concrete = bool] {
  2242. // CHECK:STDOUT: %Bool.call.loc16: init type = call constants.%Bool() [concrete = bool]
  2243. // CHECK:STDOUT: %.loc16_14.2: type = value_of_initializer %Bool.call.loc16 [concrete = bool]
  2244. // CHECK:STDOUT: %.loc16_14.3: type = converted %Bool.call.loc16, %.loc16_14.2 [concrete = bool]
  2245. // CHECK:STDOUT: }
  2246. // CHECK:STDOUT: %.loc16_24.3: bool = value_of_initializer %.loc16_24.2
  2247. // CHECK:STDOUT: %.loc16_24.4: bool = converted %.loc16_24.2, %.loc16_24.3
  2248. // CHECK:STDOUT: %equal: bool = bind_name equal, %.loc16_24.4
  2249. // CHECK:STDOUT: name_binding_decl {
  2250. // CHECK:STDOUT: %not_equal.patt: %pattern_type.831 = binding_pattern not_equal [concrete]
  2251. // CHECK:STDOUT: }
  2252. // CHECK:STDOUT: %c1.ref.loc23: ref %C = name_ref c1, %c1
  2253. // CHECK:STDOUT: %c2.ref.loc23: ref %C = name_ref c2, %c2
  2254. // CHECK:STDOUT: %.loc23_18.1: type = splice_block %.loc23_18.3 [concrete = bool] {
  2255. // CHECK:STDOUT: %Bool.call.loc23: init type = call constants.%Bool() [concrete = bool]
  2256. // CHECK:STDOUT: %.loc23_18.2: type = value_of_initializer %Bool.call.loc23 [concrete = bool]
  2257. // CHECK:STDOUT: %.loc23_18.3: type = converted %Bool.call.loc23, %.loc23_18.2 [concrete = bool]
  2258. // CHECK:STDOUT: }
  2259. // CHECK:STDOUT: %not_equal: bool = bind_name not_equal, <error> [concrete = <error>]
  2260. // CHECK:STDOUT: %facet_value.loc13: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2261. // CHECK:STDOUT: %.loc13_3.2: %type_where = converted constants.%C, %facet_value.loc13 [concrete = constants.%facet_value]
  2262. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc13: <bound method> = bound_method %c2.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  2263. // CHECK:STDOUT: <elided>
  2264. // CHECK:STDOUT: %bound_method.loc13: <bound method> = bound_method %c2.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
  2265. // CHECK:STDOUT: %addr.loc13_3: %ptr.d9e = addr_of %c2.var
  2266. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc13: init %empty_tuple.type = call %bound_method.loc13(%addr.loc13_3)
  2267. // CHECK:STDOUT: %facet_value.loc12: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2268. // CHECK:STDOUT: %.loc12_3.2: %type_where = converted constants.%C, %facet_value.loc12 [concrete = constants.%facet_value]
  2269. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc12: <bound method> = bound_method %c1.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  2270. // CHECK:STDOUT: <elided>
  2271. // CHECK:STDOUT: %bound_method.loc12: <bound method> = bound_method %c1.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2
  2272. // CHECK:STDOUT: %addr.loc12_3: %ptr.d9e = addr_of %c1.var
  2273. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc12: init %empty_tuple.type = call %bound_method.loc12(%addr.loc12_3)
  2274. // CHECK:STDOUT: <elided>
  2275. // CHECK:STDOUT: }
  2276. // CHECK:STDOUT:
  2277. // CHECK:STDOUT: --- import_single_namespace.carbon
  2278. // CHECK:STDOUT:
  2279. // CHECK:STDOUT: constants {
  2280. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2281. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  2282. // CHECK:STDOUT: %pattern_type.69f: type = pattern_type %C [concrete]
  2283. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  2284. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  2285. // CHECK:STDOUT: %ptr.838: type = ptr_type %C [concrete]
  2286. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  2287. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  2288. // CHECK:STDOUT: %operator+__carbon_thunk.type: type = fn_type @operator+__carbon_thunk [concrete]
  2289. // CHECK:STDOUT: %operator+__carbon_thunk: %operator+__carbon_thunk.type = struct_value () [concrete]
  2290. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  2291. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  2292. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.368: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  2293. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.b69: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.368 = struct_value () [concrete]
  2294. // CHECK:STDOUT: }
  2295. // CHECK:STDOUT:
  2296. // CHECK:STDOUT: imports {
  2297. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  2298. // CHECK:STDOUT: .N = %N
  2299. // CHECK:STDOUT: import Cpp//...
  2300. // CHECK:STDOUT: }
  2301. // CHECK:STDOUT: %N: <namespace> = namespace [concrete] {
  2302. // CHECK:STDOUT: .C = %C.decl
  2303. // CHECK:STDOUT: import Cpp//...
  2304. // CHECK:STDOUT: }
  2305. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  2306. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete = constants.%C.C.cpp_overload_set.value]
  2307. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  2308. // CHECK:STDOUT: <elided>
  2309. // CHECK:STDOUT: } {
  2310. // CHECK:STDOUT: <elided>
  2311. // CHECK:STDOUT: }
  2312. // CHECK:STDOUT: %operator+__carbon_thunk.decl: %operator+__carbon_thunk.type = fn_decl @operator+__carbon_thunk [concrete = constants.%operator+__carbon_thunk] {
  2313. // CHECK:STDOUT: <elided>
  2314. // CHECK:STDOUT: } {
  2315. // CHECK:STDOUT: <elided>
  2316. // CHECK:STDOUT: }
  2317. // CHECK:STDOUT: }
  2318. // CHECK:STDOUT:
  2319. // CHECK:STDOUT: fn @F() {
  2320. // CHECK:STDOUT: !entry:
  2321. // CHECK:STDOUT: name_binding_decl {
  2322. // CHECK:STDOUT: %c1.patt: %pattern_type.69f = binding_pattern c1 [concrete]
  2323. // CHECK:STDOUT: }
  2324. // CHECK:STDOUT: %Cpp.ref.loc8_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2325. // CHECK:STDOUT: %N.ref.loc8_24: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2326. // CHECK:STDOUT: %C.ref.loc8_26: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2327. // CHECK:STDOUT: %C.ref.loc8_28: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  2328. // CHECK:STDOUT: %.loc8_31.1: ref %C = temporary_storage
  2329. // CHECK:STDOUT: %addr.loc8_31.1: %ptr.838 = addr_of %.loc8_31.1
  2330. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_31.1)
  2331. // CHECK:STDOUT: %.loc8_31.2: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_31.1
  2332. // CHECK:STDOUT: %.loc8_16: type = splice_block %C.ref.loc8_16 [concrete = constants.%C] {
  2333. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2334. // CHECK:STDOUT: %N.ref.loc8_14: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2335. // CHECK:STDOUT: %C.ref.loc8_16: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2336. // CHECK:STDOUT: }
  2337. // CHECK:STDOUT: %.loc8_31.3: ref %C = temporary %.loc8_31.1, %.loc8_31.2
  2338. // CHECK:STDOUT: %.loc8_31.4: %C = bind_value %.loc8_31.3
  2339. // CHECK:STDOUT: %c1: %C = bind_name c1, %.loc8_31.4
  2340. // CHECK:STDOUT: name_binding_decl {
  2341. // CHECK:STDOUT: %c2.patt: %pattern_type.69f = binding_pattern c2 [concrete]
  2342. // CHECK:STDOUT: }
  2343. // CHECK:STDOUT: %Cpp.ref.loc9_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2344. // CHECK:STDOUT: %N.ref.loc9_24: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2345. // CHECK:STDOUT: %C.ref.loc9_26: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2346. // CHECK:STDOUT: %C.ref.loc9_28: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  2347. // CHECK:STDOUT: %.loc9_31.1: ref %C = temporary_storage
  2348. // CHECK:STDOUT: %addr.loc9_31.1: %ptr.838 = addr_of %.loc9_31.1
  2349. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc9_31.1)
  2350. // CHECK:STDOUT: %.loc9_31.2: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_31.1
  2351. // CHECK:STDOUT: %.loc9_16: type = splice_block %C.ref.loc9_16 [concrete = constants.%C] {
  2352. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2353. // CHECK:STDOUT: %N.ref.loc9_14: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2354. // CHECK:STDOUT: %C.ref.loc9_16: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2355. // CHECK:STDOUT: }
  2356. // CHECK:STDOUT: %.loc9_31.3: ref %C = temporary %.loc9_31.1, %.loc9_31.2
  2357. // CHECK:STDOUT: %.loc9_31.4: %C = bind_value %.loc9_31.3
  2358. // CHECK:STDOUT: %c2: %C = bind_name c2, %.loc9_31.4
  2359. // CHECK:STDOUT: name_binding_decl {
  2360. // CHECK:STDOUT: %c3.patt: %pattern_type.69f = binding_pattern c3 [concrete]
  2361. // CHECK:STDOUT: }
  2362. // CHECK:STDOUT: %c1.ref: %C = name_ref c1, %c1
  2363. // CHECK:STDOUT: %c2.ref: %C = name_ref c2, %c2
  2364. // CHECK:STDOUT: %.loc10_24.1: ref %C = temporary_storage
  2365. // CHECK:STDOUT: %.loc10_21: ref %C = value_as_ref %c1.ref
  2366. // CHECK:STDOUT: %addr.loc10_24.1: %ptr.838 = addr_of %.loc10_21
  2367. // CHECK:STDOUT: %.loc10_26: ref %C = value_as_ref %c2.ref
  2368. // CHECK:STDOUT: %addr.loc10_24.2: %ptr.838 = addr_of %.loc10_26
  2369. // CHECK:STDOUT: %addr.loc10_24.3: %ptr.838 = addr_of %.loc10_24.1
  2370. // CHECK:STDOUT: %operator+__carbon_thunk.call: init %empty_tuple.type = call imports.%operator+__carbon_thunk.decl(%addr.loc10_24.1, %addr.loc10_24.2, %addr.loc10_24.3)
  2371. // CHECK:STDOUT: %.loc10_24.2: init %C = in_place_init %operator+__carbon_thunk.call, %.loc10_24.1
  2372. // CHECK:STDOUT: %.loc10_16: type = splice_block %C.ref.loc10 [concrete = constants.%C] {
  2373. // CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2374. // CHECK:STDOUT: %N.ref.loc10: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2375. // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2376. // CHECK:STDOUT: }
  2377. // CHECK:STDOUT: %.loc10_24.3: ref %C = temporary %.loc10_24.1, %.loc10_24.2
  2378. // CHECK:STDOUT: %.loc10_24.4: %C = bind_value %.loc10_24.3
  2379. // CHECK:STDOUT: %c3: %C = bind_name c3, %.loc10_24.4
  2380. // CHECK:STDOUT: %facet_value.loc10: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2381. // CHECK:STDOUT: %.loc10_24.5: %type_where = converted constants.%C, %facet_value.loc10 [concrete = constants.%facet_value]
  2382. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10: <bound method> = bound_method %.loc10_24.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.b69
  2383. // CHECK:STDOUT: <elided>
  2384. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %.loc10_24.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
  2385. // CHECK:STDOUT: %addr.loc10_24.4: %ptr.838 = addr_of %.loc10_24.3
  2386. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10_24.4)
  2387. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2388. // CHECK:STDOUT: %.loc9_31.5: %type_where = converted constants.%C, %facet_value.loc9 [concrete = constants.%facet_value]
  2389. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc9: <bound method> = bound_method %.loc9_31.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.b69
  2390. // CHECK:STDOUT: <elided>
  2391. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %.loc9_31.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2
  2392. // CHECK:STDOUT: %addr.loc9_31.2: %ptr.838 = addr_of %.loc9_31.3
  2393. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9_31.2)
  2394. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2395. // CHECK:STDOUT: %.loc8_31.5: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  2396. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %.loc8_31.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.b69
  2397. // CHECK:STDOUT: <elided>
  2398. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %.loc8_31.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3
  2399. // CHECK:STDOUT: %addr.loc8_31.2: %ptr.838 = addr_of %.loc8_31.3
  2400. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_31.2)
  2401. // CHECK:STDOUT: <elided>
  2402. // CHECK:STDOUT: }
  2403. // CHECK:STDOUT:
  2404. // CHECK:STDOUT: --- import_multiple_namespaces.carbon
  2405. // CHECK:STDOUT:
  2406. // CHECK:STDOUT: constants {
  2407. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2408. // CHECK:STDOUT: %C1: type = class_type @C1 [concrete]
  2409. // CHECK:STDOUT: %pattern_type.20f: type = pattern_type %C1 [concrete]
  2410. // CHECK:STDOUT: %C1.C1.cpp_overload_set.type: type = cpp_overload_set_type @C1.C1.cpp_overload_set [concrete]
  2411. // CHECK:STDOUT: %C1.C1.cpp_overload_set.value: %C1.C1.cpp_overload_set.type = cpp_overload_set_value @C1.C1.cpp_overload_set [concrete]
  2412. // CHECK:STDOUT: %ptr.087: type = ptr_type %C1 [concrete]
  2413. // CHECK:STDOUT: %C1__carbon_thunk.type: type = fn_type @C1__carbon_thunk [concrete]
  2414. // CHECK:STDOUT: %C1__carbon_thunk: %C1__carbon_thunk.type = struct_value () [concrete]
  2415. // CHECK:STDOUT: %C2: type = class_type @C2 [concrete]
  2416. // CHECK:STDOUT: %pattern_type.846: type = pattern_type %C2 [concrete]
  2417. // CHECK:STDOUT: %C2.C2.cpp_overload_set.type: type = cpp_overload_set_type @C2.C2.cpp_overload_set [concrete]
  2418. // CHECK:STDOUT: %C2.C2.cpp_overload_set.value: %C2.C2.cpp_overload_set.type = cpp_overload_set_value @C2.C2.cpp_overload_set [concrete]
  2419. // CHECK:STDOUT: %ptr.51f: type = ptr_type %C2 [concrete]
  2420. // CHECK:STDOUT: %C2__carbon_thunk.type: type = fn_type @C2__carbon_thunk [concrete]
  2421. // CHECK:STDOUT: %C2__carbon_thunk: %C2__carbon_thunk.type = struct_value () [concrete]
  2422. // CHECK:STDOUT: %operator+__carbon_thunk.type: type = fn_type @operator+__carbon_thunk [concrete]
  2423. // CHECK:STDOUT: %operator+__carbon_thunk: %operator+__carbon_thunk.type = struct_value () [concrete]
  2424. // CHECK:STDOUT: %operator-__carbon_thunk.type: type = fn_type @operator-__carbon_thunk [concrete]
  2425. // CHECK:STDOUT: %operator-__carbon_thunk: %operator-__carbon_thunk.type = struct_value () [concrete]
  2426. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  2427. // CHECK:STDOUT: %facet_value.d7a: %type_where = facet_value %C2, () [concrete]
  2428. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.cf4: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.d7a) [concrete]
  2429. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.553: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.cf4 = struct_value () [concrete]
  2430. // CHECK:STDOUT: %facet_value.e5d: %type_where = facet_value %C1, () [concrete]
  2431. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.e1f: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.e5d) [concrete]
  2432. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.b74: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.e1f = struct_value () [concrete]
  2433. // CHECK:STDOUT: }
  2434. // CHECK:STDOUT:
  2435. // CHECK:STDOUT: imports {
  2436. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  2437. // CHECK:STDOUT: .N1 = %N1
  2438. // CHECK:STDOUT: .N2 = %N2
  2439. // CHECK:STDOUT: import Cpp//...
  2440. // CHECK:STDOUT: }
  2441. // CHECK:STDOUT: %N1: <namespace> = namespace [concrete] {
  2442. // CHECK:STDOUT: .C1 = %C1.decl
  2443. // CHECK:STDOUT: import Cpp//...
  2444. // CHECK:STDOUT: }
  2445. // CHECK:STDOUT: %C1.decl: type = class_decl @C1 [concrete = constants.%C1] {} {}
  2446. // CHECK:STDOUT: %C1.C1.cpp_overload_set.value: %C1.C1.cpp_overload_set.type = cpp_overload_set_value @C1.C1.cpp_overload_set [concrete = constants.%C1.C1.cpp_overload_set.value]
  2447. // CHECK:STDOUT: %C1__carbon_thunk.decl: %C1__carbon_thunk.type = fn_decl @C1__carbon_thunk [concrete = constants.%C1__carbon_thunk] {
  2448. // CHECK:STDOUT: <elided>
  2449. // CHECK:STDOUT: } {
  2450. // CHECK:STDOUT: <elided>
  2451. // CHECK:STDOUT: }
  2452. // CHECK:STDOUT: %N2: <namespace> = namespace [concrete] {
  2453. // CHECK:STDOUT: .C2 = %C2.decl
  2454. // CHECK:STDOUT: import Cpp//...
  2455. // CHECK:STDOUT: }
  2456. // CHECK:STDOUT: %C2.decl: type = class_decl @C2 [concrete = constants.%C2] {} {}
  2457. // CHECK:STDOUT: %C2.C2.cpp_overload_set.value: %C2.C2.cpp_overload_set.type = cpp_overload_set_value @C2.C2.cpp_overload_set [concrete = constants.%C2.C2.cpp_overload_set.value]
  2458. // CHECK:STDOUT: %C2__carbon_thunk.decl: %C2__carbon_thunk.type = fn_decl @C2__carbon_thunk [concrete = constants.%C2__carbon_thunk] {
  2459. // CHECK:STDOUT: <elided>
  2460. // CHECK:STDOUT: } {
  2461. // CHECK:STDOUT: <elided>
  2462. // CHECK:STDOUT: }
  2463. // CHECK:STDOUT: %operator+__carbon_thunk.decl: %operator+__carbon_thunk.type = fn_decl @operator+__carbon_thunk [concrete = constants.%operator+__carbon_thunk] {
  2464. // CHECK:STDOUT: <elided>
  2465. // CHECK:STDOUT: } {
  2466. // CHECK:STDOUT: <elided>
  2467. // CHECK:STDOUT: }
  2468. // CHECK:STDOUT: %operator-__carbon_thunk.decl: %operator-__carbon_thunk.type = fn_decl @operator-__carbon_thunk [concrete = constants.%operator-__carbon_thunk] {
  2469. // CHECK:STDOUT: <elided>
  2470. // CHECK:STDOUT: } {
  2471. // CHECK:STDOUT: <elided>
  2472. // CHECK:STDOUT: }
  2473. // CHECK:STDOUT: }
  2474. // CHECK:STDOUT:
  2475. // CHECK:STDOUT: fn @F() {
  2476. // CHECK:STDOUT: !entry:
  2477. // CHECK:STDOUT: name_binding_decl {
  2478. // CHECK:STDOUT: %c1.patt: %pattern_type.20f = binding_pattern c1 [concrete]
  2479. // CHECK:STDOUT: }
  2480. // CHECK:STDOUT: %Cpp.ref.loc8_23: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2481. // CHECK:STDOUT: %N1.ref.loc8_26: <namespace> = name_ref N1, imports.%N1 [concrete = imports.%N1]
  2482. // CHECK:STDOUT: %C1.ref.loc8_29: type = name_ref C1, imports.%C1.decl [concrete = constants.%C1]
  2483. // CHECK:STDOUT: %C1.ref.loc8_32: %C1.C1.cpp_overload_set.type = name_ref C1, imports.%C1.C1.cpp_overload_set.value [concrete = constants.%C1.C1.cpp_overload_set.value]
  2484. // CHECK:STDOUT: %.loc8_36.1: ref %C1 = temporary_storage
  2485. // CHECK:STDOUT: %addr.loc8_36.1: %ptr.087 = addr_of %.loc8_36.1
  2486. // CHECK:STDOUT: %C1__carbon_thunk.call: init %empty_tuple.type = call imports.%C1__carbon_thunk.decl(%addr.loc8_36.1)
  2487. // CHECK:STDOUT: %.loc8_36.2: init %C1 = in_place_init %C1__carbon_thunk.call, %.loc8_36.1
  2488. // CHECK:STDOUT: %.loc8_17: type = splice_block %C1.ref.loc8_17 [concrete = constants.%C1] {
  2489. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2490. // CHECK:STDOUT: %N1.ref.loc8_14: <namespace> = name_ref N1, imports.%N1 [concrete = imports.%N1]
  2491. // CHECK:STDOUT: %C1.ref.loc8_17: type = name_ref C1, imports.%C1.decl [concrete = constants.%C1]
  2492. // CHECK:STDOUT: }
  2493. // CHECK:STDOUT: %.loc8_36.3: ref %C1 = temporary %.loc8_36.1, %.loc8_36.2
  2494. // CHECK:STDOUT: %.loc8_36.4: %C1 = bind_value %.loc8_36.3
  2495. // CHECK:STDOUT: %c1: %C1 = bind_name c1, %.loc8_36.4
  2496. // CHECK:STDOUT: name_binding_decl {
  2497. // CHECK:STDOUT: %c2.patt: %pattern_type.846 = binding_pattern c2 [concrete]
  2498. // CHECK:STDOUT: }
  2499. // CHECK:STDOUT: %Cpp.ref.loc9_23: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2500. // CHECK:STDOUT: %N2.ref.loc9_26: <namespace> = name_ref N2, imports.%N2 [concrete = imports.%N2]
  2501. // CHECK:STDOUT: %C2.ref.loc9_29: type = name_ref C2, imports.%C2.decl [concrete = constants.%C2]
  2502. // CHECK:STDOUT: %C2.ref.loc9_32: %C2.C2.cpp_overload_set.type = name_ref C2, imports.%C2.C2.cpp_overload_set.value [concrete = constants.%C2.C2.cpp_overload_set.value]
  2503. // CHECK:STDOUT: %.loc9_36.1: ref %C2 = temporary_storage
  2504. // CHECK:STDOUT: %addr.loc9_36.1: %ptr.51f = addr_of %.loc9_36.1
  2505. // CHECK:STDOUT: %C2__carbon_thunk.call: init %empty_tuple.type = call imports.%C2__carbon_thunk.decl(%addr.loc9_36.1)
  2506. // CHECK:STDOUT: %.loc9_36.2: init %C2 = in_place_init %C2__carbon_thunk.call, %.loc9_36.1
  2507. // CHECK:STDOUT: %.loc9_17: type = splice_block %C2.ref.loc9_17 [concrete = constants.%C2] {
  2508. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2509. // CHECK:STDOUT: %N2.ref.loc9_14: <namespace> = name_ref N2, imports.%N2 [concrete = imports.%N2]
  2510. // CHECK:STDOUT: %C2.ref.loc9_17: type = name_ref C2, imports.%C2.decl [concrete = constants.%C2]
  2511. // CHECK:STDOUT: }
  2512. // CHECK:STDOUT: %.loc9_36.3: ref %C2 = temporary %.loc9_36.1, %.loc9_36.2
  2513. // CHECK:STDOUT: %.loc9_36.4: %C2 = bind_value %.loc9_36.3
  2514. // CHECK:STDOUT: %c2: %C2 = bind_name c2, %.loc9_36.4
  2515. // CHECK:STDOUT: name_binding_decl {
  2516. // CHECK:STDOUT: %c3.patt: %pattern_type.846 = binding_pattern c3 [concrete]
  2517. // CHECK:STDOUT: }
  2518. // CHECK:STDOUT: %c1.ref.loc10: %C1 = name_ref c1, %c1
  2519. // CHECK:STDOUT: %c2.ref.loc10: %C2 = name_ref c2, %c2
  2520. // CHECK:STDOUT: %.loc10_26.1: ref %C2 = temporary_storage
  2521. // CHECK:STDOUT: %.loc10_23: ref %C1 = value_as_ref %c1.ref.loc10
  2522. // CHECK:STDOUT: %addr.loc10_26.1: %ptr.087 = addr_of %.loc10_23
  2523. // CHECK:STDOUT: %.loc10_28: ref %C2 = value_as_ref %c2.ref.loc10
  2524. // CHECK:STDOUT: %addr.loc10_26.2: %ptr.51f = addr_of %.loc10_28
  2525. // CHECK:STDOUT: %addr.loc10_26.3: %ptr.51f = addr_of %.loc10_26.1
  2526. // CHECK:STDOUT: %operator+__carbon_thunk.call: init %empty_tuple.type = call imports.%operator+__carbon_thunk.decl(%addr.loc10_26.1, %addr.loc10_26.2, %addr.loc10_26.3)
  2527. // CHECK:STDOUT: %.loc10_26.2: init %C2 = in_place_init %operator+__carbon_thunk.call, %.loc10_26.1
  2528. // CHECK:STDOUT: %.loc10_17: type = splice_block %C2.ref.loc10 [concrete = constants.%C2] {
  2529. // CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2530. // CHECK:STDOUT: %N2.ref.loc10: <namespace> = name_ref N2, imports.%N2 [concrete = imports.%N2]
  2531. // CHECK:STDOUT: %C2.ref.loc10: type = name_ref C2, imports.%C2.decl [concrete = constants.%C2]
  2532. // CHECK:STDOUT: }
  2533. // CHECK:STDOUT: %.loc10_26.3: ref %C2 = temporary %.loc10_26.1, %.loc10_26.2
  2534. // CHECK:STDOUT: %.loc10_26.4: %C2 = bind_value %.loc10_26.3
  2535. // CHECK:STDOUT: %c3: %C2 = bind_name c3, %.loc10_26.4
  2536. // CHECK:STDOUT: name_binding_decl {
  2537. // CHECK:STDOUT: %c4.patt: %pattern_type.846 = binding_pattern c4 [concrete]
  2538. // CHECK:STDOUT: }
  2539. // CHECK:STDOUT: %c2.ref.loc11: %C2 = name_ref c2, %c2
  2540. // CHECK:STDOUT: %c1.ref.loc11: %C1 = name_ref c1, %c1
  2541. // CHECK:STDOUT: %.loc11_26.1: ref %C2 = temporary_storage
  2542. // CHECK:STDOUT: %.loc11_23: ref %C2 = value_as_ref %c2.ref.loc11
  2543. // CHECK:STDOUT: %addr.loc11_26.1: %ptr.51f = addr_of %.loc11_23
  2544. // CHECK:STDOUT: %.loc11_28: ref %C1 = value_as_ref %c1.ref.loc11
  2545. // CHECK:STDOUT: %addr.loc11_26.2: %ptr.087 = addr_of %.loc11_28
  2546. // CHECK:STDOUT: %addr.loc11_26.3: %ptr.51f = addr_of %.loc11_26.1
  2547. // CHECK:STDOUT: %operator-__carbon_thunk.call: init %empty_tuple.type = call imports.%operator-__carbon_thunk.decl(%addr.loc11_26.1, %addr.loc11_26.2, %addr.loc11_26.3)
  2548. // CHECK:STDOUT: %.loc11_26.2: init %C2 = in_place_init %operator-__carbon_thunk.call, %.loc11_26.1
  2549. // CHECK:STDOUT: %.loc11_17: type = splice_block %C2.ref.loc11 [concrete = constants.%C2] {
  2550. // CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2551. // CHECK:STDOUT: %N2.ref.loc11: <namespace> = name_ref N2, imports.%N2 [concrete = imports.%N2]
  2552. // CHECK:STDOUT: %C2.ref.loc11: type = name_ref C2, imports.%C2.decl [concrete = constants.%C2]
  2553. // CHECK:STDOUT: }
  2554. // CHECK:STDOUT: %.loc11_26.3: ref %C2 = temporary %.loc11_26.1, %.loc11_26.2
  2555. // CHECK:STDOUT: %.loc11_26.4: %C2 = bind_value %.loc11_26.3
  2556. // CHECK:STDOUT: %c4: %C2 = bind_name c4, %.loc11_26.4
  2557. // CHECK:STDOUT: %facet_value.loc11: %type_where = facet_value constants.%C2, () [concrete = constants.%facet_value.d7a]
  2558. // CHECK:STDOUT: %.loc11_26.5: %type_where = converted constants.%C2, %facet_value.loc11 [concrete = constants.%facet_value.d7a]
  2559. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc11: <bound method> = bound_method %.loc11_26.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.553
  2560. // CHECK:STDOUT: <elided>
  2561. // CHECK:STDOUT: %bound_method.loc11: <bound method> = bound_method %.loc11_26.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
  2562. // CHECK:STDOUT: %addr.loc11_26.4: %ptr.51f = addr_of %.loc11_26.3
  2563. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc11: init %empty_tuple.type = call %bound_method.loc11(%addr.loc11_26.4)
  2564. // CHECK:STDOUT: %facet_value.loc10: %type_where = facet_value constants.%C2, () [concrete = constants.%facet_value.d7a]
  2565. // CHECK:STDOUT: %.loc10_26.5: %type_where = converted constants.%C2, %facet_value.loc10 [concrete = constants.%facet_value.d7a]
  2566. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10: <bound method> = bound_method %.loc10_26.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.553
  2567. // CHECK:STDOUT: <elided>
  2568. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %.loc10_26.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2
  2569. // CHECK:STDOUT: %addr.loc10_26.4: %ptr.51f = addr_of %.loc10_26.3
  2570. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10_26.4)
  2571. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C2, () [concrete = constants.%facet_value.d7a]
  2572. // CHECK:STDOUT: %.loc9_36.5: %type_where = converted constants.%C2, %facet_value.loc9 [concrete = constants.%facet_value.d7a]
  2573. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc9: <bound method> = bound_method %.loc9_36.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.553
  2574. // CHECK:STDOUT: <elided>
  2575. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %.loc9_36.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3
  2576. // CHECK:STDOUT: %addr.loc9_36.2: %ptr.51f = addr_of %.loc9_36.3
  2577. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9_36.2)
  2578. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C1, () [concrete = constants.%facet_value.e5d]
  2579. // CHECK:STDOUT: %.loc8_36.5: %type_where = converted constants.%C1, %facet_value.loc8 [concrete = constants.%facet_value.e5d]
  2580. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %.loc8_36.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.b74
  2581. // CHECK:STDOUT: <elided>
  2582. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %.loc8_36.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.4
  2583. // CHECK:STDOUT: %addr.loc8_36.2: %ptr.087 = addr_of %.loc8_36.3
  2584. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_36.2)
  2585. // CHECK:STDOUT: <elided>
  2586. // CHECK:STDOUT: }
  2587. // CHECK:STDOUT:
  2588. // CHECK:STDOUT: --- fail_todo_import_operands_in_namespace_operator_in_global.carbon
  2589. // CHECK:STDOUT:
  2590. // CHECK:STDOUT: constants {
  2591. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2592. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  2593. // CHECK:STDOUT: %pattern_type.69f: type = pattern_type %C [concrete]
  2594. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  2595. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  2596. // CHECK:STDOUT: %ptr.838: type = ptr_type %C [concrete]
  2597. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  2598. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  2599. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  2600. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  2601. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.368: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  2602. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.b69: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.368 = struct_value () [concrete]
  2603. // CHECK:STDOUT: }
  2604. // CHECK:STDOUT:
  2605. // CHECK:STDOUT: imports {
  2606. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  2607. // CHECK:STDOUT: .N = %N
  2608. // CHECK:STDOUT: import Cpp//...
  2609. // CHECK:STDOUT: }
  2610. // CHECK:STDOUT: %N: <namespace> = namespace [concrete] {
  2611. // CHECK:STDOUT: .C = %C.decl
  2612. // CHECK:STDOUT: import Cpp//...
  2613. // CHECK:STDOUT: }
  2614. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  2615. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete = constants.%C.C.cpp_overload_set.value]
  2616. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  2617. // CHECK:STDOUT: <elided>
  2618. // CHECK:STDOUT: } {
  2619. // CHECK:STDOUT: <elided>
  2620. // CHECK:STDOUT: }
  2621. // CHECK:STDOUT: }
  2622. // CHECK:STDOUT:
  2623. // CHECK:STDOUT: fn @F() {
  2624. // CHECK:STDOUT: !entry:
  2625. // CHECK:STDOUT: name_binding_decl {
  2626. // CHECK:STDOUT: %c1.patt: %pattern_type.69f = binding_pattern c1 [concrete]
  2627. // CHECK:STDOUT: }
  2628. // CHECK:STDOUT: %Cpp.ref.loc8_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2629. // CHECK:STDOUT: %N.ref.loc8_24: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2630. // CHECK:STDOUT: %C.ref.loc8_26: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2631. // CHECK:STDOUT: %C.ref.loc8_28: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  2632. // CHECK:STDOUT: %.loc8_31.1: ref %C = temporary_storage
  2633. // CHECK:STDOUT: %addr.loc8_31.1: %ptr.838 = addr_of %.loc8_31.1
  2634. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_31.1)
  2635. // CHECK:STDOUT: %.loc8_31.2: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_31.1
  2636. // CHECK:STDOUT: %.loc8_16: type = splice_block %C.ref.loc8_16 [concrete = constants.%C] {
  2637. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2638. // CHECK:STDOUT: %N.ref.loc8_14: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2639. // CHECK:STDOUT: %C.ref.loc8_16: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2640. // CHECK:STDOUT: }
  2641. // CHECK:STDOUT: %.loc8_31.3: ref %C = temporary %.loc8_31.1, %.loc8_31.2
  2642. // CHECK:STDOUT: %.loc8_31.4: %C = bind_value %.loc8_31.3
  2643. // CHECK:STDOUT: %c1: %C = bind_name c1, %.loc8_31.4
  2644. // CHECK:STDOUT: name_binding_decl {
  2645. // CHECK:STDOUT: %c2.patt: %pattern_type.69f = binding_pattern c2 [concrete]
  2646. // CHECK:STDOUT: }
  2647. // CHECK:STDOUT: %Cpp.ref.loc9_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2648. // CHECK:STDOUT: %N.ref.loc9_24: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2649. // CHECK:STDOUT: %C.ref.loc9_26: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2650. // CHECK:STDOUT: %C.ref.loc9_28: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  2651. // CHECK:STDOUT: %.loc9_31.1: ref %C = temporary_storage
  2652. // CHECK:STDOUT: %addr.loc9_31.1: %ptr.838 = addr_of %.loc9_31.1
  2653. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc9_31.1)
  2654. // CHECK:STDOUT: %.loc9_31.2: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_31.1
  2655. // CHECK:STDOUT: %.loc9_16: type = splice_block %C.ref.loc9_16 [concrete = constants.%C] {
  2656. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2657. // CHECK:STDOUT: %N.ref.loc9_14: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2658. // CHECK:STDOUT: %C.ref.loc9_16: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2659. // CHECK:STDOUT: }
  2660. // CHECK:STDOUT: %.loc9_31.3: ref %C = temporary %.loc9_31.1, %.loc9_31.2
  2661. // CHECK:STDOUT: %.loc9_31.4: %C = bind_value %.loc9_31.3
  2662. // CHECK:STDOUT: %c2: %C = bind_name c2, %.loc9_31.4
  2663. // CHECK:STDOUT: name_binding_decl {
  2664. // CHECK:STDOUT: %c3.patt: %pattern_type.69f = binding_pattern c3 [concrete]
  2665. // CHECK:STDOUT: }
  2666. // CHECK:STDOUT: %c1.ref: %C = name_ref c1, %c1
  2667. // CHECK:STDOUT: %c2.ref: %C = name_ref c2, %c2
  2668. // CHECK:STDOUT: %.loc14: type = splice_block %C.ref.loc14 [concrete = constants.%C] {
  2669. // CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2670. // CHECK:STDOUT: %N.ref.loc14: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2671. // CHECK:STDOUT: %C.ref.loc14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2672. // CHECK:STDOUT: }
  2673. // CHECK:STDOUT: %c3: %C = bind_name c3, <error> [concrete = <error>]
  2674. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2675. // CHECK:STDOUT: %.loc9_31.5: %type_where = converted constants.%C, %facet_value.loc9 [concrete = constants.%facet_value]
  2676. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc9: <bound method> = bound_method %.loc9_31.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.b69
  2677. // CHECK:STDOUT: <elided>
  2678. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %.loc9_31.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
  2679. // CHECK:STDOUT: %addr.loc9_31.2: %ptr.838 = addr_of %.loc9_31.3
  2680. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9_31.2)
  2681. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2682. // CHECK:STDOUT: %.loc8_31.5: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  2683. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %.loc8_31.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.b69
  2684. // CHECK:STDOUT: <elided>
  2685. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %.loc8_31.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2
  2686. // CHECK:STDOUT: %addr.loc8_31.2: %ptr.838 = addr_of %.loc8_31.3
  2687. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_31.2)
  2688. // CHECK:STDOUT: <elided>
  2689. // CHECK:STDOUT: }
  2690. // CHECK:STDOUT:
  2691. // CHECK:STDOUT: --- import_inner_class.carbon
  2692. // CHECK:STDOUT:
  2693. // CHECK:STDOUT: constants {
  2694. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2695. // CHECK:STDOUT: %O: type = class_type @O [concrete]
  2696. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  2697. // CHECK:STDOUT: %pattern_type.b28: type = pattern_type %C [concrete]
  2698. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  2699. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  2700. // CHECK:STDOUT: %ptr.de2: type = ptr_type %C [concrete]
  2701. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  2702. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  2703. // CHECK:STDOUT: %operator+__carbon_thunk.type: type = fn_type @operator+__carbon_thunk [concrete]
  2704. // CHECK:STDOUT: %operator+__carbon_thunk: %operator+__carbon_thunk.type = struct_value () [concrete]
  2705. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  2706. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  2707. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.075: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  2708. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.ae5: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.075 = struct_value () [concrete]
  2709. // CHECK:STDOUT: }
  2710. // CHECK:STDOUT:
  2711. // CHECK:STDOUT: imports {
  2712. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  2713. // CHECK:STDOUT: .O = %O.decl
  2714. // CHECK:STDOUT: import Cpp//...
  2715. // CHECK:STDOUT: }
  2716. // CHECK:STDOUT: %O.decl: type = class_decl @O [concrete = constants.%O] {} {}
  2717. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  2718. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete = constants.%C.C.cpp_overload_set.value]
  2719. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  2720. // CHECK:STDOUT: <elided>
  2721. // CHECK:STDOUT: } {
  2722. // CHECK:STDOUT: <elided>
  2723. // CHECK:STDOUT: }
  2724. // CHECK:STDOUT: %operator+__carbon_thunk.decl: %operator+__carbon_thunk.type = fn_decl @operator+__carbon_thunk [concrete = constants.%operator+__carbon_thunk] {
  2725. // CHECK:STDOUT: <elided>
  2726. // CHECK:STDOUT: } {
  2727. // CHECK:STDOUT: <elided>
  2728. // CHECK:STDOUT: }
  2729. // CHECK:STDOUT: }
  2730. // CHECK:STDOUT:
  2731. // CHECK:STDOUT: fn @F() {
  2732. // CHECK:STDOUT: !entry:
  2733. // CHECK:STDOUT: name_binding_decl {
  2734. // CHECK:STDOUT: %c1.patt: %pattern_type.b28 = binding_pattern c1 [concrete]
  2735. // CHECK:STDOUT: }
  2736. // CHECK:STDOUT: %Cpp.ref.loc8_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2737. // CHECK:STDOUT: %O.ref.loc8_24: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2738. // CHECK:STDOUT: %C.ref.loc8_26: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2739. // CHECK:STDOUT: %C.ref.loc8_28: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  2740. // CHECK:STDOUT: %.loc8_31.1: ref %C = temporary_storage
  2741. // CHECK:STDOUT: %addr.loc8_31.1: %ptr.de2 = addr_of %.loc8_31.1
  2742. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_31.1)
  2743. // CHECK:STDOUT: %.loc8_31.2: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_31.1
  2744. // CHECK:STDOUT: %.loc8_16: type = splice_block %C.ref.loc8_16 [concrete = constants.%C] {
  2745. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2746. // CHECK:STDOUT: %O.ref.loc8_14: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2747. // CHECK:STDOUT: %C.ref.loc8_16: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2748. // CHECK:STDOUT: }
  2749. // CHECK:STDOUT: %.loc8_31.3: ref %C = temporary %.loc8_31.1, %.loc8_31.2
  2750. // CHECK:STDOUT: %.loc8_31.4: %C = bind_value %.loc8_31.3
  2751. // CHECK:STDOUT: %c1: %C = bind_name c1, %.loc8_31.4
  2752. // CHECK:STDOUT: name_binding_decl {
  2753. // CHECK:STDOUT: %c2.patt: %pattern_type.b28 = binding_pattern c2 [concrete]
  2754. // CHECK:STDOUT: }
  2755. // CHECK:STDOUT: %Cpp.ref.loc9_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2756. // CHECK:STDOUT: %O.ref.loc9_24: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2757. // CHECK:STDOUT: %C.ref.loc9_26: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2758. // CHECK:STDOUT: %C.ref.loc9_28: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  2759. // CHECK:STDOUT: %.loc9_31.1: ref %C = temporary_storage
  2760. // CHECK:STDOUT: %addr.loc9_31.1: %ptr.de2 = addr_of %.loc9_31.1
  2761. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc9_31.1)
  2762. // CHECK:STDOUT: %.loc9_31.2: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_31.1
  2763. // CHECK:STDOUT: %.loc9_16: type = splice_block %C.ref.loc9_16 [concrete = constants.%C] {
  2764. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2765. // CHECK:STDOUT: %O.ref.loc9_14: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2766. // CHECK:STDOUT: %C.ref.loc9_16: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2767. // CHECK:STDOUT: }
  2768. // CHECK:STDOUT: %.loc9_31.3: ref %C = temporary %.loc9_31.1, %.loc9_31.2
  2769. // CHECK:STDOUT: %.loc9_31.4: %C = bind_value %.loc9_31.3
  2770. // CHECK:STDOUT: %c2: %C = bind_name c2, %.loc9_31.4
  2771. // CHECK:STDOUT: name_binding_decl {
  2772. // CHECK:STDOUT: %c3.patt: %pattern_type.b28 = binding_pattern c3 [concrete]
  2773. // CHECK:STDOUT: }
  2774. // CHECK:STDOUT: %c1.ref: %C = name_ref c1, %c1
  2775. // CHECK:STDOUT: %c2.ref: %C = name_ref c2, %c2
  2776. // CHECK:STDOUT: %.loc10_24.1: ref %C = temporary_storage
  2777. // CHECK:STDOUT: %.loc10_21: ref %C = value_as_ref %c1.ref
  2778. // CHECK:STDOUT: %addr.loc10_24.1: %ptr.de2 = addr_of %.loc10_21
  2779. // CHECK:STDOUT: %.loc10_26: ref %C = value_as_ref %c2.ref
  2780. // CHECK:STDOUT: %addr.loc10_24.2: %ptr.de2 = addr_of %.loc10_26
  2781. // CHECK:STDOUT: %addr.loc10_24.3: %ptr.de2 = addr_of %.loc10_24.1
  2782. // CHECK:STDOUT: %operator+__carbon_thunk.call: init %empty_tuple.type = call imports.%operator+__carbon_thunk.decl(%addr.loc10_24.1, %addr.loc10_24.2, %addr.loc10_24.3)
  2783. // CHECK:STDOUT: %.loc10_24.2: init %C = in_place_init %operator+__carbon_thunk.call, %.loc10_24.1
  2784. // CHECK:STDOUT: %.loc10_16: type = splice_block %C.ref.loc10 [concrete = constants.%C] {
  2785. // CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2786. // CHECK:STDOUT: %O.ref.loc10: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2787. // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2788. // CHECK:STDOUT: }
  2789. // CHECK:STDOUT: %.loc10_24.3: ref %C = temporary %.loc10_24.1, %.loc10_24.2
  2790. // CHECK:STDOUT: %.loc10_24.4: %C = bind_value %.loc10_24.3
  2791. // CHECK:STDOUT: %c3: %C = bind_name c3, %.loc10_24.4
  2792. // CHECK:STDOUT: %facet_value.loc10: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2793. // CHECK:STDOUT: %.loc10_24.5: %type_where = converted constants.%C, %facet_value.loc10 [concrete = constants.%facet_value]
  2794. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10: <bound method> = bound_method %.loc10_24.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.ae5
  2795. // CHECK:STDOUT: <elided>
  2796. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %.loc10_24.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
  2797. // CHECK:STDOUT: %addr.loc10_24.4: %ptr.de2 = addr_of %.loc10_24.3
  2798. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10_24.4)
  2799. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2800. // CHECK:STDOUT: %.loc9_31.5: %type_where = converted constants.%C, %facet_value.loc9 [concrete = constants.%facet_value]
  2801. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc9: <bound method> = bound_method %.loc9_31.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.ae5
  2802. // CHECK:STDOUT: <elided>
  2803. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %.loc9_31.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2
  2804. // CHECK:STDOUT: %addr.loc9_31.2: %ptr.de2 = addr_of %.loc9_31.3
  2805. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9_31.2)
  2806. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2807. // CHECK:STDOUT: %.loc8_31.5: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  2808. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %.loc8_31.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.ae5
  2809. // CHECK:STDOUT: <elided>
  2810. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %.loc8_31.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3
  2811. // CHECK:STDOUT: %addr.loc8_31.2: %ptr.de2 = addr_of %.loc8_31.3
  2812. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_31.2)
  2813. // CHECK:STDOUT: <elided>
  2814. // CHECK:STDOUT: }
  2815. // CHECK:STDOUT:
  2816. // CHECK:STDOUT: --- import_inner_class_in_namespace.carbon
  2817. // CHECK:STDOUT:
  2818. // CHECK:STDOUT: constants {
  2819. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2820. // CHECK:STDOUT: %O: type = class_type @O [concrete]
  2821. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  2822. // CHECK:STDOUT: %pattern_type.84b: type = pattern_type %C [concrete]
  2823. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  2824. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  2825. // CHECK:STDOUT: %ptr.4b2: type = ptr_type %C [concrete]
  2826. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  2827. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  2828. // CHECK:STDOUT: %operator+__carbon_thunk.type: type = fn_type @operator+__carbon_thunk [concrete]
  2829. // CHECK:STDOUT: %operator+__carbon_thunk: %operator+__carbon_thunk.type = struct_value () [concrete]
  2830. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  2831. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  2832. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.c9b: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  2833. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.971: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.c9b = struct_value () [concrete]
  2834. // CHECK:STDOUT: }
  2835. // CHECK:STDOUT:
  2836. // CHECK:STDOUT: imports {
  2837. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  2838. // CHECK:STDOUT: .N = %N
  2839. // CHECK:STDOUT: import Cpp//...
  2840. // CHECK:STDOUT: }
  2841. // CHECK:STDOUT: %N: <namespace> = namespace [concrete] {
  2842. // CHECK:STDOUT: .O = %O.decl
  2843. // CHECK:STDOUT: import Cpp//...
  2844. // CHECK:STDOUT: }
  2845. // CHECK:STDOUT: %O.decl: type = class_decl @O [concrete = constants.%O] {} {}
  2846. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  2847. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete = constants.%C.C.cpp_overload_set.value]
  2848. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  2849. // CHECK:STDOUT: <elided>
  2850. // CHECK:STDOUT: } {
  2851. // CHECK:STDOUT: <elided>
  2852. // CHECK:STDOUT: }
  2853. // CHECK:STDOUT: %operator+__carbon_thunk.decl: %operator+__carbon_thunk.type = fn_decl @operator+__carbon_thunk [concrete = constants.%operator+__carbon_thunk] {
  2854. // CHECK:STDOUT: <elided>
  2855. // CHECK:STDOUT: } {
  2856. // CHECK:STDOUT: <elided>
  2857. // CHECK:STDOUT: }
  2858. // CHECK:STDOUT: }
  2859. // CHECK:STDOUT:
  2860. // CHECK:STDOUT: fn @F() {
  2861. // CHECK:STDOUT: !entry:
  2862. // CHECK:STDOUT: name_binding_decl {
  2863. // CHECK:STDOUT: %c1.patt: %pattern_type.84b = binding_pattern c1 [concrete]
  2864. // CHECK:STDOUT: }
  2865. // CHECK:STDOUT: %Cpp.ref.loc8_23: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2866. // CHECK:STDOUT: %N.ref.loc8_26: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2867. // CHECK:STDOUT: %O.ref.loc8_28: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2868. // CHECK:STDOUT: %C.ref.loc8_30: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2869. // CHECK:STDOUT: %C.ref.loc8_32: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  2870. // CHECK:STDOUT: %.loc8_35.1: ref %C = temporary_storage
  2871. // CHECK:STDOUT: %addr.loc8_35.1: %ptr.4b2 = addr_of %.loc8_35.1
  2872. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_35.1)
  2873. // CHECK:STDOUT: %.loc8_35.2: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_35.1
  2874. // CHECK:STDOUT: %.loc8_18: type = splice_block %C.ref.loc8_18 [concrete = constants.%C] {
  2875. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2876. // CHECK:STDOUT: %N.ref.loc8_14: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2877. // CHECK:STDOUT: %O.ref.loc8_16: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2878. // CHECK:STDOUT: %C.ref.loc8_18: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2879. // CHECK:STDOUT: }
  2880. // CHECK:STDOUT: %.loc8_35.3: ref %C = temporary %.loc8_35.1, %.loc8_35.2
  2881. // CHECK:STDOUT: %.loc8_35.4: %C = bind_value %.loc8_35.3
  2882. // CHECK:STDOUT: %c1: %C = bind_name c1, %.loc8_35.4
  2883. // CHECK:STDOUT: name_binding_decl {
  2884. // CHECK:STDOUT: %c2.patt: %pattern_type.84b = binding_pattern c2 [concrete]
  2885. // CHECK:STDOUT: }
  2886. // CHECK:STDOUT: %Cpp.ref.loc9_23: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2887. // CHECK:STDOUT: %N.ref.loc9_26: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2888. // CHECK:STDOUT: %O.ref.loc9_28: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2889. // CHECK:STDOUT: %C.ref.loc9_30: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2890. // CHECK:STDOUT: %C.ref.loc9_32: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  2891. // CHECK:STDOUT: %.loc9_35.1: ref %C = temporary_storage
  2892. // CHECK:STDOUT: %addr.loc9_35.1: %ptr.4b2 = addr_of %.loc9_35.1
  2893. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc9_35.1)
  2894. // CHECK:STDOUT: %.loc9_35.2: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_35.1
  2895. // CHECK:STDOUT: %.loc9_18: type = splice_block %C.ref.loc9_18 [concrete = constants.%C] {
  2896. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2897. // CHECK:STDOUT: %N.ref.loc9_14: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2898. // CHECK:STDOUT: %O.ref.loc9_16: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2899. // CHECK:STDOUT: %C.ref.loc9_18: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2900. // CHECK:STDOUT: }
  2901. // CHECK:STDOUT: %.loc9_35.3: ref %C = temporary %.loc9_35.1, %.loc9_35.2
  2902. // CHECK:STDOUT: %.loc9_35.4: %C = bind_value %.loc9_35.3
  2903. // CHECK:STDOUT: %c2: %C = bind_name c2, %.loc9_35.4
  2904. // CHECK:STDOUT: name_binding_decl {
  2905. // CHECK:STDOUT: %c3.patt: %pattern_type.84b = binding_pattern c3 [concrete]
  2906. // CHECK:STDOUT: }
  2907. // CHECK:STDOUT: %c1.ref: %C = name_ref c1, %c1
  2908. // CHECK:STDOUT: %c2.ref: %C = name_ref c2, %c2
  2909. // CHECK:STDOUT: %.loc10_26.1: ref %C = temporary_storage
  2910. // CHECK:STDOUT: %.loc10_23: ref %C = value_as_ref %c1.ref
  2911. // CHECK:STDOUT: %addr.loc10_26.1: %ptr.4b2 = addr_of %.loc10_23
  2912. // CHECK:STDOUT: %.loc10_28: ref %C = value_as_ref %c2.ref
  2913. // CHECK:STDOUT: %addr.loc10_26.2: %ptr.4b2 = addr_of %.loc10_28
  2914. // CHECK:STDOUT: %addr.loc10_26.3: %ptr.4b2 = addr_of %.loc10_26.1
  2915. // CHECK:STDOUT: %operator+__carbon_thunk.call: init %empty_tuple.type = call imports.%operator+__carbon_thunk.decl(%addr.loc10_26.1, %addr.loc10_26.2, %addr.loc10_26.3)
  2916. // CHECK:STDOUT: %.loc10_26.2: init %C = in_place_init %operator+__carbon_thunk.call, %.loc10_26.1
  2917. // CHECK:STDOUT: %.loc10_18: type = splice_block %C.ref.loc10 [concrete = constants.%C] {
  2918. // CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2919. // CHECK:STDOUT: %N.ref.loc10: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2920. // CHECK:STDOUT: %O.ref.loc10: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2921. // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2922. // CHECK:STDOUT: }
  2923. // CHECK:STDOUT: %.loc10_26.3: ref %C = temporary %.loc10_26.1, %.loc10_26.2
  2924. // CHECK:STDOUT: %.loc10_26.4: %C = bind_value %.loc10_26.3
  2925. // CHECK:STDOUT: %c3: %C = bind_name c3, %.loc10_26.4
  2926. // CHECK:STDOUT: %facet_value.loc10: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2927. // CHECK:STDOUT: %.loc10_26.5: %type_where = converted constants.%C, %facet_value.loc10 [concrete = constants.%facet_value]
  2928. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10: <bound method> = bound_method %.loc10_26.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.971
  2929. // CHECK:STDOUT: <elided>
  2930. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %.loc10_26.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
  2931. // CHECK:STDOUT: %addr.loc10_26.4: %ptr.4b2 = addr_of %.loc10_26.3
  2932. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10_26.4)
  2933. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2934. // CHECK:STDOUT: %.loc9_35.5: %type_where = converted constants.%C, %facet_value.loc9 [concrete = constants.%facet_value]
  2935. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc9: <bound method> = bound_method %.loc9_35.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.971
  2936. // CHECK:STDOUT: <elided>
  2937. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %.loc9_35.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2
  2938. // CHECK:STDOUT: %addr.loc9_35.2: %ptr.4b2 = addr_of %.loc9_35.3
  2939. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9_35.2)
  2940. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2941. // CHECK:STDOUT: %.loc8_35.5: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  2942. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %.loc8_35.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.971
  2943. // CHECK:STDOUT: <elided>
  2944. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %.loc8_35.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3
  2945. // CHECK:STDOUT: %addr.loc8_35.2: %ptr.4b2 = addr_of %.loc8_35.3
  2946. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_35.2)
  2947. // CHECK:STDOUT: <elided>
  2948. // CHECK:STDOUT: }
  2949. // CHECK:STDOUT:
  2950. // CHECK:STDOUT: --- import_member_add_with.carbon
  2951. // CHECK:STDOUT:
  2952. // CHECK:STDOUT: constants {
  2953. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2954. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  2955. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  2956. // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete]
  2957. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete]
  2958. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  2959. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  2960. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  2961. // CHECK:STDOUT: %operator-__carbon_thunk.type: type = fn_type @operator-__carbon_thunk [concrete]
  2962. // CHECK:STDOUT: %operator-__carbon_thunk: %operator-__carbon_thunk.type = struct_value () [concrete]
  2963. // CHECK:STDOUT: %operator+__carbon_thunk.type: type = fn_type @operator+__carbon_thunk [concrete]
  2964. // CHECK:STDOUT: %operator+__carbon_thunk: %operator+__carbon_thunk.type = struct_value () [concrete]
  2965. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  2966. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  2967. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b92: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  2968. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.841: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b92 = struct_value () [concrete]
  2969. // CHECK:STDOUT: }
  2970. // CHECK:STDOUT:
  2971. // CHECK:STDOUT: imports {
  2972. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  2973. // CHECK:STDOUT: .C = %C.decl
  2974. // CHECK:STDOUT: import Cpp//...
  2975. // CHECK:STDOUT: }
  2976. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  2977. // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete = constants.%C.C.cpp_overload_set.value]
  2978. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  2979. // CHECK:STDOUT: <elided>
  2980. // CHECK:STDOUT: } {
  2981. // CHECK:STDOUT: <elided>
  2982. // CHECK:STDOUT: }
  2983. // CHECK:STDOUT: %operator-__carbon_thunk.decl: %operator-__carbon_thunk.type = fn_decl @operator-__carbon_thunk [concrete = constants.%operator-__carbon_thunk] {
  2984. // CHECK:STDOUT: <elided>
  2985. // CHECK:STDOUT: } {
  2986. // CHECK:STDOUT: <elided>
  2987. // CHECK:STDOUT: }
  2988. // CHECK:STDOUT: %operator+__carbon_thunk.decl: %operator+__carbon_thunk.type = fn_decl @operator+__carbon_thunk [concrete = constants.%operator+__carbon_thunk] {
  2989. // CHECK:STDOUT: <elided>
  2990. // CHECK:STDOUT: } {
  2991. // CHECK:STDOUT: <elided>
  2992. // CHECK:STDOUT: }
  2993. // CHECK:STDOUT: }
  2994. // CHECK:STDOUT:
  2995. // CHECK:STDOUT: fn @F() {
  2996. // CHECK:STDOUT: !entry:
  2997. // CHECK:STDOUT: name_binding_decl {
  2998. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = binding_pattern c1 [concrete]
  2999. // CHECK:STDOUT: %c1.var_patt: %pattern_type.217 = var_pattern %c1.patt [concrete]
  3000. // CHECK:STDOUT: }
  3001. // CHECK:STDOUT: %c1.var: ref %C = var %c1.var_patt
  3002. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  3003. // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  3004. // CHECK:STDOUT: %C.ref.loc8_24: %C.C.cpp_overload_set.type = name_ref C, imports.%C.C.cpp_overload_set.value [concrete = constants.%C.C.cpp_overload_set.value]
  3005. // CHECK:STDOUT: %.loc8_3.1: ref %C = splice_block %c1.var {}
  3006. // CHECK:STDOUT: %addr.loc8_27: %ptr.d9e = addr_of %.loc8_3.1
  3007. // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_27)
  3008. // CHECK:STDOUT: %.loc8_27: init %C = in_place_init %C__carbon_thunk.call, %.loc8_3.1
  3009. // CHECK:STDOUT: assign %c1.var, %.loc8_27
  3010. // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] {
  3011. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  3012. // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  3013. // CHECK:STDOUT: }
  3014. // CHECK:STDOUT: %c1: ref %C = bind_name c1, %c1.var
  3015. // CHECK:STDOUT: name_binding_decl {
  3016. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = binding_pattern c2 [concrete]
  3017. // CHECK:STDOUT: %c2.var_patt: %pattern_type.217 = var_pattern %c2.patt [concrete]
  3018. // CHECK:STDOUT: }
  3019. // CHECK:STDOUT: %c2.var: ref %C = var %c2.var_patt
  3020. // CHECK:STDOUT: %c1.ref.loc9: ref %C = name_ref c1, %c1
  3021. // CHECK:STDOUT: %.loc9_3.1: ref %C = splice_block %c2.var {}
  3022. // CHECK:STDOUT: %addr.loc9_20: %ptr.d9e = addr_of %c1.ref.loc9
  3023. // CHECK:STDOUT: %addr.loc9_19: %ptr.d9e = addr_of %.loc9_3.1
  3024. // CHECK:STDOUT: %operator-__carbon_thunk.call: init %empty_tuple.type = call imports.%operator-__carbon_thunk.decl(%addr.loc9_20, %addr.loc9_19)
  3025. // CHECK:STDOUT: %.loc9_19: init %C = in_place_init %operator-__carbon_thunk.call, %.loc9_3.1
  3026. // CHECK:STDOUT: assign %c2.var, %.loc9_19
  3027. // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9 [concrete = constants.%C] {
  3028. // CHECK:STDOUT: %Cpp.ref.loc9: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  3029. // CHECK:STDOUT: %C.ref.loc9: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  3030. // CHECK:STDOUT: }
  3031. // CHECK:STDOUT: %c2: ref %C = bind_name c2, %c2.var
  3032. // CHECK:STDOUT: name_binding_decl {
  3033. // CHECK:STDOUT: %c3.patt: %pattern_type.217 = binding_pattern c3 [concrete]
  3034. // CHECK:STDOUT: %c3.var_patt: %pattern_type.217 = var_pattern %c3.patt [concrete]
  3035. // CHECK:STDOUT: }
  3036. // CHECK:STDOUT: %c3.var: ref %C = var %c3.var_patt
  3037. // CHECK:STDOUT: %c1.ref.loc10: ref %C = name_ref c1, %c1
  3038. // CHECK:STDOUT: %c2.ref: ref %C = name_ref c2, %c2
  3039. // CHECK:STDOUT: %.loc10_3.1: ref %C = splice_block %c3.var {}
  3040. // CHECK:STDOUT: %addr.loc10_19: %ptr.d9e = addr_of %c1.ref.loc10
  3041. // CHECK:STDOUT: %.loc10_24.1: %C = bind_value %c2.ref
  3042. // CHECK:STDOUT: %.loc10_24.2: ref %C = value_as_ref %.loc10_24.1
  3043. // CHECK:STDOUT: %addr.loc10_22.1: %ptr.d9e = addr_of %.loc10_24.2
  3044. // CHECK:STDOUT: %addr.loc10_22.2: %ptr.d9e = addr_of %.loc10_3.1
  3045. // CHECK:STDOUT: %operator+__carbon_thunk.call: init %empty_tuple.type = call imports.%operator+__carbon_thunk.decl(%addr.loc10_19, %addr.loc10_22.1, %addr.loc10_22.2)
  3046. // CHECK:STDOUT: %.loc10_22: init %C = in_place_init %operator+__carbon_thunk.call, %.loc10_3.1
  3047. // CHECK:STDOUT: assign %c3.var, %.loc10_22
  3048. // CHECK:STDOUT: %.loc10_14: type = splice_block %C.ref.loc10 [concrete = constants.%C] {
  3049. // CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  3050. // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  3051. // CHECK:STDOUT: }
  3052. // CHECK:STDOUT: %c3: ref %C = bind_name c3, %c3.var
  3053. // CHECK:STDOUT: %facet_value.loc10: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  3054. // CHECK:STDOUT: %.loc10_3.2: %type_where = converted constants.%C, %facet_value.loc10 [concrete = constants.%facet_value]
  3055. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10: <bound method> = bound_method %c3.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  3056. // CHECK:STDOUT: <elided>
  3057. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %c3.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
  3058. // CHECK:STDOUT: %addr.loc10_3: %ptr.d9e = addr_of %c3.var
  3059. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10_3)
  3060. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  3061. // CHECK:STDOUT: %.loc9_3.2: %type_where = converted constants.%C, %facet_value.loc9 [concrete = constants.%facet_value]
  3062. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc9: <bound method> = bound_method %c2.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  3063. // CHECK:STDOUT: <elided>
  3064. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %c2.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2
  3065. // CHECK:STDOUT: %addr.loc9_3: %ptr.d9e = addr_of %c2.var
  3066. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9_3)
  3067. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  3068. // CHECK:STDOUT: %.loc8_3.2: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  3069. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %c1.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  3070. // CHECK:STDOUT: <elided>
  3071. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %c1.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3
  3072. // CHECK:STDOUT: %addr.loc8_3: %ptr.d9e = addr_of %c1.var
  3073. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_3)
  3074. // CHECK:STDOUT: <elided>
  3075. // CHECK:STDOUT: }
  3076. // CHECK:STDOUT:
  3077. // CHECK:STDOUT: --- indirect_template_instantiation.carbon
  3078. // CHECK:STDOUT:
  3079. // CHECK:STDOUT: constants {
  3080. // CHECK:STDOUT: %B: type = class_type @B [concrete]
  3081. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  3082. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  3083. // CHECK:STDOUT: %ptr.a04: type = ptr_type %B [concrete]
  3084. // CHECK:STDOUT: %operator+__carbon_thunk.type: type = fn_type @operator+__carbon_thunk [concrete]
  3085. // CHECK:STDOUT: %operator+__carbon_thunk: %operator+__carbon_thunk.type = struct_value () [concrete]
  3086. // CHECK:STDOUT: }
  3087. // CHECK:STDOUT:
  3088. // CHECK:STDOUT: imports {
  3089. // CHECK:STDOUT: %operator+__carbon_thunk.decl: %operator+__carbon_thunk.type = fn_decl @operator+__carbon_thunk [concrete = constants.%operator+__carbon_thunk] {
  3090. // CHECK:STDOUT: <elided>
  3091. // CHECK:STDOUT: } {
  3092. // CHECK:STDOUT: <elided>
  3093. // CHECK:STDOUT: }
  3094. // CHECK:STDOUT: }
  3095. // CHECK:STDOUT:
  3096. // CHECK:STDOUT: fn @F(%x.param: %B) -> %i32 {
  3097. // CHECK:STDOUT: !entry:
  3098. // CHECK:STDOUT: %x.ref.loc14_10: %B = name_ref x, %x
  3099. // CHECK:STDOUT: %x.ref.loc14_14: %B = name_ref x, %x
  3100. // CHECK:STDOUT: %.loc14_10: ref %B = value_as_ref %x.ref.loc14_10
  3101. // CHECK:STDOUT: %addr.loc14_12.1: %ptr.a04 = addr_of %.loc14_10
  3102. // CHECK:STDOUT: %.loc14_14: ref %B = value_as_ref %x.ref.loc14_14
  3103. // CHECK:STDOUT: %addr.loc14_12.2: %ptr.a04 = addr_of %.loc14_14
  3104. // CHECK:STDOUT: %operator+__carbon_thunk.call: init %i32 = call imports.%operator+__carbon_thunk.decl(%addr.loc14_12.1, %addr.loc14_12.2)
  3105. // CHECK:STDOUT: return %operator+__carbon_thunk.call to %return
  3106. // CHECK:STDOUT: }
  3107. // CHECK:STDOUT:
  3108. // CHECK:STDOUT: --- import_overloading.carbon
  3109. // CHECK:STDOUT:
  3110. // CHECK:STDOUT: constants {
  3111. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  3112. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  3113. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  3114. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  3115. // CHECK:STDOUT: %operator+__carbon_thunk.type: type = fn_type @operator+__carbon_thunk [concrete]
  3116. // CHECK:STDOUT: %operator+__carbon_thunk: %operator+__carbon_thunk.type = struct_value () [concrete]
  3117. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  3118. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  3119. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b92: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  3120. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.841: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.b92 = struct_value () [concrete]
  3121. // CHECK:STDOUT: }
  3122. // CHECK:STDOUT:
  3123. // CHECK:STDOUT: imports {
  3124. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  3125. // CHECK:STDOUT: .C = %C.decl
  3126. // CHECK:STDOUT: import Cpp//...
  3127. // CHECK:STDOUT: }
  3128. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  3129. // CHECK:STDOUT: %operator+__carbon_thunk.decl: %operator+__carbon_thunk.type = fn_decl @operator+__carbon_thunk [concrete = constants.%operator+__carbon_thunk] {
  3130. // CHECK:STDOUT: <elided>
  3131. // CHECK:STDOUT: } {
  3132. // CHECK:STDOUT: <elided>
  3133. // CHECK:STDOUT: }
  3134. // CHECK:STDOUT: }
  3135. // CHECK:STDOUT:
  3136. // CHECK:STDOUT: fn @F() {
  3137. // CHECK:STDOUT: !entry:
  3138. // CHECK:STDOUT: <elided>
  3139. // CHECK:STDOUT: name_binding_decl {
  3140. // CHECK:STDOUT: %c3.patt: %pattern_type.217 = binding_pattern c3 [concrete]
  3141. // CHECK:STDOUT: }
  3142. // CHECK:STDOUT: %c1.ref: %C = name_ref c1, %c1
  3143. // CHECK:STDOUT: %c2.ref: %C = name_ref c2, %c2
  3144. // CHECK:STDOUT: %.loc10_22.1: ref %C = temporary_storage
  3145. // CHECK:STDOUT: %.loc10_19: ref %C = value_as_ref %c1.ref
  3146. // CHECK:STDOUT: %addr.loc10_22.1: %ptr.d9e = addr_of %.loc10_19
  3147. // CHECK:STDOUT: %.loc10_24: ref %C = value_as_ref %c2.ref
  3148. // CHECK:STDOUT: %addr.loc10_22.2: %ptr.d9e = addr_of %.loc10_24
  3149. // CHECK:STDOUT: %addr.loc10_22.3: %ptr.d9e = addr_of %.loc10_22.1
  3150. // CHECK:STDOUT: %operator+__carbon_thunk.call: init %empty_tuple.type = call imports.%operator+__carbon_thunk.decl(%addr.loc10_22.1, %addr.loc10_22.2, %addr.loc10_22.3)
  3151. // CHECK:STDOUT: %.loc10_22.2: init %C = in_place_init %operator+__carbon_thunk.call, %.loc10_22.1
  3152. // CHECK:STDOUT: %.loc10_14: type = splice_block %C.ref.loc10 [concrete = constants.%C] {
  3153. // CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  3154. // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  3155. // CHECK:STDOUT: }
  3156. // CHECK:STDOUT: %.loc10_22.3: ref %C = temporary %.loc10_22.1, %.loc10_22.2
  3157. // CHECK:STDOUT: %.loc10_22.4: %C = bind_value %.loc10_22.3
  3158. // CHECK:STDOUT: %c3: %C = bind_name c3, %.loc10_22.4
  3159. // CHECK:STDOUT: %facet_value.loc10: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  3160. // CHECK:STDOUT: %.loc10_22.5: %type_where = converted constants.%C, %facet_value.loc10 [concrete = constants.%facet_value]
  3161. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10: <bound method> = bound_method %.loc10_22.3, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.841
  3162. // CHECK:STDOUT: <elided>
  3163. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %.loc10_22.3, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
  3164. // CHECK:STDOUT: %addr.loc10_22.4: %ptr.d9e = addr_of %.loc10_22.3
  3165. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10_22.4)
  3166. // CHECK:STDOUT: <elided>
  3167. // CHECK:STDOUT: }
  3168. // CHECK:STDOUT: