operators.carbon 176 KB

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