operators.carbon 193 KB

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