operators.carbon 180 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843
  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. // Unary.
  546. auto operator-() -> C;
  547. // Binary.
  548. auto operator+(C rhs) -> C;
  549. };
  550. // --- import_member_add_with.carbon
  551. library "[[@TEST_NAME]]";
  552. import Cpp library "member_add_with.h";
  553. fn F() {
  554. //@dump-sem-ir-begin
  555. var c1: Cpp.C = Cpp.C.C();
  556. var c2: Cpp.C = -c1;
  557. var c3: Cpp.C = c1 + c2;
  558. //@dump-sem-ir-end
  559. }
  560. // ============================================================================
  561. // Satisfying constraints
  562. // ============================================================================
  563. // --- fail_todo_constraints.carbon
  564. library "[[@TEST_NAME]]";
  565. import Cpp inline '''
  566. class X {};
  567. X operator+(X, X);
  568. ''';
  569. // TODO: Use Core.Add() when it is available.
  570. // TODO: `Sum()` should be declared this way when generics implementation is ready for that:
  571. // fn Sum[T:! Core.AddWith(.Self) where .Result = .Self](a: T, b: T) -> T
  572. fn Sum[U:! type, T:! Core.AddWith(U) where .Result = U](a: T, b: U) -> U {
  573. return a + b;
  574. }
  575. fn Call(x: Cpp.X) -> Cpp.X {
  576. // 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]
  577. // CHECK:STDERR: return Sum(x, x);
  578. // CHECK:STDERR: ^~~~~~~~~
  579. // CHECK:STDERR: fail_todo_constraints.carbon:[[@LINE-7]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  580. // CHECK:STDERR: fn Sum[U:! type, T:! Core.AddWith(U) where .Result = U](a: T, b: U) -> U {
  581. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  582. // CHECK:STDERR:
  583. return Sum(x, x);
  584. }
  585. // ============================================================================
  586. // Operator not found
  587. // ============================================================================
  588. // --- not_found.h
  589. class C {};
  590. // --- fail_import_not_found.carbon
  591. library "[[@TEST_NAME]]";
  592. import Cpp library "not_found.h";
  593. fn F() {
  594. let c1: Cpp.C = Cpp.C.C();
  595. let c2: Cpp.C = Cpp.C.C();
  596. // CHECK:STDERR: fail_import_not_found.carbon:[[@LINE+4]]:22: error: no matching function for call to '<C++ operator>' [CppInteropParseError]
  597. // CHECK:STDERR: 13 | let c3: Cpp.C = c1 + c2;
  598. // CHECK:STDERR: | ^
  599. // CHECK:STDERR:
  600. let c3: Cpp.C = c1 + c2;
  601. }
  602. // ============================================================================
  603. // Incomplete operand C++ type
  604. // ============================================================================
  605. // --- incomplete.h
  606. class Incomplete;
  607. class Complete {};
  608. auto operator+(Complete lhs, Incomplete rhs) -> Complete;
  609. auto foo(Complete complete) -> void;
  610. // --- fail_import_incomplete.carbon
  611. library "[[@TEST_NAME]]";
  612. import Cpp library "incomplete.h";
  613. fn F() {
  614. var c1: Cpp.Complete = Cpp.Complete.Complete();
  615. // CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE+8]]:40: error: invalid use of incomplete type `Cpp.Incomplete` [IncompleteTypeInConversion]
  616. // CHECK:STDERR: let c3: Cpp.Complete = Cpp.foo(c1 + ({} as Cpp.Incomplete));
  617. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
  618. // CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
  619. // CHECK:STDERR: ./incomplete.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
  620. // CHECK:STDERR: class Incomplete;
  621. // CHECK:STDERR: ^
  622. // CHECK:STDERR:
  623. let c3: Cpp.Complete = Cpp.foo(c1 + ({} as Cpp.Incomplete));
  624. }
  625. // ============================================================================
  626. // Incomplete operand Carbon type
  627. // ============================================================================
  628. // --- complete.h
  629. struct Complete {};
  630. // --- fail_incomplete_operand_carbon_type.carbon
  631. library "[[@TEST_NAME]]";
  632. import Cpp library "complete.h";
  633. class Incomplete;
  634. fn CreateIncomplete() -> Incomplete*;
  635. fn F() {
  636. var complete: Cpp.Complete = Cpp.Complete.Complete();
  637. // CHECK:STDERR: fail_incomplete_operand_carbon_type.carbon:[[@LINE+10]]:21: error: looking up a C++ operator with incomplete operand type `Incomplete` [IncompleteOperandTypeInCppOperatorLookup]
  638. // CHECK:STDERR: let result: i32 = *CreateIncomplete() + complete;
  639. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  640. // CHECK:STDERR: fail_incomplete_operand_carbon_type.carbon:[[@LINE-8]]:1: note: class was forward declared here [ClassForwardDeclaredHere]
  641. // CHECK:STDERR: class Incomplete;
  642. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~
  643. // CHECK:STDERR: fail_incomplete_operand_carbon_type.carbon:[[@LINE+4]]:21: note: in `Cpp` operator `AddWith` lookup [InCppOperatorLookup]
  644. // CHECK:STDERR: let result: i32 = *CreateIncomplete() + complete;
  645. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  646. // CHECK:STDERR:
  647. let result: i32 = *CreateIncomplete() + complete;
  648. }
  649. // ============================================================================
  650. // Unsupported operand type in instantiation
  651. // ============================================================================
  652. // --- unsupported_in_instantiation.h
  653. struct Supported {};
  654. template<typename T>
  655. struct Unsupported : public virtual Supported {};
  656. using UnsupportedAlias = Unsupported<int>;
  657. extern UnsupportedAlias unsupported;
  658. // --- fail_import_unsupported_in_instantiation.carbon
  659. library "[[@TEST_NAME]]";
  660. import Cpp library "unsupported_in_instantiation.h";
  661. fn F() {
  662. var supported: Cpp.Supported = Cpp.Supported.Supported();
  663. // CHECK:STDERR: fail_import_unsupported_in_instantiation.carbon:[[@LINE+10]]:21: error: semantics TODO: `class with virtual bases` [SemanticsTodo]
  664. // CHECK:STDERR: let result: i32 = supported + Cpp.unsupported;
  665. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  666. // CHECK:STDERR: fail_import_unsupported_in_instantiation.carbon:[[@LINE+7]]:21: note: while completing C++ type `Cpp.Unsupported` [InCppTypeCompletion]
  667. // CHECK:STDERR: let result: i32 = supported + Cpp.unsupported;
  668. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  669. // CHECK:STDERR: fail_import_unsupported_in_instantiation.carbon:[[@LINE+4]]:21: note: in `Cpp` operator `AddWith` lookup [InCppOperatorLookup]
  670. // CHECK:STDERR: let result: i32 = supported + Cpp.unsupported;
  671. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  672. // CHECK:STDERR:
  673. let result: i32 = supported + Cpp.unsupported;
  674. }
  675. // ============================================================================
  676. // Operator overloading
  677. // ============================================================================
  678. // --- overloading.h
  679. class C {};
  680. auto operator+(C lhs, C rhs) -> C;
  681. class D {};
  682. auto operator+(D lhs, D rhs) -> D;
  683. // --- import_overloading.carbon
  684. library "[[@TEST_NAME]]";
  685. import Cpp library "overloading.h";
  686. fn F() {
  687. let c1: Cpp.C = Cpp.C.C();
  688. let c2: Cpp.C = Cpp.C.C();
  689. let c3: Cpp.C = c1 + c2;
  690. }
  691. // CHECK:STDOUT: --- import_unary_operators.carbon
  692. // CHECK:STDOUT:
  693. // CHECK:STDOUT: constants {
  694. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  695. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  696. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  697. // CHECK:STDOUT: %.d40: type = cpp_overload_set_type @operator++__carbon_thunk [concrete]
  698. // CHECK:STDOUT: %empty_struct.e73: %.d40 = struct_value () [concrete]
  699. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  700. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  701. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  702. // CHECK:STDOUT: %operator++__carbon_thunk.type: type = fn_type @operator++__carbon_thunk [concrete]
  703. // CHECK:STDOUT: %operator++__carbon_thunk: %operator++__carbon_thunk.type = struct_value () [concrete]
  704. // CHECK:STDOUT: %operator--__carbon_thunk.type: type = fn_type @operator--__carbon_thunk [concrete]
  705. // CHECK:STDOUT: %operator--__carbon_thunk: %operator--__carbon_thunk.type = struct_value () [concrete]
  706. // CHECK:STDOUT: %operator-__carbon_thunk.type: type = fn_type @operator-__carbon_thunk [concrete]
  707. // CHECK:STDOUT: %operator-__carbon_thunk: %operator-__carbon_thunk.type = struct_value () [concrete]
  708. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
  709. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  710. // 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]
  711. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.6b9: %AggregateT.as_type.as.Destroy.impl.Op.type.fc1 = struct_value () [concrete]
  712. // CHECK:STDOUT: }
  713. // CHECK:STDOUT:
  714. // CHECK:STDOUT: imports {
  715. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  716. // CHECK:STDOUT: .C = %C.decl
  717. // CHECK:STDOUT: import Cpp//...
  718. // CHECK:STDOUT: }
  719. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  720. // CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @operator++__carbon_thunk [concrete = constants.%empty_struct.e73]
  721. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  722. // CHECK:STDOUT: <elided>
  723. // CHECK:STDOUT: } {
  724. // CHECK:STDOUT: <elided>
  725. // CHECK:STDOUT: }
  726. // CHECK:STDOUT: %operator++__carbon_thunk.decl: %operator++__carbon_thunk.type = fn_decl @operator++__carbon_thunk [concrete = constants.%operator++__carbon_thunk] {
  727. // CHECK:STDOUT: <elided>
  728. // CHECK:STDOUT: } {
  729. // CHECK:STDOUT: <elided>
  730. // CHECK:STDOUT: }
  731. // CHECK:STDOUT: %operator--__carbon_thunk.decl: %operator--__carbon_thunk.type = fn_decl @operator--__carbon_thunk [concrete = constants.%operator--__carbon_thunk] {
  732. // CHECK:STDOUT: <elided>
  733. // CHECK:STDOUT: } {
  734. // CHECK:STDOUT: <elided>
  735. // CHECK:STDOUT: }
  736. // CHECK:STDOUT: %operator-__carbon_thunk.decl: %operator-__carbon_thunk.type = fn_decl @operator-__carbon_thunk [concrete = constants.%operator-__carbon_thunk] {
  737. // CHECK:STDOUT: <elided>
  738. // CHECK:STDOUT: } {
  739. // CHECK:STDOUT: <elided>
  740. // CHECK:STDOUT: }
  741. // CHECK:STDOUT: }
  742. // CHECK:STDOUT:
  743. // CHECK:STDOUT: fn @F() {
  744. // CHECK:STDOUT: !entry:
  745. // CHECK:STDOUT: name_binding_decl {
  746. // CHECK:STDOUT: %c.patt: %pattern_type.217 = binding_pattern c [concrete]
  747. // CHECK:STDOUT: %c.var_patt: %pattern_type.217 = var_pattern %c.patt [concrete]
  748. // CHECK:STDOUT: }
  749. // CHECK:STDOUT: %c.var: ref %C = var %c.var_patt
  750. // CHECK:STDOUT: %Cpp.ref.loc8_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  751. // CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  752. // CHECK:STDOUT: %C.ref.loc8_23: %.d40 = name_ref C, imports.%.40b [concrete = constants.%empty_struct.e73]
  753. // CHECK:STDOUT: %.loc8_3.1: ref %C = splice_block %c.var {}
  754. // CHECK:STDOUT: %addr.loc8_26: %ptr.d9e = addr_of %.loc8_3.1
  755. // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_26)
  756. // CHECK:STDOUT: %.loc8_26: init %C = in_place_init %C__carbon_thunk.call, %.loc8_3.1
  757. // CHECK:STDOUT: assign %c.var, %.loc8_26
  758. // CHECK:STDOUT: %.loc8_13: type = splice_block %C.ref.loc8_13 [concrete = constants.%C] {
  759. // CHECK:STDOUT: %Cpp.ref.loc8_10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  760. // CHECK:STDOUT: %C.ref.loc8_13: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  761. // CHECK:STDOUT: }
  762. // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var
  763. // CHECK:STDOUT: %c.ref.loc11: ref %C = name_ref c, %c
  764. // CHECK:STDOUT: %.loc11_3.1: ref %C = temporary_storage
  765. // CHECK:STDOUT: %addr.loc11_5: %ptr.d9e = addr_of %c.ref.loc11
  766. // CHECK:STDOUT: %addr.loc11_3.1: %ptr.d9e = addr_of %.loc11_3.1
  767. // CHECK:STDOUT: %operator++__carbon_thunk.call: init %empty_tuple.type = call imports.%operator++__carbon_thunk.decl(%addr.loc11_5, %addr.loc11_3.1)
  768. // CHECK:STDOUT: %.loc11_3.2: init %C = in_place_init %operator++__carbon_thunk.call, %.loc11_3.1
  769. // CHECK:STDOUT: %.loc11_3.3: ref %C = temporary %.loc11_3.1, %.loc11_3.2
  770. // CHECK:STDOUT: %c.ref.loc12: ref %C = name_ref c, %c
  771. // CHECK:STDOUT: %.loc12_3.1: ref %C = temporary_storage
  772. // CHECK:STDOUT: %addr.loc12_5: %ptr.d9e = addr_of %c.ref.loc12
  773. // CHECK:STDOUT: %addr.loc12_3.1: %ptr.d9e = addr_of %.loc12_3.1
  774. // CHECK:STDOUT: %operator--__carbon_thunk.call: init %empty_tuple.type = call imports.%operator--__carbon_thunk.decl(%addr.loc12_5, %addr.loc12_3.1)
  775. // CHECK:STDOUT: %.loc12_3.2: init %C = in_place_init %operator--__carbon_thunk.call, %.loc12_3.1
  776. // CHECK:STDOUT: %.loc12_3.3: ref %C = temporary %.loc12_3.1, %.loc12_3.2
  777. // CHECK:STDOUT: name_binding_decl {
  778. // CHECK:STDOUT: %minus.patt: %pattern_type.217 = binding_pattern minus [concrete]
  779. // CHECK:STDOUT: }
  780. // CHECK:STDOUT: %c.ref.loc15: ref %C = name_ref c, %c
  781. // CHECK:STDOUT: %.loc15_22.1: ref %C = temporary_storage
  782. // CHECK:STDOUT: %.loc15_23.1: %C = bind_value %c.ref.loc15
  783. // CHECK:STDOUT: %.loc15_23.2: ref %C = value_as_ref %.loc15_23.1
  784. // CHECK:STDOUT: %addr.loc15_22.1: %ptr.d9e = addr_of %.loc15_23.2
  785. // CHECK:STDOUT: %addr.loc15_22.2: %ptr.d9e = addr_of %.loc15_22.1
  786. // CHECK:STDOUT: %operator-__carbon_thunk.call: init %empty_tuple.type = call imports.%operator-__carbon_thunk.decl(%addr.loc15_22.1, %addr.loc15_22.2)
  787. // CHECK:STDOUT: %.loc15_22.2: init %C = in_place_init %operator-__carbon_thunk.call, %.loc15_22.1
  788. // CHECK:STDOUT: %.loc15_17: type = splice_block %C.ref.loc15 [concrete = constants.%C] {
  789. // CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  790. // CHECK:STDOUT: %C.ref.loc15: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  791. // CHECK:STDOUT: }
  792. // CHECK:STDOUT: %.loc15_22.3: ref %C = temporary %.loc15_22.1, %.loc15_22.2
  793. // CHECK:STDOUT: %.loc15_22.4: %C = bind_value %.loc15_22.3
  794. // CHECK:STDOUT: %minus: %C = bind_name minus, %.loc15_22.4
  795. // CHECK:STDOUT: %facet_value.loc15: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  796. // CHECK:STDOUT: %.loc15_22.5: %type_where = converted constants.%C, %facet_value.loc15 [concrete = constants.%facet_value]
  797. // 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
  798. // CHECK:STDOUT: <elided>
  799. // CHECK:STDOUT: %bound_method.loc15: <bound method> = bound_method %.loc15_22.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.1
  800. // CHECK:STDOUT: %addr.loc15_22.3: %ptr.d9e = addr_of %.loc15_22.3
  801. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc15: init %empty_tuple.type = call %bound_method.loc15(%addr.loc15_22.3)
  802. // CHECK:STDOUT: %facet_value.loc12: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  803. // CHECK:STDOUT: %.loc12_3.4: %type_where = converted constants.%C, %facet_value.loc12 [concrete = constants.%facet_value]
  804. // 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
  805. // CHECK:STDOUT: <elided>
  806. // CHECK:STDOUT: %bound_method.loc12: <bound method> = bound_method %.loc12_3.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.2
  807. // CHECK:STDOUT: %addr.loc12_3.2: %ptr.d9e = addr_of %.loc12_3.3
  808. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc12: init %empty_tuple.type = call %bound_method.loc12(%addr.loc12_3.2)
  809. // CHECK:STDOUT: %facet_value.loc11: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  810. // CHECK:STDOUT: %.loc11_3.4: %type_where = converted constants.%C, %facet_value.loc11 [concrete = constants.%facet_value]
  811. // 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
  812. // CHECK:STDOUT: <elided>
  813. // CHECK:STDOUT: %bound_method.loc11: <bound method> = bound_method %.loc11_3.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.3
  814. // CHECK:STDOUT: %addr.loc11_3.2: %ptr.d9e = addr_of %.loc11_3.3
  815. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc11: init %empty_tuple.type = call %bound_method.loc11(%addr.loc11_3.2)
  816. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  817. // CHECK:STDOUT: %.loc8_3.2: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  818. // 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
  819. // CHECK:STDOUT: <elided>
  820. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %c.var, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.4
  821. // CHECK:STDOUT: %addr.loc8_3: %ptr.d9e = addr_of %c.var
  822. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_3)
  823. // CHECK:STDOUT: <elided>
  824. // CHECK:STDOUT: }
  825. // CHECK:STDOUT:
  826. // CHECK:STDOUT: --- import_binary_operators.carbon
  827. // CHECK:STDOUT:
  828. // CHECK:STDOUT: constants {
  829. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  830. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  831. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  832. // CHECK:STDOUT: %.d40: type = cpp_overload_set_type @Copy.Op [concrete]
  833. // CHECK:STDOUT: %empty_struct.e73: %.d40 = struct_value () [concrete]
  834. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  835. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  836. // CHECK:STDOUT: %C__carbon_thunk: %C__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: %operator|__carbon_thunk.type: type = fn_type @operator|__carbon_thunk [concrete]
  850. // CHECK:STDOUT: %operator|__carbon_thunk: %operator|__carbon_thunk.type = struct_value () [concrete]
  851. // CHECK:STDOUT: %operator^__carbon_thunk.type: type = fn_type @operator^__carbon_thunk [concrete]
  852. // CHECK:STDOUT: %operator^__carbon_thunk: %operator^__carbon_thunk.type = struct_value () [concrete]
  853. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
  854. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  855. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  856. // CHECK:STDOUT: %operator<<__carbon_thunk.type: type = fn_type @operator<<__carbon_thunk [concrete]
  857. // CHECK:STDOUT: %operator<<__carbon_thunk: %operator<<__carbon_thunk.type = struct_value () [concrete]
  858. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  859. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  860. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  861. // 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]
  862. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340 = struct_value () [symbolic]
  863. // CHECK:STDOUT: %ImplicitAs.impl_witness.204: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.9e9, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  864. // 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]
  865. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584 = struct_value () [concrete]
  866. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.204) [concrete]
  867. // CHECK:STDOUT: %.1df: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  868. // 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]
  869. // 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]
  870. // CHECK:STDOUT: %bound_method.f36: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  871. // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
  872. // CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete]
  873. // CHECK:STDOUT: %operator>>__carbon_thunk.type: type = fn_type @operator>>__carbon_thunk [concrete]
  874. // CHECK:STDOUT: %operator>>__carbon_thunk: %operator>>__carbon_thunk.type = struct_value () [concrete]
  875. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.23d: <bound method> = bound_method %int_5.64b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [concrete]
  876. // CHECK:STDOUT: %bound_method.724: <bound method> = bound_method %int_5.64b, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  877. // CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete]
  878. // CHECK:STDOUT: %operator+=__carbon_thunk.type: type = fn_type @operator+=__carbon_thunk [concrete]
  879. // CHECK:STDOUT: %operator+=__carbon_thunk: %operator+=__carbon_thunk.type = struct_value () [concrete]
  880. // CHECK:STDOUT: %operator-=__carbon_thunk.type: type = fn_type @operator-=__carbon_thunk [concrete]
  881. // CHECK:STDOUT: %operator-=__carbon_thunk: %operator-=__carbon_thunk.type = struct_value () [concrete]
  882. // CHECK:STDOUT: %operator*=__carbon_thunk.type: type = fn_type @operator*=__carbon_thunk [concrete]
  883. // CHECK:STDOUT: %operator*=__carbon_thunk: %operator*=__carbon_thunk.type = struct_value () [concrete]
  884. // CHECK:STDOUT: %operator/=__carbon_thunk.type: type = fn_type @operator/=__carbon_thunk [concrete]
  885. // CHECK:STDOUT: %operator/=__carbon_thunk: %operator/=__carbon_thunk.type = struct_value () [concrete]
  886. // CHECK:STDOUT: %operator%=__carbon_thunk.type: type = fn_type @operator%=__carbon_thunk [concrete]
  887. // CHECK:STDOUT: %operator%=__carbon_thunk: %operator%=__carbon_thunk.type = struct_value () [concrete]
  888. // CHECK:STDOUT: %operator&=__carbon_thunk.type: type = fn_type @operator&=__carbon_thunk [concrete]
  889. // CHECK:STDOUT: %operator&=__carbon_thunk: %operator&=__carbon_thunk.type = struct_value () [concrete]
  890. // CHECK:STDOUT: %operator|=__carbon_thunk.type: type = fn_type @operator|=__carbon_thunk [concrete]
  891. // CHECK:STDOUT: %operator|=__carbon_thunk: %operator|=__carbon_thunk.type = struct_value () [concrete]
  892. // CHECK:STDOUT: %operator^=__carbon_thunk.type: type = fn_type @operator^=__carbon_thunk [concrete]
  893. // CHECK:STDOUT: %operator^=__carbon_thunk: %operator^=__carbon_thunk.type = struct_value () [concrete]
  894. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
  895. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
  896. // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete]
  897. // CHECK:STDOUT: %ptr.bb2: type = ptr_type bool [concrete]
  898. // CHECK:STDOUT: %operator==__carbon_thunk.type: type = fn_type @operator==__carbon_thunk [concrete]
  899. // CHECK:STDOUT: %operator==__carbon_thunk: %operator==__carbon_thunk.type = struct_value () [concrete]
  900. // CHECK:STDOUT: %operator!=__carbon_thunk.type: type = fn_type @operator!=__carbon_thunk [concrete]
  901. // CHECK:STDOUT: %operator!=__carbon_thunk: %operator!=__carbon_thunk.type = struct_value () [concrete]
  902. // CHECK:STDOUT: %operator>__carbon_thunk.type: type = fn_type @operator>__carbon_thunk [concrete]
  903. // CHECK:STDOUT: %operator>__carbon_thunk: %operator>__carbon_thunk.type = struct_value () [concrete]
  904. // CHECK:STDOUT: %operator<__carbon_thunk.type: type = fn_type @operator<__carbon_thunk [concrete]
  905. // CHECK:STDOUT: %operator<__carbon_thunk: %operator<__carbon_thunk.type = struct_value () [concrete]
  906. // CHECK:STDOUT: %operator>=__carbon_thunk.type: type = fn_type @operator>=__carbon_thunk [concrete]
  907. // CHECK:STDOUT: %operator>=__carbon_thunk: %operator>=__carbon_thunk.type = struct_value () [concrete]
  908. // CHECK:STDOUT: %operator<=__carbon_thunk.type: type = fn_type @operator<=__carbon_thunk [concrete]
  909. // CHECK:STDOUT: %operator<=__carbon_thunk: %operator<=__carbon_thunk.type = struct_value () [concrete]
  910. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
  911. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  912. // 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]
  913. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.6b9: %AggregateT.as_type.as.Destroy.impl.Op.type.fc1 = struct_value () [concrete]
  914. // CHECK:STDOUT: }
  915. // CHECK:STDOUT:
  916. // CHECK:STDOUT: imports {
  917. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  918. // CHECK:STDOUT: .C = %C.decl
  919. // CHECK:STDOUT: import Cpp//...
  920. // CHECK:STDOUT: }
  921. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  922. // CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @Copy.Op [concrete = constants.%empty_struct.e73]
  923. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  924. // CHECK:STDOUT: <elided>
  925. // CHECK:STDOUT: } {
  926. // CHECK:STDOUT: <elided>
  927. // CHECK:STDOUT: }
  928. // CHECK:STDOUT: %operator+__carbon_thunk.decl: %operator+__carbon_thunk.type = fn_decl @operator+__carbon_thunk [concrete = constants.%operator+__carbon_thunk] {
  929. // CHECK:STDOUT: <elided>
  930. // CHECK:STDOUT: } {
  931. // CHECK:STDOUT: <elided>
  932. // CHECK:STDOUT: }
  933. // CHECK:STDOUT: %operator-__carbon_thunk.decl: %operator-__carbon_thunk.type = fn_decl @operator-__carbon_thunk [concrete = constants.%operator-__carbon_thunk] {
  934. // CHECK:STDOUT: <elided>
  935. // CHECK:STDOUT: } {
  936. // CHECK:STDOUT: <elided>
  937. // CHECK:STDOUT: }
  938. // CHECK:STDOUT: %operator*__carbon_thunk.decl: %operator*__carbon_thunk.type = fn_decl @operator*__carbon_thunk [concrete = constants.%operator*__carbon_thunk] {
  939. // CHECK:STDOUT: <elided>
  940. // CHECK:STDOUT: } {
  941. // CHECK:STDOUT: <elided>
  942. // CHECK:STDOUT: }
  943. // CHECK:STDOUT: %operator/__carbon_thunk.decl: %operator/__carbon_thunk.type = fn_decl @operator/__carbon_thunk [concrete = constants.%operator/__carbon_thunk] {
  944. // CHECK:STDOUT: <elided>
  945. // CHECK:STDOUT: } {
  946. // CHECK:STDOUT: <elided>
  947. // CHECK:STDOUT: }
  948. // CHECK:STDOUT: %operator%__carbon_thunk.decl: %operator%__carbon_thunk.type = fn_decl @operator%__carbon_thunk [concrete = constants.%operator%__carbon_thunk] {
  949. // CHECK:STDOUT: <elided>
  950. // CHECK:STDOUT: } {
  951. // CHECK:STDOUT: <elided>
  952. // CHECK:STDOUT: }
  953. // CHECK:STDOUT: %operator&__carbon_thunk.decl: %operator&__carbon_thunk.type = fn_decl @operator&__carbon_thunk [concrete = constants.%operator&__carbon_thunk] {
  954. // CHECK:STDOUT: <elided>
  955. // CHECK:STDOUT: } {
  956. // CHECK:STDOUT: <elided>
  957. // CHECK:STDOUT: }
  958. // CHECK:STDOUT: %operator|__carbon_thunk.decl: %operator|__carbon_thunk.type = fn_decl @operator|__carbon_thunk [concrete = constants.%operator|__carbon_thunk] {
  959. // CHECK:STDOUT: <elided>
  960. // CHECK:STDOUT: } {
  961. // CHECK:STDOUT: <elided>
  962. // CHECK:STDOUT: }
  963. // CHECK:STDOUT: %operator^__carbon_thunk.decl: %operator^__carbon_thunk.type = fn_decl @operator^__carbon_thunk [concrete = constants.%operator^__carbon_thunk] {
  964. // CHECK:STDOUT: <elided>
  965. // CHECK:STDOUT: } {
  966. // CHECK:STDOUT: <elided>
  967. // CHECK:STDOUT: }
  968. // CHECK:STDOUT: %operator<<__carbon_thunk.decl: %operator<<__carbon_thunk.type = fn_decl @operator<<__carbon_thunk [concrete = constants.%operator<<__carbon_thunk] {
  969. // CHECK:STDOUT: <elided>
  970. // CHECK:STDOUT: } {
  971. // CHECK:STDOUT: <elided>
  972. // CHECK:STDOUT: }
  973. // CHECK:STDOUT: %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)]
  974. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.9e9 = impl_witness_table (%Core.import_ref.ee7), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  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: %operator&=__carbon_thunk.decl: %operator&=__carbon_thunk.type = fn_decl @operator&=__carbon_thunk [concrete = constants.%operator&=__carbon_thunk] {
  1006. // CHECK:STDOUT: <elided>
  1007. // CHECK:STDOUT: } {
  1008. // CHECK:STDOUT: <elided>
  1009. // CHECK:STDOUT: }
  1010. // CHECK:STDOUT: %operator|=__carbon_thunk.decl: %operator|=__carbon_thunk.type = fn_decl @operator|=__carbon_thunk [concrete = constants.%operator|=__carbon_thunk] {
  1011. // CHECK:STDOUT: <elided>
  1012. // CHECK:STDOUT: } {
  1013. // CHECK:STDOUT: <elided>
  1014. // CHECK:STDOUT: }
  1015. // CHECK:STDOUT: %operator^=__carbon_thunk.decl: %operator^=__carbon_thunk.type = fn_decl @operator^=__carbon_thunk [concrete = constants.%operator^=__carbon_thunk] {
  1016. // CHECK:STDOUT: <elided>
  1017. // CHECK:STDOUT: } {
  1018. // CHECK:STDOUT: <elided>
  1019. // CHECK:STDOUT: }
  1020. // CHECK:STDOUT: %operator==__carbon_thunk.decl: %operator==__carbon_thunk.type = fn_decl @operator==__carbon_thunk [concrete = constants.%operator==__carbon_thunk] {
  1021. // CHECK:STDOUT: <elided>
  1022. // CHECK:STDOUT: } {
  1023. // CHECK:STDOUT: <elided>
  1024. // CHECK:STDOUT: }
  1025. // CHECK:STDOUT: %operator!=__carbon_thunk.decl: %operator!=__carbon_thunk.type = fn_decl @operator!=__carbon_thunk [concrete = constants.%operator!=__carbon_thunk] {
  1026. // CHECK:STDOUT: <elided>
  1027. // CHECK:STDOUT: } {
  1028. // CHECK:STDOUT: <elided>
  1029. // CHECK:STDOUT: }
  1030. // CHECK:STDOUT: %operator>__carbon_thunk.decl: %operator>__carbon_thunk.type = fn_decl @operator>__carbon_thunk [concrete = constants.%operator>__carbon_thunk] {
  1031. // CHECK:STDOUT: <elided>
  1032. // CHECK:STDOUT: } {
  1033. // CHECK:STDOUT: <elided>
  1034. // CHECK:STDOUT: }
  1035. // CHECK:STDOUT: %operator<__carbon_thunk.decl: %operator<__carbon_thunk.type = fn_decl @operator<__carbon_thunk [concrete = constants.%operator<__carbon_thunk] {
  1036. // CHECK:STDOUT: <elided>
  1037. // CHECK:STDOUT: } {
  1038. // CHECK:STDOUT: <elided>
  1039. // CHECK:STDOUT: }
  1040. // CHECK:STDOUT: %operator>=__carbon_thunk.decl: %operator>=__carbon_thunk.type = fn_decl @operator>=__carbon_thunk [concrete = constants.%operator>=__carbon_thunk] {
  1041. // CHECK:STDOUT: <elided>
  1042. // CHECK:STDOUT: } {
  1043. // CHECK:STDOUT: <elided>
  1044. // CHECK:STDOUT: }
  1045. // CHECK:STDOUT: %operator<=__carbon_thunk.decl: %operator<=__carbon_thunk.type = fn_decl @operator<=__carbon_thunk [concrete = constants.%operator<=__carbon_thunk] {
  1046. // CHECK:STDOUT: <elided>
  1047. // CHECK:STDOUT: } {
  1048. // CHECK:STDOUT: <elided>
  1049. // CHECK:STDOUT: }
  1050. // CHECK:STDOUT: }
  1051. // CHECK:STDOUT:
  1052. // CHECK:STDOUT: fn @F() {
  1053. // CHECK:STDOUT: !entry:
  1054. // CHECK:STDOUT: name_binding_decl {
  1055. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = binding_pattern c1 [concrete]
  1056. // CHECK:STDOUT: %c1.var_patt: %pattern_type.217 = var_pattern %c1.patt [concrete]
  1057. // CHECK:STDOUT: }
  1058. // CHECK:STDOUT: %c1.var: ref %C = var %c1.var_patt
  1059. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1060. // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1061. // CHECK:STDOUT: %C.ref.loc8_24: %.d40 = name_ref C, imports.%.40b [concrete = constants.%empty_struct.e73]
  1062. // CHECK:STDOUT: %.loc8_3.1: ref %C = splice_block %c1.var {}
  1063. // CHECK:STDOUT: %addr.loc8_27: %ptr.d9e = addr_of %.loc8_3.1
  1064. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_27)
  1065. // CHECK:STDOUT: %.loc8_27: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_3.1
  1066. // CHECK:STDOUT: assign %c1.var, %.loc8_27
  1067. // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] {
  1068. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1069. // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1070. // CHECK:STDOUT: }
  1071. // CHECK:STDOUT: %c1: ref %C = bind_name c1, %c1.var
  1072. // CHECK:STDOUT: name_binding_decl {
  1073. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = binding_pattern c2 [concrete]
  1074. // CHECK:STDOUT: %c2.var_patt: %pattern_type.217 = var_pattern %c2.patt [concrete]
  1075. // CHECK:STDOUT: }
  1076. // CHECK:STDOUT: %c2.var: ref %C = var %c2.var_patt
  1077. // CHECK:STDOUT: %Cpp.ref.loc9_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1078. // CHECK:STDOUT: %C.ref.loc9_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1079. // CHECK:STDOUT: %C.ref.loc9_24: %.d40 = name_ref C, imports.%.40b [concrete = constants.%empty_struct.e73]
  1080. // CHECK:STDOUT: %.loc9_3.1: ref %C = splice_block %c2.var {}
  1081. // CHECK:STDOUT: %addr.loc9_27: %ptr.d9e = addr_of %.loc9_3.1
  1082. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc9_27)
  1083. // CHECK:STDOUT: %.loc9_27: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_3.1
  1084. // CHECK:STDOUT: assign %c2.var, %.loc9_27
  1085. // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] {
  1086. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1087. // CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1088. // CHECK:STDOUT: }
  1089. // CHECK:STDOUT: %c2: ref %C = bind_name c2, %c2.var
  1090. // CHECK:STDOUT: name_binding_decl {
  1091. // CHECK:STDOUT: %addition.patt: %pattern_type.217 = binding_pattern addition [concrete]
  1092. // CHECK:STDOUT: }
  1093. // CHECK:STDOUT: %c1.ref.loc12: ref %C = name_ref c1, %c1
  1094. // CHECK:STDOUT: %c2.ref.loc12: ref %C = name_ref c2, %c2
  1095. // CHECK:STDOUT: %.loc12_28.1: ref %C = temporary_storage
  1096. // CHECK:STDOUT: %.loc12_25.1: %C = bind_value %c1.ref.loc12
  1097. // CHECK:STDOUT: %.loc12_30.1: %C = bind_value %c2.ref.loc12
  1098. // CHECK:STDOUT: %.loc12_25.2: ref %C = value_as_ref %.loc12_25.1
  1099. // CHECK:STDOUT: %addr.loc12_28.1: %ptr.d9e = addr_of %.loc12_25.2
  1100. // CHECK:STDOUT: %.loc12_30.2: ref %C = value_as_ref %.loc12_30.1
  1101. // CHECK:STDOUT: %addr.loc12_28.2: %ptr.d9e = addr_of %.loc12_30.2
  1102. // CHECK:STDOUT: %addr.loc12_28.3: %ptr.d9e = addr_of %.loc12_28.1
  1103. // 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)
  1104. // CHECK:STDOUT: %.loc12_28.2: init %C = in_place_init %operator+__carbon_thunk.call, %.loc12_28.1
  1105. // CHECK:STDOUT: %.loc12_20: type = splice_block %C.ref.loc12 [concrete = constants.%C] {
  1106. // CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1107. // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1108. // CHECK:STDOUT: }
  1109. // CHECK:STDOUT: %.loc12_28.3: ref %C = temporary %.loc12_28.1, %.loc12_28.2
  1110. // CHECK:STDOUT: %.loc12_28.4: %C = bind_value %.loc12_28.3
  1111. // CHECK:STDOUT: %addition: %C = bind_name addition, %.loc12_28.4
  1112. // CHECK:STDOUT: name_binding_decl {
  1113. // CHECK:STDOUT: %subtraction.patt: %pattern_type.217 = binding_pattern subtraction [concrete]
  1114. // CHECK:STDOUT: }
  1115. // CHECK:STDOUT: %c1.ref.loc13: ref %C = name_ref c1, %c1
  1116. // CHECK:STDOUT: %c2.ref.loc13: ref %C = name_ref c2, %c2
  1117. // CHECK:STDOUT: %.loc13_31.1: ref %C = temporary_storage
  1118. // CHECK:STDOUT: %.loc13_28.1: %C = bind_value %c1.ref.loc13
  1119. // CHECK:STDOUT: %.loc13_33.1: %C = bind_value %c2.ref.loc13
  1120. // CHECK:STDOUT: %.loc13_28.2: ref %C = value_as_ref %.loc13_28.1
  1121. // CHECK:STDOUT: %addr.loc13_31.1: %ptr.d9e = addr_of %.loc13_28.2
  1122. // CHECK:STDOUT: %.loc13_33.2: ref %C = value_as_ref %.loc13_33.1
  1123. // CHECK:STDOUT: %addr.loc13_31.2: %ptr.d9e = addr_of %.loc13_33.2
  1124. // CHECK:STDOUT: %addr.loc13_31.3: %ptr.d9e = addr_of %.loc13_31.1
  1125. // 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)
  1126. // CHECK:STDOUT: %.loc13_31.2: init %C = in_place_init %operator-__carbon_thunk.call, %.loc13_31.1
  1127. // CHECK:STDOUT: %.loc13_23: type = splice_block %C.ref.loc13 [concrete = constants.%C] {
  1128. // CHECK:STDOUT: %Cpp.ref.loc13: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1129. // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1130. // CHECK:STDOUT: }
  1131. // CHECK:STDOUT: %.loc13_31.3: ref %C = temporary %.loc13_31.1, %.loc13_31.2
  1132. // CHECK:STDOUT: %.loc13_31.4: %C = bind_value %.loc13_31.3
  1133. // CHECK:STDOUT: %subtraction: %C = bind_name subtraction, %.loc13_31.4
  1134. // CHECK:STDOUT: name_binding_decl {
  1135. // CHECK:STDOUT: %multiplication.patt: %pattern_type.217 = binding_pattern multiplication [concrete]
  1136. // CHECK:STDOUT: }
  1137. // CHECK:STDOUT: %c1.ref.loc14: ref %C = name_ref c1, %c1
  1138. // CHECK:STDOUT: %c2.ref.loc14: ref %C = name_ref c2, %c2
  1139. // CHECK:STDOUT: %.loc14_34.1: ref %C = temporary_storage
  1140. // CHECK:STDOUT: %.loc14_31.1: %C = bind_value %c1.ref.loc14
  1141. // CHECK:STDOUT: %.loc14_36.1: %C = bind_value %c2.ref.loc14
  1142. // CHECK:STDOUT: %.loc14_31.2: ref %C = value_as_ref %.loc14_31.1
  1143. // CHECK:STDOUT: %addr.loc14_34.1: %ptr.d9e = addr_of %.loc14_31.2
  1144. // CHECK:STDOUT: %.loc14_36.2: ref %C = value_as_ref %.loc14_36.1
  1145. // CHECK:STDOUT: %addr.loc14_34.2: %ptr.d9e = addr_of %.loc14_36.2
  1146. // CHECK:STDOUT: %addr.loc14_34.3: %ptr.d9e = addr_of %.loc14_34.1
  1147. // 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)
  1148. // CHECK:STDOUT: %.loc14_34.2: init %C = in_place_init %operator*__carbon_thunk.call, %.loc14_34.1
  1149. // CHECK:STDOUT: %.loc14_26: type = splice_block %C.ref.loc14 [concrete = constants.%C] {
  1150. // CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1151. // CHECK:STDOUT: %C.ref.loc14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1152. // CHECK:STDOUT: }
  1153. // CHECK:STDOUT: %.loc14_34.3: ref %C = temporary %.loc14_34.1, %.loc14_34.2
  1154. // CHECK:STDOUT: %.loc14_34.4: %C = bind_value %.loc14_34.3
  1155. // CHECK:STDOUT: %multiplication: %C = bind_name multiplication, %.loc14_34.4
  1156. // CHECK:STDOUT: name_binding_decl {
  1157. // CHECK:STDOUT: %division.patt: %pattern_type.217 = binding_pattern division [concrete]
  1158. // CHECK:STDOUT: }
  1159. // CHECK:STDOUT: %c1.ref.loc15: ref %C = name_ref c1, %c1
  1160. // CHECK:STDOUT: %c2.ref.loc15: ref %C = name_ref c2, %c2
  1161. // CHECK:STDOUT: %.loc15_28.1: ref %C = temporary_storage
  1162. // CHECK:STDOUT: %.loc15_25.1: %C = bind_value %c1.ref.loc15
  1163. // CHECK:STDOUT: %.loc15_30.1: %C = bind_value %c2.ref.loc15
  1164. // CHECK:STDOUT: %.loc15_25.2: ref %C = value_as_ref %.loc15_25.1
  1165. // CHECK:STDOUT: %addr.loc15_28.1: %ptr.d9e = addr_of %.loc15_25.2
  1166. // CHECK:STDOUT: %.loc15_30.2: ref %C = value_as_ref %.loc15_30.1
  1167. // CHECK:STDOUT: %addr.loc15_28.2: %ptr.d9e = addr_of %.loc15_30.2
  1168. // CHECK:STDOUT: %addr.loc15_28.3: %ptr.d9e = addr_of %.loc15_28.1
  1169. // 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)
  1170. // CHECK:STDOUT: %.loc15_28.2: init %C = in_place_init %operator/__carbon_thunk.call, %.loc15_28.1
  1171. // CHECK:STDOUT: %.loc15_20: type = splice_block %C.ref.loc15 [concrete = constants.%C] {
  1172. // CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1173. // CHECK:STDOUT: %C.ref.loc15: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1174. // CHECK:STDOUT: }
  1175. // CHECK:STDOUT: %.loc15_28.3: ref %C = temporary %.loc15_28.1, %.loc15_28.2
  1176. // CHECK:STDOUT: %.loc15_28.4: %C = bind_value %.loc15_28.3
  1177. // CHECK:STDOUT: %division: %C = bind_name division, %.loc15_28.4
  1178. // CHECK:STDOUT: name_binding_decl {
  1179. // CHECK:STDOUT: %modulo.patt: %pattern_type.217 = binding_pattern modulo [concrete]
  1180. // CHECK:STDOUT: }
  1181. // CHECK:STDOUT: %c1.ref.loc16: ref %C = name_ref c1, %c1
  1182. // CHECK:STDOUT: %c2.ref.loc16: ref %C = name_ref c2, %c2
  1183. // CHECK:STDOUT: %.loc16_26.1: ref %C = temporary_storage
  1184. // CHECK:STDOUT: %.loc16_23.1: %C = bind_value %c1.ref.loc16
  1185. // CHECK:STDOUT: %.loc16_28.1: %C = bind_value %c2.ref.loc16
  1186. // CHECK:STDOUT: %.loc16_23.2: ref %C = value_as_ref %.loc16_23.1
  1187. // CHECK:STDOUT: %addr.loc16_26.1: %ptr.d9e = addr_of %.loc16_23.2
  1188. // CHECK:STDOUT: %.loc16_28.2: ref %C = value_as_ref %.loc16_28.1
  1189. // CHECK:STDOUT: %addr.loc16_26.2: %ptr.d9e = addr_of %.loc16_28.2
  1190. // CHECK:STDOUT: %addr.loc16_26.3: %ptr.d9e = addr_of %.loc16_26.1
  1191. // 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)
  1192. // CHECK:STDOUT: %.loc16_26.2: init %C = in_place_init %operator%__carbon_thunk.call, %.loc16_26.1
  1193. // CHECK:STDOUT: %.loc16_18: type = splice_block %C.ref.loc16 [concrete = constants.%C] {
  1194. // CHECK:STDOUT: %Cpp.ref.loc16: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1195. // CHECK:STDOUT: %C.ref.loc16: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1196. // CHECK:STDOUT: }
  1197. // CHECK:STDOUT: %.loc16_26.3: ref %C = temporary %.loc16_26.1, %.loc16_26.2
  1198. // CHECK:STDOUT: %.loc16_26.4: %C = bind_value %.loc16_26.3
  1199. // CHECK:STDOUT: %modulo: %C = bind_name modulo, %.loc16_26.4
  1200. // CHECK:STDOUT: name_binding_decl {
  1201. // CHECK:STDOUT: %bitwise_and.patt: %pattern_type.217 = binding_pattern bitwise_and [concrete]
  1202. // CHECK:STDOUT: }
  1203. // CHECK:STDOUT: %c1.ref.loc19: ref %C = name_ref c1, %c1
  1204. // CHECK:STDOUT: %c2.ref.loc19: ref %C = name_ref c2, %c2
  1205. // CHECK:STDOUT: %.loc19_31.1: ref %C = temporary_storage
  1206. // CHECK:STDOUT: %.loc19_28.1: %C = bind_value %c1.ref.loc19
  1207. // CHECK:STDOUT: %.loc19_33.1: %C = bind_value %c2.ref.loc19
  1208. // CHECK:STDOUT: %.loc19_28.2: ref %C = value_as_ref %.loc19_28.1
  1209. // CHECK:STDOUT: %addr.loc19_31.1: %ptr.d9e = addr_of %.loc19_28.2
  1210. // CHECK:STDOUT: %.loc19_33.2: ref %C = value_as_ref %.loc19_33.1
  1211. // CHECK:STDOUT: %addr.loc19_31.2: %ptr.d9e = addr_of %.loc19_33.2
  1212. // CHECK:STDOUT: %addr.loc19_31.3: %ptr.d9e = addr_of %.loc19_31.1
  1213. // 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)
  1214. // CHECK:STDOUT: %.loc19_31.2: init %C = in_place_init %operator&__carbon_thunk.call, %.loc19_31.1
  1215. // CHECK:STDOUT: %.loc19_23: type = splice_block %C.ref.loc19 [concrete = constants.%C] {
  1216. // CHECK:STDOUT: %Cpp.ref.loc19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1217. // CHECK:STDOUT: %C.ref.loc19: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1218. // CHECK:STDOUT: }
  1219. // CHECK:STDOUT: %.loc19_31.3: ref %C = temporary %.loc19_31.1, %.loc19_31.2
  1220. // CHECK:STDOUT: %.loc19_31.4: %C = bind_value %.loc19_31.3
  1221. // CHECK:STDOUT: %bitwise_and: %C = bind_name bitwise_and, %.loc19_31.4
  1222. // CHECK:STDOUT: name_binding_decl {
  1223. // CHECK:STDOUT: %bitwise_or.patt: %pattern_type.217 = binding_pattern bitwise_or [concrete]
  1224. // CHECK:STDOUT: }
  1225. // CHECK:STDOUT: %c1.ref.loc20: ref %C = name_ref c1, %c1
  1226. // CHECK:STDOUT: %c2.ref.loc20: ref %C = name_ref c2, %c2
  1227. // CHECK:STDOUT: %.loc20_30.1: ref %C = temporary_storage
  1228. // CHECK:STDOUT: %.loc20_27.1: %C = bind_value %c1.ref.loc20
  1229. // CHECK:STDOUT: %.loc20_32.1: %C = bind_value %c2.ref.loc20
  1230. // CHECK:STDOUT: %.loc20_27.2: ref %C = value_as_ref %.loc20_27.1
  1231. // CHECK:STDOUT: %addr.loc20_30.1: %ptr.d9e = addr_of %.loc20_27.2
  1232. // CHECK:STDOUT: %.loc20_32.2: ref %C = value_as_ref %.loc20_32.1
  1233. // CHECK:STDOUT: %addr.loc20_30.2: %ptr.d9e = addr_of %.loc20_32.2
  1234. // CHECK:STDOUT: %addr.loc20_30.3: %ptr.d9e = addr_of %.loc20_30.1
  1235. // 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)
  1236. // CHECK:STDOUT: %.loc20_30.2: init %C = in_place_init %operator|__carbon_thunk.call, %.loc20_30.1
  1237. // CHECK:STDOUT: %.loc20_22: type = splice_block %C.ref.loc20 [concrete = constants.%C] {
  1238. // CHECK:STDOUT: %Cpp.ref.loc20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1239. // CHECK:STDOUT: %C.ref.loc20: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1240. // CHECK:STDOUT: }
  1241. // CHECK:STDOUT: %.loc20_30.3: ref %C = temporary %.loc20_30.1, %.loc20_30.2
  1242. // CHECK:STDOUT: %.loc20_30.4: %C = bind_value %.loc20_30.3
  1243. // CHECK:STDOUT: %bitwise_or: %C = bind_name bitwise_or, %.loc20_30.4
  1244. // CHECK:STDOUT: name_binding_decl {
  1245. // CHECK:STDOUT: %bitwise_xor.patt: %pattern_type.217 = binding_pattern bitwise_xor [concrete]
  1246. // CHECK:STDOUT: }
  1247. // CHECK:STDOUT: %c1.ref.loc21: ref %C = name_ref c1, %c1
  1248. // CHECK:STDOUT: %c2.ref.loc21: ref %C = name_ref c2, %c2
  1249. // CHECK:STDOUT: %.loc21_31.1: ref %C = temporary_storage
  1250. // CHECK:STDOUT: %.loc21_28.1: %C = bind_value %c1.ref.loc21
  1251. // CHECK:STDOUT: %.loc21_33.1: %C = bind_value %c2.ref.loc21
  1252. // CHECK:STDOUT: %.loc21_28.2: ref %C = value_as_ref %.loc21_28.1
  1253. // CHECK:STDOUT: %addr.loc21_31.1: %ptr.d9e = addr_of %.loc21_28.2
  1254. // CHECK:STDOUT: %.loc21_33.2: ref %C = value_as_ref %.loc21_33.1
  1255. // CHECK:STDOUT: %addr.loc21_31.2: %ptr.d9e = addr_of %.loc21_33.2
  1256. // CHECK:STDOUT: %addr.loc21_31.3: %ptr.d9e = addr_of %.loc21_31.1
  1257. // 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)
  1258. // CHECK:STDOUT: %.loc21_31.2: init %C = in_place_init %operator^__carbon_thunk.call, %.loc21_31.1
  1259. // CHECK:STDOUT: %.loc21_23: type = splice_block %C.ref.loc21 [concrete = constants.%C] {
  1260. // CHECK:STDOUT: %Cpp.ref.loc21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1261. // CHECK:STDOUT: %C.ref.loc21: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1262. // CHECK:STDOUT: }
  1263. // CHECK:STDOUT: %.loc21_31.3: ref %C = temporary %.loc21_31.1, %.loc21_31.2
  1264. // CHECK:STDOUT: %.loc21_31.4: %C = bind_value %.loc21_31.3
  1265. // CHECK:STDOUT: %bitwise_xor: %C = bind_name bitwise_xor, %.loc21_31.4
  1266. // CHECK:STDOUT: name_binding_decl {
  1267. // CHECK:STDOUT: %left_shift.patt: %pattern_type.217 = binding_pattern left_shift [concrete]
  1268. // CHECK:STDOUT: }
  1269. // CHECK:STDOUT: %c1.ref.loc22: ref %C = name_ref c1, %c1
  1270. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
  1271. // CHECK:STDOUT: %.loc22_30.1: ref %C = temporary_storage
  1272. // CHECK:STDOUT: %.loc22_27.1: %C = bind_value %c1.ref.loc22
  1273. // CHECK:STDOUT: %impl.elem0.loc22: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  1274. // 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]
  1275. // 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]
  1276. // CHECK:STDOUT: %bound_method.loc22_33.2: <bound method> = bound_method %int_3, %specific_fn.loc22 [concrete = constants.%bound_method.f36]
  1277. // 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]
  1278. // CHECK:STDOUT: %.loc22_33.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22 [concrete = constants.%int_3.822]
  1279. // CHECK:STDOUT: %.loc22_33.2: %i32 = converted %int_3, %.loc22_33.1 [concrete = constants.%int_3.822]
  1280. // CHECK:STDOUT: %.loc22_27.2: ref %C = value_as_ref %.loc22_27.1
  1281. // CHECK:STDOUT: %addr.loc22_30.1: %ptr.d9e = addr_of %.loc22_27.2
  1282. // CHECK:STDOUT: %addr.loc22_30.2: %ptr.d9e = addr_of %.loc22_30.1
  1283. // 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)
  1284. // CHECK:STDOUT: %.loc22_30.2: init %C = in_place_init %operator<<__carbon_thunk.call, %.loc22_30.1
  1285. // CHECK:STDOUT: %.loc22_22: type = splice_block %C.ref.loc22 [concrete = constants.%C] {
  1286. // CHECK:STDOUT: %Cpp.ref.loc22: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1287. // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1288. // CHECK:STDOUT: }
  1289. // CHECK:STDOUT: %.loc22_30.3: ref %C = temporary %.loc22_30.1, %.loc22_30.2
  1290. // CHECK:STDOUT: %.loc22_30.4: %C = bind_value %.loc22_30.3
  1291. // CHECK:STDOUT: %left_shift: %C = bind_name left_shift, %.loc22_30.4
  1292. // CHECK:STDOUT: name_binding_decl {
  1293. // CHECK:STDOUT: %right_shift.patt: %pattern_type.217 = binding_pattern right_shift [concrete]
  1294. // CHECK:STDOUT: }
  1295. // CHECK:STDOUT: %c1.ref.loc23: ref %C = name_ref c1, %c1
  1296. // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b]
  1297. // CHECK:STDOUT: %.loc23_31.1: ref %C = temporary_storage
  1298. // CHECK:STDOUT: %.loc23_28.1: %C = bind_value %c1.ref.loc23
  1299. // CHECK:STDOUT: %impl.elem0.loc23: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  1300. // 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]
  1301. // 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]
  1302. // CHECK:STDOUT: %bound_method.loc23_34.2: <bound method> = bound_method %int_5, %specific_fn.loc23 [concrete = constants.%bound_method.724]
  1303. // 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]
  1304. // CHECK:STDOUT: %.loc23_34.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23 [concrete = constants.%int_5.0f6]
  1305. // CHECK:STDOUT: %.loc23_34.2: %i32 = converted %int_5, %.loc23_34.1 [concrete = constants.%int_5.0f6]
  1306. // CHECK:STDOUT: %.loc23_28.2: ref %C = value_as_ref %.loc23_28.1
  1307. // CHECK:STDOUT: %addr.loc23_31.1: %ptr.d9e = addr_of %.loc23_28.2
  1308. // CHECK:STDOUT: %addr.loc23_31.2: %ptr.d9e = addr_of %.loc23_31.1
  1309. // 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)
  1310. // CHECK:STDOUT: %.loc23_31.2: init %C = in_place_init %operator>>__carbon_thunk.call, %.loc23_31.1
  1311. // CHECK:STDOUT: %.loc23_23: type = splice_block %C.ref.loc23 [concrete = constants.%C] {
  1312. // CHECK:STDOUT: %Cpp.ref.loc23: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1313. // CHECK:STDOUT: %C.ref.loc23: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1314. // CHECK:STDOUT: }
  1315. // CHECK:STDOUT: %.loc23_31.3: ref %C = temporary %.loc23_31.1, %.loc23_31.2
  1316. // CHECK:STDOUT: %.loc23_31.4: %C = bind_value %.loc23_31.3
  1317. // CHECK:STDOUT: %right_shift: %C = bind_name right_shift, %.loc23_31.4
  1318. // CHECK:STDOUT: %c1.ref.loc26: ref %C = name_ref c1, %c1
  1319. // CHECK:STDOUT: %c2.ref.loc26: ref %C = name_ref c2, %c2
  1320. // CHECK:STDOUT: %.loc26_6.1: ref %C = temporary_storage
  1321. // CHECK:STDOUT: %addr.loc26_3: %ptr.d9e = addr_of %c1.ref.loc26
  1322. // CHECK:STDOUT: %.loc26_9.1: %C = bind_value %c2.ref.loc26
  1323. // CHECK:STDOUT: %.loc26_9.2: ref %C = value_as_ref %.loc26_9.1
  1324. // CHECK:STDOUT: %addr.loc26_6.1: %ptr.d9e = addr_of %.loc26_9.2
  1325. // CHECK:STDOUT: %addr.loc26_6.2: %ptr.d9e = addr_of %.loc26_6.1
  1326. // 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)
  1327. // CHECK:STDOUT: %.loc26_6.2: init %C = in_place_init %operator+=__carbon_thunk.call, %.loc26_6.1
  1328. // CHECK:STDOUT: %.loc26_6.3: ref %C = temporary %.loc26_6.1, %.loc26_6.2
  1329. // CHECK:STDOUT: %c1.ref.loc27: ref %C = name_ref c1, %c1
  1330. // CHECK:STDOUT: %c2.ref.loc27: ref %C = name_ref c2, %c2
  1331. // CHECK:STDOUT: %.loc27_6.1: ref %C = temporary_storage
  1332. // CHECK:STDOUT: %addr.loc27_3: %ptr.d9e = addr_of %c1.ref.loc27
  1333. // CHECK:STDOUT: %.loc27_9.1: %C = bind_value %c2.ref.loc27
  1334. // CHECK:STDOUT: %.loc27_9.2: ref %C = value_as_ref %.loc27_9.1
  1335. // CHECK:STDOUT: %addr.loc27_6.1: %ptr.d9e = addr_of %.loc27_9.2
  1336. // CHECK:STDOUT: %addr.loc27_6.2: %ptr.d9e = addr_of %.loc27_6.1
  1337. // 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)
  1338. // CHECK:STDOUT: %.loc27_6.2: init %C = in_place_init %operator-=__carbon_thunk.call, %.loc27_6.1
  1339. // CHECK:STDOUT: %.loc27_6.3: ref %C = temporary %.loc27_6.1, %.loc27_6.2
  1340. // CHECK:STDOUT: %c1.ref.loc28: ref %C = name_ref c1, %c1
  1341. // CHECK:STDOUT: %c2.ref.loc28: ref %C = name_ref c2, %c2
  1342. // CHECK:STDOUT: %.loc28_6.1: ref %C = temporary_storage
  1343. // CHECK:STDOUT: %addr.loc28_3: %ptr.d9e = addr_of %c1.ref.loc28
  1344. // CHECK:STDOUT: %.loc28_9.1: %C = bind_value %c2.ref.loc28
  1345. // CHECK:STDOUT: %.loc28_9.2: ref %C = value_as_ref %.loc28_9.1
  1346. // CHECK:STDOUT: %addr.loc28_6.1: %ptr.d9e = addr_of %.loc28_9.2
  1347. // CHECK:STDOUT: %addr.loc28_6.2: %ptr.d9e = addr_of %.loc28_6.1
  1348. // 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)
  1349. // CHECK:STDOUT: %.loc28_6.2: init %C = in_place_init %operator*=__carbon_thunk.call, %.loc28_6.1
  1350. // CHECK:STDOUT: %.loc28_6.3: ref %C = temporary %.loc28_6.1, %.loc28_6.2
  1351. // CHECK:STDOUT: %c1.ref.loc29: ref %C = name_ref c1, %c1
  1352. // CHECK:STDOUT: %c2.ref.loc29: ref %C = name_ref c2, %c2
  1353. // CHECK:STDOUT: %.loc29_6.1: ref %C = temporary_storage
  1354. // CHECK:STDOUT: %addr.loc29_3: %ptr.d9e = addr_of %c1.ref.loc29
  1355. // CHECK:STDOUT: %.loc29_9.1: %C = bind_value %c2.ref.loc29
  1356. // CHECK:STDOUT: %.loc29_9.2: ref %C = value_as_ref %.loc29_9.1
  1357. // CHECK:STDOUT: %addr.loc29_6.1: %ptr.d9e = addr_of %.loc29_9.2
  1358. // CHECK:STDOUT: %addr.loc29_6.2: %ptr.d9e = addr_of %.loc29_6.1
  1359. // 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)
  1360. // CHECK:STDOUT: %.loc29_6.2: init %C = in_place_init %operator/=__carbon_thunk.call, %.loc29_6.1
  1361. // CHECK:STDOUT: %.loc29_6.3: ref %C = temporary %.loc29_6.1, %.loc29_6.2
  1362. // CHECK:STDOUT: %c1.ref.loc30: ref %C = name_ref c1, %c1
  1363. // CHECK:STDOUT: %c2.ref.loc30: ref %C = name_ref c2, %c2
  1364. // CHECK:STDOUT: %.loc30_6.1: ref %C = temporary_storage
  1365. // CHECK:STDOUT: %addr.loc30_3: %ptr.d9e = addr_of %c1.ref.loc30
  1366. // CHECK:STDOUT: %.loc30_9.1: %C = bind_value %c2.ref.loc30
  1367. // CHECK:STDOUT: %.loc30_9.2: ref %C = value_as_ref %.loc30_9.1
  1368. // CHECK:STDOUT: %addr.loc30_6.1: %ptr.d9e = addr_of %.loc30_9.2
  1369. // CHECK:STDOUT: %addr.loc30_6.2: %ptr.d9e = addr_of %.loc30_6.1
  1370. // 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)
  1371. // CHECK:STDOUT: %.loc30_6.2: init %C = in_place_init %operator%=__carbon_thunk.call, %.loc30_6.1
  1372. // CHECK:STDOUT: %.loc30_6.3: ref %C = temporary %.loc30_6.1, %.loc30_6.2
  1373. // CHECK:STDOUT: %c1.ref.loc33: ref %C = name_ref c1, %c1
  1374. // CHECK:STDOUT: %c2.ref.loc33: ref %C = name_ref c2, %c2
  1375. // CHECK:STDOUT: %.loc33_6.1: ref %C = temporary_storage
  1376. // CHECK:STDOUT: %addr.loc33_3: %ptr.d9e = addr_of %c1.ref.loc33
  1377. // CHECK:STDOUT: %.loc33_9.1: %C = bind_value %c2.ref.loc33
  1378. // CHECK:STDOUT: %.loc33_9.2: ref %C = value_as_ref %.loc33_9.1
  1379. // CHECK:STDOUT: %addr.loc33_6.1: %ptr.d9e = addr_of %.loc33_9.2
  1380. // CHECK:STDOUT: %addr.loc33_6.2: %ptr.d9e = addr_of %.loc33_6.1
  1381. // 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)
  1382. // CHECK:STDOUT: %.loc33_6.2: init %C = in_place_init %operator&=__carbon_thunk.call, %.loc33_6.1
  1383. // CHECK:STDOUT: %.loc33_6.3: ref %C = temporary %.loc33_6.1, %.loc33_6.2
  1384. // CHECK:STDOUT: %c1.ref.loc34: ref %C = name_ref c1, %c1
  1385. // CHECK:STDOUT: %c2.ref.loc34: ref %C = name_ref c2, %c2
  1386. // CHECK:STDOUT: %.loc34_6.1: ref %C = temporary_storage
  1387. // CHECK:STDOUT: %addr.loc34_3: %ptr.d9e = addr_of %c1.ref.loc34
  1388. // CHECK:STDOUT: %.loc34_9.1: %C = bind_value %c2.ref.loc34
  1389. // CHECK:STDOUT: %.loc34_9.2: ref %C = value_as_ref %.loc34_9.1
  1390. // CHECK:STDOUT: %addr.loc34_6.1: %ptr.d9e = addr_of %.loc34_9.2
  1391. // CHECK:STDOUT: %addr.loc34_6.2: %ptr.d9e = addr_of %.loc34_6.1
  1392. // 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)
  1393. // CHECK:STDOUT: %.loc34_6.2: init %C = in_place_init %operator|=__carbon_thunk.call, %.loc34_6.1
  1394. // CHECK:STDOUT: %.loc34_6.3: ref %C = temporary %.loc34_6.1, %.loc34_6.2
  1395. // CHECK:STDOUT: %c1.ref.loc35: ref %C = name_ref c1, %c1
  1396. // CHECK:STDOUT: %c2.ref.loc35: ref %C = name_ref c2, %c2
  1397. // CHECK:STDOUT: %.loc35_6.1: ref %C = temporary_storage
  1398. // CHECK:STDOUT: %addr.loc35_3: %ptr.d9e = addr_of %c1.ref.loc35
  1399. // CHECK:STDOUT: %.loc35_9.1: %C = bind_value %c2.ref.loc35
  1400. // CHECK:STDOUT: %.loc35_9.2: ref %C = value_as_ref %.loc35_9.1
  1401. // CHECK:STDOUT: %addr.loc35_6.1: %ptr.d9e = addr_of %.loc35_9.2
  1402. // CHECK:STDOUT: %addr.loc35_6.2: %ptr.d9e = addr_of %.loc35_6.1
  1403. // 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)
  1404. // CHECK:STDOUT: %.loc35_6.2: init %C = in_place_init %operator^=__carbon_thunk.call, %.loc35_6.1
  1405. // CHECK:STDOUT: %.loc35_6.3: ref %C = temporary %.loc35_6.1, %.loc35_6.2
  1406. // CHECK:STDOUT: name_binding_decl {
  1407. // CHECK:STDOUT: %equal.patt: %pattern_type.831 = binding_pattern equal [concrete]
  1408. // CHECK:STDOUT: }
  1409. // CHECK:STDOUT: %c1.ref.loc38: ref %C = name_ref c1, %c1
  1410. // CHECK:STDOUT: %c2.ref.loc38: ref %C = name_ref c2, %c2
  1411. // CHECK:STDOUT: %.loc38_21.1: %C = bind_value %c1.ref.loc38
  1412. // CHECK:STDOUT: %.loc38_27.1: %C = bind_value %c2.ref.loc38
  1413. // CHECK:STDOUT: %.loc38_21.2: ref %C = value_as_ref %.loc38_21.1
  1414. // CHECK:STDOUT: %addr.loc38_24.1: %ptr.d9e = addr_of %.loc38_21.2
  1415. // CHECK:STDOUT: %.loc38_27.2: ref %C = value_as_ref %.loc38_27.1
  1416. // CHECK:STDOUT: %addr.loc38_24.2: %ptr.d9e = addr_of %.loc38_27.2
  1417. // CHECK:STDOUT: %.loc38_24.1: ref bool = temporary_storage
  1418. // CHECK:STDOUT: %addr.loc38_24.3: %ptr.bb2 = addr_of %.loc38_24.1
  1419. // 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)
  1420. // CHECK:STDOUT: %.loc38_24.2: init bool = in_place_init %operator==__carbon_thunk.call, %.loc38_24.1
  1421. // CHECK:STDOUT: %.loc38_14.1: type = splice_block %.loc38_14.3 [concrete = bool] {
  1422. // CHECK:STDOUT: %Bool.call.loc38: init type = call constants.%Bool() [concrete = bool]
  1423. // CHECK:STDOUT: %.loc38_14.2: type = value_of_initializer %Bool.call.loc38 [concrete = bool]
  1424. // CHECK:STDOUT: %.loc38_14.3: type = converted %Bool.call.loc38, %.loc38_14.2 [concrete = bool]
  1425. // CHECK:STDOUT: }
  1426. // CHECK:STDOUT: %.loc38_24.3: bool = value_of_initializer %.loc38_24.2
  1427. // CHECK:STDOUT: %.loc38_24.4: bool = converted %.loc38_24.2, %.loc38_24.3
  1428. // CHECK:STDOUT: %equal: bool = bind_name equal, %.loc38_24.4
  1429. // CHECK:STDOUT: name_binding_decl {
  1430. // CHECK:STDOUT: %not_equal.patt: %pattern_type.831 = binding_pattern not_equal [concrete]
  1431. // CHECK:STDOUT: }
  1432. // CHECK:STDOUT: %c1.ref.loc39: ref %C = name_ref c1, %c1
  1433. // CHECK:STDOUT: %c2.ref.loc39: ref %C = name_ref c2, %c2
  1434. // CHECK:STDOUT: %.loc39_25.1: %C = bind_value %c1.ref.loc39
  1435. // CHECK:STDOUT: %.loc39_31.1: %C = bind_value %c2.ref.loc39
  1436. // CHECK:STDOUT: %.loc39_25.2: ref %C = value_as_ref %.loc39_25.1
  1437. // CHECK:STDOUT: %addr.loc39_28.1: %ptr.d9e = addr_of %.loc39_25.2
  1438. // CHECK:STDOUT: %.loc39_31.2: ref %C = value_as_ref %.loc39_31.1
  1439. // CHECK:STDOUT: %addr.loc39_28.2: %ptr.d9e = addr_of %.loc39_31.2
  1440. // CHECK:STDOUT: %.loc39_28.1: ref bool = temporary_storage
  1441. // CHECK:STDOUT: %addr.loc39_28.3: %ptr.bb2 = addr_of %.loc39_28.1
  1442. // 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)
  1443. // CHECK:STDOUT: %.loc39_28.2: init bool = in_place_init %operator!=__carbon_thunk.call, %.loc39_28.1
  1444. // CHECK:STDOUT: %.loc39_18.1: type = splice_block %.loc39_18.3 [concrete = bool] {
  1445. // CHECK:STDOUT: %Bool.call.loc39: init type = call constants.%Bool() [concrete = bool]
  1446. // CHECK:STDOUT: %.loc39_18.2: type = value_of_initializer %Bool.call.loc39 [concrete = bool]
  1447. // CHECK:STDOUT: %.loc39_18.3: type = converted %Bool.call.loc39, %.loc39_18.2 [concrete = bool]
  1448. // CHECK:STDOUT: }
  1449. // CHECK:STDOUT: %.loc39_28.3: bool = value_of_initializer %.loc39_28.2
  1450. // CHECK:STDOUT: %.loc39_28.4: bool = converted %.loc39_28.2, %.loc39_28.3
  1451. // CHECK:STDOUT: %not_equal: bool = bind_name not_equal, %.loc39_28.4
  1452. // CHECK:STDOUT: name_binding_decl {
  1453. // CHECK:STDOUT: %greater_than.patt: %pattern_type.831 = binding_pattern greater_than [concrete]
  1454. // CHECK:STDOUT: }
  1455. // CHECK:STDOUT: %c1.ref.loc40: ref %C = name_ref c1, %c1
  1456. // CHECK:STDOUT: %c2.ref.loc40: ref %C = name_ref c2, %c2
  1457. // CHECK:STDOUT: %.loc40_28.1: %C = bind_value %c1.ref.loc40
  1458. // CHECK:STDOUT: %.loc40_33.1: %C = bind_value %c2.ref.loc40
  1459. // CHECK:STDOUT: %.loc40_28.2: ref %C = value_as_ref %.loc40_28.1
  1460. // CHECK:STDOUT: %addr.loc40_31.1: %ptr.d9e = addr_of %.loc40_28.2
  1461. // CHECK:STDOUT: %.loc40_33.2: ref %C = value_as_ref %.loc40_33.1
  1462. // CHECK:STDOUT: %addr.loc40_31.2: %ptr.d9e = addr_of %.loc40_33.2
  1463. // CHECK:STDOUT: %.loc40_31.1: ref bool = temporary_storage
  1464. // CHECK:STDOUT: %addr.loc40_31.3: %ptr.bb2 = addr_of %.loc40_31.1
  1465. // 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)
  1466. // CHECK:STDOUT: %.loc40_31.2: init bool = in_place_init %operator>__carbon_thunk.call, %.loc40_31.1
  1467. // CHECK:STDOUT: %.loc40_21.1: type = splice_block %.loc40_21.3 [concrete = bool] {
  1468. // CHECK:STDOUT: %Bool.call.loc40: init type = call constants.%Bool() [concrete = bool]
  1469. // CHECK:STDOUT: %.loc40_21.2: type = value_of_initializer %Bool.call.loc40 [concrete = bool]
  1470. // CHECK:STDOUT: %.loc40_21.3: type = converted %Bool.call.loc40, %.loc40_21.2 [concrete = bool]
  1471. // CHECK:STDOUT: }
  1472. // CHECK:STDOUT: %.loc40_31.3: bool = value_of_initializer %.loc40_31.2
  1473. // CHECK:STDOUT: %.loc40_31.4: bool = converted %.loc40_31.2, %.loc40_31.3
  1474. // CHECK:STDOUT: %greater_than: bool = bind_name greater_than, %.loc40_31.4
  1475. // CHECK:STDOUT: name_binding_decl {
  1476. // CHECK:STDOUT: %less_than.patt: %pattern_type.831 = binding_pattern less_than [concrete]
  1477. // CHECK:STDOUT: }
  1478. // CHECK:STDOUT: %c1.ref.loc41: ref %C = name_ref c1, %c1
  1479. // CHECK:STDOUT: %c2.ref.loc41: ref %C = name_ref c2, %c2
  1480. // CHECK:STDOUT: %.loc41_25.1: %C = bind_value %c1.ref.loc41
  1481. // CHECK:STDOUT: %.loc41_30.1: %C = bind_value %c2.ref.loc41
  1482. // CHECK:STDOUT: %.loc41_25.2: ref %C = value_as_ref %.loc41_25.1
  1483. // CHECK:STDOUT: %addr.loc41_28.1: %ptr.d9e = addr_of %.loc41_25.2
  1484. // CHECK:STDOUT: %.loc41_30.2: ref %C = value_as_ref %.loc41_30.1
  1485. // CHECK:STDOUT: %addr.loc41_28.2: %ptr.d9e = addr_of %.loc41_30.2
  1486. // CHECK:STDOUT: %.loc41_28.1: ref bool = temporary_storage
  1487. // CHECK:STDOUT: %addr.loc41_28.3: %ptr.bb2 = addr_of %.loc41_28.1
  1488. // 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)
  1489. // CHECK:STDOUT: %.loc41_28.2: init bool = in_place_init %operator<__carbon_thunk.call, %.loc41_28.1
  1490. // CHECK:STDOUT: %.loc41_18.1: type = splice_block %.loc41_18.3 [concrete = bool] {
  1491. // CHECK:STDOUT: %Bool.call.loc41: init type = call constants.%Bool() [concrete = bool]
  1492. // CHECK:STDOUT: %.loc41_18.2: type = value_of_initializer %Bool.call.loc41 [concrete = bool]
  1493. // CHECK:STDOUT: %.loc41_18.3: type = converted %Bool.call.loc41, %.loc41_18.2 [concrete = bool]
  1494. // CHECK:STDOUT: }
  1495. // CHECK:STDOUT: %.loc41_28.3: bool = value_of_initializer %.loc41_28.2
  1496. // CHECK:STDOUT: %.loc41_28.4: bool = converted %.loc41_28.2, %.loc41_28.3
  1497. // CHECK:STDOUT: %less_than: bool = bind_name less_than, %.loc41_28.4
  1498. // CHECK:STDOUT: name_binding_decl {
  1499. // CHECK:STDOUT: %greater_than_or_equal.patt: %pattern_type.831 = binding_pattern greater_than_or_equal [concrete]
  1500. // CHECK:STDOUT: }
  1501. // CHECK:STDOUT: %c1.ref.loc42: ref %C = name_ref c1, %c1
  1502. // CHECK:STDOUT: %c2.ref.loc42: ref %C = name_ref c2, %c2
  1503. // CHECK:STDOUT: %.loc42_37.1: %C = bind_value %c1.ref.loc42
  1504. // CHECK:STDOUT: %.loc42_43.1: %C = bind_value %c2.ref.loc42
  1505. // CHECK:STDOUT: %.loc42_37.2: ref %C = value_as_ref %.loc42_37.1
  1506. // CHECK:STDOUT: %addr.loc42_40.1: %ptr.d9e = addr_of %.loc42_37.2
  1507. // CHECK:STDOUT: %.loc42_43.2: ref %C = value_as_ref %.loc42_43.1
  1508. // CHECK:STDOUT: %addr.loc42_40.2: %ptr.d9e = addr_of %.loc42_43.2
  1509. // CHECK:STDOUT: %.loc42_40.1: ref bool = temporary_storage
  1510. // CHECK:STDOUT: %addr.loc42_40.3: %ptr.bb2 = addr_of %.loc42_40.1
  1511. // 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)
  1512. // CHECK:STDOUT: %.loc42_40.2: init bool = in_place_init %operator>=__carbon_thunk.call, %.loc42_40.1
  1513. // CHECK:STDOUT: %.loc42_30.1: type = splice_block %.loc42_30.3 [concrete = bool] {
  1514. // CHECK:STDOUT: %Bool.call.loc42: init type = call constants.%Bool() [concrete = bool]
  1515. // CHECK:STDOUT: %.loc42_30.2: type = value_of_initializer %Bool.call.loc42 [concrete = bool]
  1516. // CHECK:STDOUT: %.loc42_30.3: type = converted %Bool.call.loc42, %.loc42_30.2 [concrete = bool]
  1517. // CHECK:STDOUT: }
  1518. // CHECK:STDOUT: %.loc42_40.3: bool = value_of_initializer %.loc42_40.2
  1519. // CHECK:STDOUT: %.loc42_40.4: bool = converted %.loc42_40.2, %.loc42_40.3
  1520. // CHECK:STDOUT: %greater_than_or_equal: bool = bind_name greater_than_or_equal, %.loc42_40.4
  1521. // CHECK:STDOUT: name_binding_decl {
  1522. // CHECK:STDOUT: %less_than_or_equal.patt: %pattern_type.831 = binding_pattern less_than_or_equal [concrete]
  1523. // CHECK:STDOUT: }
  1524. // CHECK:STDOUT: %c1.ref.loc43: ref %C = name_ref c1, %c1
  1525. // CHECK:STDOUT: %c2.ref.loc43: ref %C = name_ref c2, %c2
  1526. // CHECK:STDOUT: %.loc43_34.1: %C = bind_value %c1.ref.loc43
  1527. // CHECK:STDOUT: %.loc43_40.1: %C = bind_value %c2.ref.loc43
  1528. // CHECK:STDOUT: %.loc43_34.2: ref %C = value_as_ref %.loc43_34.1
  1529. // CHECK:STDOUT: %addr.loc43_37.1: %ptr.d9e = addr_of %.loc43_34.2
  1530. // CHECK:STDOUT: %.loc43_40.2: ref %C = value_as_ref %.loc43_40.1
  1531. // CHECK:STDOUT: %addr.loc43_37.2: %ptr.d9e = addr_of %.loc43_40.2
  1532. // CHECK:STDOUT: %.loc43_37.1: ref bool = temporary_storage
  1533. // CHECK:STDOUT: %addr.loc43_37.3: %ptr.bb2 = addr_of %.loc43_37.1
  1534. // 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)
  1535. // CHECK:STDOUT: %.loc43_37.2: init bool = in_place_init %operator<=__carbon_thunk.call, %.loc43_37.1
  1536. // CHECK:STDOUT: %.loc43_27.1: type = splice_block %.loc43_27.3 [concrete = bool] {
  1537. // CHECK:STDOUT: %Bool.call.loc43: init type = call constants.%Bool() [concrete = bool]
  1538. // CHECK:STDOUT: %.loc43_27.2: type = value_of_initializer %Bool.call.loc43 [concrete = bool]
  1539. // CHECK:STDOUT: %.loc43_27.3: type = converted %Bool.call.loc43, %.loc43_27.2 [concrete = bool]
  1540. // CHECK:STDOUT: }
  1541. // CHECK:STDOUT: %.loc43_37.3: bool = value_of_initializer %.loc43_37.2
  1542. // CHECK:STDOUT: %.loc43_37.4: bool = converted %.loc43_37.2, %.loc43_37.3
  1543. // CHECK:STDOUT: %less_than_or_equal: bool = bind_name less_than_or_equal, %.loc43_37.4
  1544. // CHECK:STDOUT: %facet_value.loc35: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1545. // CHECK:STDOUT: %.loc35_6.4: %type_where = converted constants.%C, %facet_value.loc35 [concrete = constants.%facet_value]
  1546. // 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
  1547. // CHECK:STDOUT: <elided>
  1548. // CHECK:STDOUT: %bound_method.loc35: <bound method> = bound_method %.loc35_6.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.1
  1549. // CHECK:STDOUT: %addr.loc35_6.3: %ptr.d9e = addr_of %.loc35_6.3
  1550. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc35: init %empty_tuple.type = call %bound_method.loc35(%addr.loc35_6.3)
  1551. // CHECK:STDOUT: %facet_value.loc34: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1552. // CHECK:STDOUT: %.loc34_6.4: %type_where = converted constants.%C, %facet_value.loc34 [concrete = constants.%facet_value]
  1553. // 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
  1554. // CHECK:STDOUT: <elided>
  1555. // CHECK:STDOUT: %bound_method.loc34: <bound method> = bound_method %.loc34_6.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.2
  1556. // CHECK:STDOUT: %addr.loc34_6.3: %ptr.d9e = addr_of %.loc34_6.3
  1557. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc34: init %empty_tuple.type = call %bound_method.loc34(%addr.loc34_6.3)
  1558. // CHECK:STDOUT: %facet_value.loc33: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1559. // CHECK:STDOUT: %.loc33_6.4: %type_where = converted constants.%C, %facet_value.loc33 [concrete = constants.%facet_value]
  1560. // 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
  1561. // CHECK:STDOUT: <elided>
  1562. // CHECK:STDOUT: %bound_method.loc33: <bound method> = bound_method %.loc33_6.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.3
  1563. // CHECK:STDOUT: %addr.loc33_6.3: %ptr.d9e = addr_of %.loc33_6.3
  1564. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc33: init %empty_tuple.type = call %bound_method.loc33(%addr.loc33_6.3)
  1565. // CHECK:STDOUT: %facet_value.loc30: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1566. // CHECK:STDOUT: %.loc30_6.4: %type_where = converted constants.%C, %facet_value.loc30 [concrete = constants.%facet_value]
  1567. // 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
  1568. // CHECK:STDOUT: <elided>
  1569. // CHECK:STDOUT: %bound_method.loc30: <bound method> = bound_method %.loc30_6.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.4
  1570. // CHECK:STDOUT: %addr.loc30_6.3: %ptr.d9e = addr_of %.loc30_6.3
  1571. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc30: init %empty_tuple.type = call %bound_method.loc30(%addr.loc30_6.3)
  1572. // CHECK:STDOUT: %facet_value.loc29: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1573. // CHECK:STDOUT: %.loc29_6.4: %type_where = converted constants.%C, %facet_value.loc29 [concrete = constants.%facet_value]
  1574. // 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
  1575. // CHECK:STDOUT: <elided>
  1576. // CHECK:STDOUT: %bound_method.loc29: <bound method> = bound_method %.loc29_6.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.5
  1577. // CHECK:STDOUT: %addr.loc29_6.3: %ptr.d9e = addr_of %.loc29_6.3
  1578. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc29: init %empty_tuple.type = call %bound_method.loc29(%addr.loc29_6.3)
  1579. // CHECK:STDOUT: %facet_value.loc28: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1580. // CHECK:STDOUT: %.loc28_6.4: %type_where = converted constants.%C, %facet_value.loc28 [concrete = constants.%facet_value]
  1581. // 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
  1582. // CHECK:STDOUT: <elided>
  1583. // CHECK:STDOUT: %bound_method.loc28: <bound method> = bound_method %.loc28_6.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.6
  1584. // CHECK:STDOUT: %addr.loc28_6.3: %ptr.d9e = addr_of %.loc28_6.3
  1585. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc28: init %empty_tuple.type = call %bound_method.loc28(%addr.loc28_6.3)
  1586. // CHECK:STDOUT: %facet_value.loc27: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1587. // CHECK:STDOUT: %.loc27_6.4: %type_where = converted constants.%C, %facet_value.loc27 [concrete = constants.%facet_value]
  1588. // 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
  1589. // CHECK:STDOUT: <elided>
  1590. // CHECK:STDOUT: %bound_method.loc27: <bound method> = bound_method %.loc27_6.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.7
  1591. // CHECK:STDOUT: %addr.loc27_6.3: %ptr.d9e = addr_of %.loc27_6.3
  1592. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc27: init %empty_tuple.type = call %bound_method.loc27(%addr.loc27_6.3)
  1593. // CHECK:STDOUT: %facet_value.loc26: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1594. // CHECK:STDOUT: %.loc26_6.4: %type_where = converted constants.%C, %facet_value.loc26 [concrete = constants.%facet_value]
  1595. // 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
  1596. // CHECK:STDOUT: <elided>
  1597. // CHECK:STDOUT: %bound_method.loc26: <bound method> = bound_method %.loc26_6.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.8
  1598. // CHECK:STDOUT: %addr.loc26_6.3: %ptr.d9e = addr_of %.loc26_6.3
  1599. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc26: init %empty_tuple.type = call %bound_method.loc26(%addr.loc26_6.3)
  1600. // CHECK:STDOUT: %facet_value.loc23: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1601. // CHECK:STDOUT: %.loc23_31.5: %type_where = converted constants.%C, %facet_value.loc23 [concrete = constants.%facet_value]
  1602. // 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
  1603. // CHECK:STDOUT: <elided>
  1604. // CHECK:STDOUT: %bound_method.loc23_31: <bound method> = bound_method %.loc23_31.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.9
  1605. // CHECK:STDOUT: %addr.loc23_31.3: %ptr.d9e = addr_of %.loc23_31.3
  1606. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc23: init %empty_tuple.type = call %bound_method.loc23_31(%addr.loc23_31.3)
  1607. // CHECK:STDOUT: %facet_value.loc22: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1608. // CHECK:STDOUT: %.loc22_30.5: %type_where = converted constants.%C, %facet_value.loc22 [concrete = constants.%facet_value]
  1609. // 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
  1610. // CHECK:STDOUT: <elided>
  1611. // CHECK:STDOUT: %bound_method.loc22_30: <bound method> = bound_method %.loc22_30.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.10
  1612. // CHECK:STDOUT: %addr.loc22_30.3: %ptr.d9e = addr_of %.loc22_30.3
  1613. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc22: init %empty_tuple.type = call %bound_method.loc22_30(%addr.loc22_30.3)
  1614. // CHECK:STDOUT: %facet_value.loc21: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1615. // CHECK:STDOUT: %.loc21_31.5: %type_where = converted constants.%C, %facet_value.loc21 [concrete = constants.%facet_value]
  1616. // 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
  1617. // CHECK:STDOUT: <elided>
  1618. // CHECK:STDOUT: %bound_method.loc21: <bound method> = bound_method %.loc21_31.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.11
  1619. // CHECK:STDOUT: %addr.loc21_31.4: %ptr.d9e = addr_of %.loc21_31.3
  1620. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc21: init %empty_tuple.type = call %bound_method.loc21(%addr.loc21_31.4)
  1621. // CHECK:STDOUT: %facet_value.loc20: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1622. // CHECK:STDOUT: %.loc20_30.5: %type_where = converted constants.%C, %facet_value.loc20 [concrete = constants.%facet_value]
  1623. // 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
  1624. // CHECK:STDOUT: <elided>
  1625. // CHECK:STDOUT: %bound_method.loc20: <bound method> = bound_method %.loc20_30.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.12
  1626. // CHECK:STDOUT: %addr.loc20_30.4: %ptr.d9e = addr_of %.loc20_30.3
  1627. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc20: init %empty_tuple.type = call %bound_method.loc20(%addr.loc20_30.4)
  1628. // CHECK:STDOUT: %facet_value.loc19: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1629. // CHECK:STDOUT: %.loc19_31.5: %type_where = converted constants.%C, %facet_value.loc19 [concrete = constants.%facet_value]
  1630. // 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
  1631. // CHECK:STDOUT: <elided>
  1632. // CHECK:STDOUT: %bound_method.loc19: <bound method> = bound_method %.loc19_31.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.13
  1633. // CHECK:STDOUT: %addr.loc19_31.4: %ptr.d9e = addr_of %.loc19_31.3
  1634. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc19: init %empty_tuple.type = call %bound_method.loc19(%addr.loc19_31.4)
  1635. // CHECK:STDOUT: %facet_value.loc16: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1636. // CHECK:STDOUT: %.loc16_26.5: %type_where = converted constants.%C, %facet_value.loc16 [concrete = constants.%facet_value]
  1637. // 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
  1638. // CHECK:STDOUT: <elided>
  1639. // CHECK:STDOUT: %bound_method.loc16: <bound method> = bound_method %.loc16_26.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.14
  1640. // CHECK:STDOUT: %addr.loc16_26.4: %ptr.d9e = addr_of %.loc16_26.3
  1641. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc16: init %empty_tuple.type = call %bound_method.loc16(%addr.loc16_26.4)
  1642. // CHECK:STDOUT: %facet_value.loc15: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1643. // CHECK:STDOUT: %.loc15_28.5: %type_where = converted constants.%C, %facet_value.loc15 [concrete = constants.%facet_value]
  1644. // 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
  1645. // CHECK:STDOUT: <elided>
  1646. // CHECK:STDOUT: %bound_method.loc15: <bound method> = bound_method %.loc15_28.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.15
  1647. // CHECK:STDOUT: %addr.loc15_28.4: %ptr.d9e = addr_of %.loc15_28.3
  1648. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc15: init %empty_tuple.type = call %bound_method.loc15(%addr.loc15_28.4)
  1649. // CHECK:STDOUT: %facet_value.loc14: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1650. // CHECK:STDOUT: %.loc14_34.5: %type_where = converted constants.%C, %facet_value.loc14 [concrete = constants.%facet_value]
  1651. // 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
  1652. // CHECK:STDOUT: <elided>
  1653. // CHECK:STDOUT: %bound_method.loc14: <bound method> = bound_method %.loc14_34.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.16
  1654. // CHECK:STDOUT: %addr.loc14_34.4: %ptr.d9e = addr_of %.loc14_34.3
  1655. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc14: init %empty_tuple.type = call %bound_method.loc14(%addr.loc14_34.4)
  1656. // CHECK:STDOUT: %facet_value.loc13: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1657. // CHECK:STDOUT: %.loc13_31.5: %type_where = converted constants.%C, %facet_value.loc13 [concrete = constants.%facet_value]
  1658. // 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
  1659. // CHECK:STDOUT: <elided>
  1660. // CHECK:STDOUT: %bound_method.loc13: <bound method> = bound_method %.loc13_31.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.17
  1661. // CHECK:STDOUT: %addr.loc13_31.4: %ptr.d9e = addr_of %.loc13_31.3
  1662. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc13: init %empty_tuple.type = call %bound_method.loc13(%addr.loc13_31.4)
  1663. // CHECK:STDOUT: %facet_value.loc12: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1664. // CHECK:STDOUT: %.loc12_28.5: %type_where = converted constants.%C, %facet_value.loc12 [concrete = constants.%facet_value]
  1665. // 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
  1666. // CHECK:STDOUT: <elided>
  1667. // CHECK:STDOUT: %bound_method.loc12: <bound method> = bound_method %.loc12_28.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.18
  1668. // CHECK:STDOUT: %addr.loc12_28.4: %ptr.d9e = addr_of %.loc12_28.3
  1669. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc12: init %empty_tuple.type = call %bound_method.loc12(%addr.loc12_28.4)
  1670. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1671. // CHECK:STDOUT: %.loc9_3.2: %type_where = converted constants.%C, %facet_value.loc9 [concrete = constants.%facet_value]
  1672. // 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
  1673. // CHECK:STDOUT: <elided>
  1674. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %c2.var, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.19
  1675. // CHECK:STDOUT: %addr.loc9_3: %ptr.d9e = addr_of %c2.var
  1676. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9_3)
  1677. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1678. // CHECK:STDOUT: %.loc8_3.2: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  1679. // 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
  1680. // CHECK:STDOUT: <elided>
  1681. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %c1.var, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.20
  1682. // CHECK:STDOUT: %addr.loc8_3: %ptr.d9e = addr_of %c1.var
  1683. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_3)
  1684. // CHECK:STDOUT: <elided>
  1685. // CHECK:STDOUT: }
  1686. // CHECK:STDOUT:
  1687. // CHECK:STDOUT: --- multiple_calls.carbon
  1688. // CHECK:STDOUT:
  1689. // CHECK:STDOUT: constants {
  1690. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1691. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1692. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  1693. // CHECK:STDOUT: %.d40: type = cpp_overload_set_type @operator+__carbon_thunk [concrete]
  1694. // CHECK:STDOUT: %empty_struct.e73: %.d40 = struct_value () [concrete]
  1695. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  1696. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  1697. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  1698. // CHECK:STDOUT: %operator+__carbon_thunk.type: type = fn_type @operator+__carbon_thunk [concrete]
  1699. // CHECK:STDOUT: %operator+__carbon_thunk: %operator+__carbon_thunk.type = struct_value () [concrete]
  1700. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
  1701. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  1702. // 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]
  1703. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.6b9: %AggregateT.as_type.as.Destroy.impl.Op.type.fc1 = struct_value () [concrete]
  1704. // CHECK:STDOUT: }
  1705. // CHECK:STDOUT:
  1706. // CHECK:STDOUT: imports {
  1707. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  1708. // CHECK:STDOUT: .C = %C.decl
  1709. // CHECK:STDOUT: import Cpp//...
  1710. // CHECK:STDOUT: }
  1711. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1712. // CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @operator+__carbon_thunk [concrete = constants.%empty_struct.e73]
  1713. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  1714. // CHECK:STDOUT: <elided>
  1715. // CHECK:STDOUT: } {
  1716. // CHECK:STDOUT: <elided>
  1717. // CHECK:STDOUT: }
  1718. // CHECK:STDOUT: %operator+__carbon_thunk.decl: %operator+__carbon_thunk.type = fn_decl @operator+__carbon_thunk [concrete = constants.%operator+__carbon_thunk] {
  1719. // CHECK:STDOUT: <elided>
  1720. // CHECK:STDOUT: } {
  1721. // CHECK:STDOUT: <elided>
  1722. // CHECK:STDOUT: }
  1723. // CHECK:STDOUT: }
  1724. // CHECK:STDOUT:
  1725. // CHECK:STDOUT: fn @F() {
  1726. // CHECK:STDOUT: !entry:
  1727. // CHECK:STDOUT: name_binding_decl {
  1728. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = binding_pattern c1 [concrete]
  1729. // CHECK:STDOUT: }
  1730. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1731. // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1732. // CHECK:STDOUT: %C.ref.loc8_24: %.d40 = name_ref C, imports.%.40b [concrete = constants.%empty_struct.e73]
  1733. // CHECK:STDOUT: %.loc8_27.1: ref %C = temporary_storage
  1734. // CHECK:STDOUT: %addr.loc8_27.1: %ptr.d9e = addr_of %.loc8_27.1
  1735. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_27.1)
  1736. // CHECK:STDOUT: %.loc8_27.2: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_27.1
  1737. // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] {
  1738. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1739. // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1740. // CHECK:STDOUT: }
  1741. // CHECK:STDOUT: %.loc8_27.3: ref %C = temporary %.loc8_27.1, %.loc8_27.2
  1742. // CHECK:STDOUT: %.loc8_27.4: %C = bind_value %.loc8_27.3
  1743. // CHECK:STDOUT: %c1: %C = bind_name c1, %.loc8_27.4
  1744. // CHECK:STDOUT: name_binding_decl {
  1745. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = binding_pattern c2 [concrete]
  1746. // CHECK:STDOUT: }
  1747. // CHECK:STDOUT: %Cpp.ref.loc9_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1748. // CHECK:STDOUT: %C.ref.loc9_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1749. // CHECK:STDOUT: %C.ref.loc9_24: %.d40 = name_ref C, imports.%.40b [concrete = constants.%empty_struct.e73]
  1750. // CHECK:STDOUT: %.loc9_27.1: ref %C = temporary_storage
  1751. // CHECK:STDOUT: %addr.loc9_27.1: %ptr.d9e = addr_of %.loc9_27.1
  1752. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc9_27.1)
  1753. // CHECK:STDOUT: %.loc9_27.2: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_27.1
  1754. // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] {
  1755. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1756. // CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1757. // CHECK:STDOUT: }
  1758. // CHECK:STDOUT: %.loc9_27.3: ref %C = temporary %.loc9_27.1, %.loc9_27.2
  1759. // CHECK:STDOUT: %.loc9_27.4: %C = bind_value %.loc9_27.3
  1760. // CHECK:STDOUT: %c2: %C = bind_name c2, %.loc9_27.4
  1761. // CHECK:STDOUT: name_binding_decl {
  1762. // CHECK:STDOUT: %c3.patt: %pattern_type.217 = binding_pattern c3 [concrete]
  1763. // CHECK:STDOUT: }
  1764. // CHECK:STDOUT: %c1.ref.loc10: %C = name_ref c1, %c1
  1765. // CHECK:STDOUT: %c2.ref: %C = name_ref c2, %c2
  1766. // CHECK:STDOUT: %.loc10_22.1: ref %C = temporary_storage
  1767. // CHECK:STDOUT: %.loc10_19: ref %C = value_as_ref %c1.ref.loc10
  1768. // CHECK:STDOUT: %addr.loc10_22.1: %ptr.d9e = addr_of %.loc10_19
  1769. // CHECK:STDOUT: %.loc10_24: ref %C = value_as_ref %c2.ref
  1770. // CHECK:STDOUT: %addr.loc10_22.2: %ptr.d9e = addr_of %.loc10_24
  1771. // CHECK:STDOUT: %addr.loc10_22.3: %ptr.d9e = addr_of %.loc10_22.1
  1772. // 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)
  1773. // CHECK:STDOUT: %.loc10_22.2: init %C = in_place_init %operator+__carbon_thunk.call.loc10, %.loc10_22.1
  1774. // CHECK:STDOUT: %.loc10_14: type = splice_block %C.ref.loc10 [concrete = constants.%C] {
  1775. // CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1776. // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1777. // CHECK:STDOUT: }
  1778. // CHECK:STDOUT: %.loc10_22.3: ref %C = temporary %.loc10_22.1, %.loc10_22.2
  1779. // CHECK:STDOUT: %.loc10_22.4: %C = bind_value %.loc10_22.3
  1780. // CHECK:STDOUT: %c3: %C = bind_name c3, %.loc10_22.4
  1781. // CHECK:STDOUT: name_binding_decl {
  1782. // CHECK:STDOUT: %c4.patt: %pattern_type.217 = binding_pattern c4 [concrete]
  1783. // CHECK:STDOUT: }
  1784. // CHECK:STDOUT: %c1.ref.loc11: %C = name_ref c1, %c1
  1785. // CHECK:STDOUT: %c3.ref.loc11: %C = name_ref c3, %c3
  1786. // CHECK:STDOUT: %.loc11_22.1: ref %C = temporary_storage
  1787. // CHECK:STDOUT: %.loc11_19: ref %C = value_as_ref %c1.ref.loc11
  1788. // CHECK:STDOUT: %addr.loc11_22.1: %ptr.d9e = addr_of %.loc11_19
  1789. // CHECK:STDOUT: %.loc11_24: ref %C = value_as_ref %c3.ref.loc11
  1790. // CHECK:STDOUT: %addr.loc11_22.2: %ptr.d9e = addr_of %.loc11_24
  1791. // CHECK:STDOUT: %addr.loc11_22.3: %ptr.d9e = addr_of %.loc11_22.1
  1792. // 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)
  1793. // CHECK:STDOUT: %.loc11_22.2: init %C = in_place_init %operator+__carbon_thunk.call.loc11, %.loc11_22.1
  1794. // CHECK:STDOUT: %.loc11_14: type = splice_block %C.ref.loc11 [concrete = constants.%C] {
  1795. // CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1796. // CHECK:STDOUT: %C.ref.loc11: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1797. // CHECK:STDOUT: }
  1798. // CHECK:STDOUT: %.loc11_22.3: ref %C = temporary %.loc11_22.1, %.loc11_22.2
  1799. // CHECK:STDOUT: %.loc11_22.4: %C = bind_value %.loc11_22.3
  1800. // CHECK:STDOUT: %c4: %C = bind_name c4, %.loc11_22.4
  1801. // CHECK:STDOUT: name_binding_decl {
  1802. // CHECK:STDOUT: %c5.patt: %pattern_type.217 = binding_pattern c5 [concrete]
  1803. // CHECK:STDOUT: }
  1804. // CHECK:STDOUT: %c4.ref: %C = name_ref c4, %c4
  1805. // CHECK:STDOUT: %c3.ref.loc12: %C = name_ref c3, %c3
  1806. // CHECK:STDOUT: %.loc12_22.1: ref %C = temporary_storage
  1807. // CHECK:STDOUT: %.loc12_19: ref %C = value_as_ref %c4.ref
  1808. // CHECK:STDOUT: %addr.loc12_22.1: %ptr.d9e = addr_of %.loc12_19
  1809. // CHECK:STDOUT: %.loc12_24: ref %C = value_as_ref %c3.ref.loc12
  1810. // CHECK:STDOUT: %addr.loc12_22.2: %ptr.d9e = addr_of %.loc12_24
  1811. // CHECK:STDOUT: %addr.loc12_22.3: %ptr.d9e = addr_of %.loc12_22.1
  1812. // 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)
  1813. // CHECK:STDOUT: %.loc12_22.2: init %C = in_place_init %operator+__carbon_thunk.call.loc12, %.loc12_22.1
  1814. // CHECK:STDOUT: %.loc12_14: type = splice_block %C.ref.loc12 [concrete = constants.%C] {
  1815. // CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1816. // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1817. // CHECK:STDOUT: }
  1818. // CHECK:STDOUT: %.loc12_22.3: ref %C = temporary %.loc12_22.1, %.loc12_22.2
  1819. // CHECK:STDOUT: %.loc12_22.4: %C = bind_value %.loc12_22.3
  1820. // CHECK:STDOUT: %c5: %C = bind_name c5, %.loc12_22.4
  1821. // CHECK:STDOUT: %facet_value.loc12: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1822. // CHECK:STDOUT: %.loc12_22.5: %type_where = converted constants.%C, %facet_value.loc12 [concrete = constants.%facet_value]
  1823. // 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
  1824. // CHECK:STDOUT: <elided>
  1825. // CHECK:STDOUT: %bound_method.loc12: <bound method> = bound_method %.loc12_22.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.1
  1826. // CHECK:STDOUT: %addr.loc12_22.4: %ptr.d9e = addr_of %.loc12_22.3
  1827. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc12: init %empty_tuple.type = call %bound_method.loc12(%addr.loc12_22.4)
  1828. // CHECK:STDOUT: %facet_value.loc11: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1829. // CHECK:STDOUT: %.loc11_22.5: %type_where = converted constants.%C, %facet_value.loc11 [concrete = constants.%facet_value]
  1830. // 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
  1831. // CHECK:STDOUT: <elided>
  1832. // CHECK:STDOUT: %bound_method.loc11: <bound method> = bound_method %.loc11_22.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.2
  1833. // CHECK:STDOUT: %addr.loc11_22.4: %ptr.d9e = addr_of %.loc11_22.3
  1834. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc11: init %empty_tuple.type = call %bound_method.loc11(%addr.loc11_22.4)
  1835. // CHECK:STDOUT: %facet_value.loc10: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1836. // CHECK:STDOUT: %.loc10_22.5: %type_where = converted constants.%C, %facet_value.loc10 [concrete = constants.%facet_value]
  1837. // 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
  1838. // CHECK:STDOUT: <elided>
  1839. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %.loc10_22.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.3
  1840. // CHECK:STDOUT: %addr.loc10_22.4: %ptr.d9e = addr_of %.loc10_22.3
  1841. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10_22.4)
  1842. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1843. // CHECK:STDOUT: %.loc9_27.5: %type_where = converted constants.%C, %facet_value.loc9 [concrete = constants.%facet_value]
  1844. // 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
  1845. // CHECK:STDOUT: <elided>
  1846. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %.loc9_27.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.4
  1847. // CHECK:STDOUT: %addr.loc9_27.2: %ptr.d9e = addr_of %.loc9_27.3
  1848. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9_27.2)
  1849. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1850. // CHECK:STDOUT: %.loc8_27.5: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  1851. // 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
  1852. // CHECK:STDOUT: <elided>
  1853. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %.loc8_27.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.5
  1854. // CHECK:STDOUT: %addr.loc8_27.2: %ptr.d9e = addr_of %.loc8_27.3
  1855. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_27.2)
  1856. // CHECK:STDOUT: <elided>
  1857. // CHECK:STDOUT: }
  1858. // CHECK:STDOUT:
  1859. // CHECK:STDOUT: --- import_single_namespace.carbon
  1860. // CHECK:STDOUT:
  1861. // CHECK:STDOUT: constants {
  1862. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1863. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1864. // CHECK:STDOUT: %pattern_type.69f: type = pattern_type %C [concrete]
  1865. // CHECK:STDOUT: %.169: type = cpp_overload_set_type @C__carbon_thunk [concrete]
  1866. // CHECK:STDOUT: %empty_struct.41c: %.169 = struct_value () [concrete]
  1867. // CHECK:STDOUT: %ptr.838: type = ptr_type %C [concrete]
  1868. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  1869. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  1870. // CHECK:STDOUT: %operator+__carbon_thunk.type: type = fn_type @operator+__carbon_thunk [concrete]
  1871. // CHECK:STDOUT: %operator+__carbon_thunk: %operator+__carbon_thunk.type = struct_value () [concrete]
  1872. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
  1873. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  1874. // 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]
  1875. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.1f8: %AggregateT.as_type.as.Destroy.impl.Op.type.523 = struct_value () [concrete]
  1876. // CHECK:STDOUT: }
  1877. // CHECK:STDOUT:
  1878. // CHECK:STDOUT: imports {
  1879. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  1880. // CHECK:STDOUT: .N = %N
  1881. // CHECK:STDOUT: import Cpp//...
  1882. // CHECK:STDOUT: }
  1883. // CHECK:STDOUT: %N: <namespace> = namespace [concrete] {
  1884. // CHECK:STDOUT: .C = %C.decl
  1885. // CHECK:STDOUT: import Cpp//...
  1886. // CHECK:STDOUT: }
  1887. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1888. // CHECK:STDOUT: %.c52: %.169 = cpp_overload_set_value @C__carbon_thunk [concrete = constants.%empty_struct.41c]
  1889. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  1890. // CHECK:STDOUT: <elided>
  1891. // CHECK:STDOUT: } {
  1892. // CHECK:STDOUT: <elided>
  1893. // CHECK:STDOUT: }
  1894. // CHECK:STDOUT: %operator+__carbon_thunk.decl: %operator+__carbon_thunk.type = fn_decl @operator+__carbon_thunk [concrete = constants.%operator+__carbon_thunk] {
  1895. // CHECK:STDOUT: <elided>
  1896. // CHECK:STDOUT: } {
  1897. // CHECK:STDOUT: <elided>
  1898. // CHECK:STDOUT: }
  1899. // CHECK:STDOUT: }
  1900. // CHECK:STDOUT:
  1901. // CHECK:STDOUT: fn @F() {
  1902. // CHECK:STDOUT: !entry:
  1903. // CHECK:STDOUT: name_binding_decl {
  1904. // CHECK:STDOUT: %c1.patt: %pattern_type.69f = binding_pattern c1 [concrete]
  1905. // CHECK:STDOUT: }
  1906. // CHECK:STDOUT: %Cpp.ref.loc8_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1907. // CHECK:STDOUT: %N.ref.loc8_24: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  1908. // CHECK:STDOUT: %C.ref.loc8_26: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1909. // CHECK:STDOUT: %C.ref.loc8_28: %.169 = name_ref C, imports.%.c52 [concrete = constants.%empty_struct.41c]
  1910. // CHECK:STDOUT: %.loc8_31.1: ref %C = temporary_storage
  1911. // CHECK:STDOUT: %addr.loc8_31.1: %ptr.838 = addr_of %.loc8_31.1
  1912. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_31.1)
  1913. // CHECK:STDOUT: %.loc8_31.2: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_31.1
  1914. // CHECK:STDOUT: %.loc8_16: type = splice_block %C.ref.loc8_16 [concrete = constants.%C] {
  1915. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1916. // CHECK:STDOUT: %N.ref.loc8_14: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  1917. // CHECK:STDOUT: %C.ref.loc8_16: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1918. // CHECK:STDOUT: }
  1919. // CHECK:STDOUT: %.loc8_31.3: ref %C = temporary %.loc8_31.1, %.loc8_31.2
  1920. // CHECK:STDOUT: %.loc8_31.4: %C = bind_value %.loc8_31.3
  1921. // CHECK:STDOUT: %c1: %C = bind_name c1, %.loc8_31.4
  1922. // CHECK:STDOUT: name_binding_decl {
  1923. // CHECK:STDOUT: %c2.patt: %pattern_type.69f = binding_pattern c2 [concrete]
  1924. // CHECK:STDOUT: }
  1925. // CHECK:STDOUT: %Cpp.ref.loc9_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1926. // CHECK:STDOUT: %N.ref.loc9_24: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  1927. // CHECK:STDOUT: %C.ref.loc9_26: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1928. // CHECK:STDOUT: %C.ref.loc9_28: %.169 = name_ref C, imports.%.c52 [concrete = constants.%empty_struct.41c]
  1929. // CHECK:STDOUT: %.loc9_31.1: ref %C = temporary_storage
  1930. // CHECK:STDOUT: %addr.loc9_31.1: %ptr.838 = addr_of %.loc9_31.1
  1931. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc9_31.1)
  1932. // CHECK:STDOUT: %.loc9_31.2: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_31.1
  1933. // CHECK:STDOUT: %.loc9_16: type = splice_block %C.ref.loc9_16 [concrete = constants.%C] {
  1934. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1935. // CHECK:STDOUT: %N.ref.loc9_14: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  1936. // CHECK:STDOUT: %C.ref.loc9_16: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1937. // CHECK:STDOUT: }
  1938. // CHECK:STDOUT: %.loc9_31.3: ref %C = temporary %.loc9_31.1, %.loc9_31.2
  1939. // CHECK:STDOUT: %.loc9_31.4: %C = bind_value %.loc9_31.3
  1940. // CHECK:STDOUT: %c2: %C = bind_name c2, %.loc9_31.4
  1941. // CHECK:STDOUT: name_binding_decl {
  1942. // CHECK:STDOUT: %c3.patt: %pattern_type.69f = binding_pattern c3 [concrete]
  1943. // CHECK:STDOUT: }
  1944. // CHECK:STDOUT: %c1.ref: %C = name_ref c1, %c1
  1945. // CHECK:STDOUT: %c2.ref: %C = name_ref c2, %c2
  1946. // CHECK:STDOUT: %.loc10_24.1: ref %C = temporary_storage
  1947. // CHECK:STDOUT: %.loc10_21: ref %C = value_as_ref %c1.ref
  1948. // CHECK:STDOUT: %addr.loc10_24.1: %ptr.838 = addr_of %.loc10_21
  1949. // CHECK:STDOUT: %.loc10_26: ref %C = value_as_ref %c2.ref
  1950. // CHECK:STDOUT: %addr.loc10_24.2: %ptr.838 = addr_of %.loc10_26
  1951. // CHECK:STDOUT: %addr.loc10_24.3: %ptr.838 = addr_of %.loc10_24.1
  1952. // 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)
  1953. // CHECK:STDOUT: %.loc10_24.2: init %C = in_place_init %operator+__carbon_thunk.call, %.loc10_24.1
  1954. // CHECK:STDOUT: %.loc10_16: type = splice_block %C.ref.loc10 [concrete = constants.%C] {
  1955. // CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  1956. // CHECK:STDOUT: %N.ref.loc10: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  1957. // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  1958. // CHECK:STDOUT: }
  1959. // CHECK:STDOUT: %.loc10_24.3: ref %C = temporary %.loc10_24.1, %.loc10_24.2
  1960. // CHECK:STDOUT: %.loc10_24.4: %C = bind_value %.loc10_24.3
  1961. // CHECK:STDOUT: %c3: %C = bind_name c3, %.loc10_24.4
  1962. // CHECK:STDOUT: %facet_value.loc10: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1963. // CHECK:STDOUT: %.loc10_24.5: %type_where = converted constants.%C, %facet_value.loc10 [concrete = constants.%facet_value]
  1964. // 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
  1965. // CHECK:STDOUT: <elided>
  1966. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %.loc10_24.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.1
  1967. // CHECK:STDOUT: %addr.loc10_24.4: %ptr.838 = addr_of %.loc10_24.3
  1968. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10_24.4)
  1969. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1970. // CHECK:STDOUT: %.loc9_31.5: %type_where = converted constants.%C, %facet_value.loc9 [concrete = constants.%facet_value]
  1971. // 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
  1972. // CHECK:STDOUT: <elided>
  1973. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %.loc9_31.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.2
  1974. // CHECK:STDOUT: %addr.loc9_31.2: %ptr.838 = addr_of %.loc9_31.3
  1975. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9_31.2)
  1976. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  1977. // CHECK:STDOUT: %.loc8_31.5: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  1978. // 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
  1979. // CHECK:STDOUT: <elided>
  1980. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %.loc8_31.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.3
  1981. // CHECK:STDOUT: %addr.loc8_31.2: %ptr.838 = addr_of %.loc8_31.3
  1982. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_31.2)
  1983. // CHECK:STDOUT: <elided>
  1984. // CHECK:STDOUT: }
  1985. // CHECK:STDOUT:
  1986. // CHECK:STDOUT: --- import_multiple_namespaces.carbon
  1987. // CHECK:STDOUT:
  1988. // CHECK:STDOUT: constants {
  1989. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1990. // CHECK:STDOUT: %C1: type = class_type @C1 [concrete]
  1991. // CHECK:STDOUT: %pattern_type.20f: type = pattern_type %C1 [concrete]
  1992. // CHECK:STDOUT: %.eb7: type = cpp_overload_set_type @C2__carbon_thunk [concrete]
  1993. // CHECK:STDOUT: %empty_struct.56f: %.eb7 = struct_value () [concrete]
  1994. // CHECK:STDOUT: %ptr.087: type = ptr_type %C1 [concrete]
  1995. // CHECK:STDOUT: %C1__carbon_thunk.type: type = fn_type @C1__carbon_thunk [concrete]
  1996. // CHECK:STDOUT: %C1__carbon_thunk: %C1__carbon_thunk.type = struct_value () [concrete]
  1997. // CHECK:STDOUT: %C2: type = class_type @C2 [concrete]
  1998. // CHECK:STDOUT: %pattern_type.846: type = pattern_type %C2 [concrete]
  1999. // CHECK:STDOUT: %.74f: type = cpp_overload_set_type @cpp_operator.1 [concrete]
  2000. // CHECK:STDOUT: %empty_struct.c81: %.74f = struct_value () [concrete]
  2001. // CHECK:STDOUT: %ptr.51f: type = ptr_type %C2 [concrete]
  2002. // CHECK:STDOUT: %C2__carbon_thunk.type: type = fn_type @C2__carbon_thunk [concrete]
  2003. // CHECK:STDOUT: %C2__carbon_thunk: %C2__carbon_thunk.type = struct_value () [concrete]
  2004. // CHECK:STDOUT: %operator+__carbon_thunk.type: type = fn_type @operator+__carbon_thunk [concrete]
  2005. // CHECK:STDOUT: %operator+__carbon_thunk: %operator+__carbon_thunk.type = struct_value () [concrete]
  2006. // CHECK:STDOUT: %operator-__carbon_thunk.type: type = fn_type @operator-__carbon_thunk [concrete]
  2007. // CHECK:STDOUT: %operator-__carbon_thunk: %operator-__carbon_thunk.type = struct_value () [concrete]
  2008. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
  2009. // CHECK:STDOUT: %facet_value.d7a: %type_where = facet_value %C2, () [concrete]
  2010. // 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]
  2011. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.5ee: %AggregateT.as_type.as.Destroy.impl.Op.type.cd3 = struct_value () [concrete]
  2012. // CHECK:STDOUT: %facet_value.e5d: %type_where = facet_value %C1, () [concrete]
  2013. // 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]
  2014. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.176: %AggregateT.as_type.as.Destroy.impl.Op.type.26c = struct_value () [concrete]
  2015. // CHECK:STDOUT: }
  2016. // CHECK:STDOUT:
  2017. // CHECK:STDOUT: imports {
  2018. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  2019. // CHECK:STDOUT: .N1 = %N1
  2020. // CHECK:STDOUT: .N2 = %N2
  2021. // CHECK:STDOUT: import Cpp//...
  2022. // CHECK:STDOUT: }
  2023. // CHECK:STDOUT: %N1: <namespace> = namespace [concrete] {
  2024. // CHECK:STDOUT: .C1 = %C1.decl
  2025. // CHECK:STDOUT: import Cpp//...
  2026. // CHECK:STDOUT: }
  2027. // CHECK:STDOUT: %C1.decl: type = class_decl @C1 [concrete = constants.%C1] {} {}
  2028. // CHECK:STDOUT: %.91f: %.eb7 = cpp_overload_set_value @C2__carbon_thunk [concrete = constants.%empty_struct.56f]
  2029. // CHECK:STDOUT: %C1__carbon_thunk.decl: %C1__carbon_thunk.type = fn_decl @C1__carbon_thunk [concrete = constants.%C1__carbon_thunk] {
  2030. // CHECK:STDOUT: <elided>
  2031. // CHECK:STDOUT: } {
  2032. // CHECK:STDOUT: <elided>
  2033. // CHECK:STDOUT: }
  2034. // CHECK:STDOUT: %N2: <namespace> = namespace [concrete] {
  2035. // CHECK:STDOUT: .C2 = %C2.decl
  2036. // CHECK:STDOUT: import Cpp//...
  2037. // CHECK:STDOUT: }
  2038. // CHECK:STDOUT: %C2.decl: type = class_decl @C2 [concrete = constants.%C2] {} {}
  2039. // CHECK:STDOUT: %.ed5: %.74f = cpp_overload_set_value @cpp_operator.1 [concrete = constants.%empty_struct.c81]
  2040. // CHECK:STDOUT: %C2__carbon_thunk.decl: %C2__carbon_thunk.type = fn_decl @C2__carbon_thunk [concrete = constants.%C2__carbon_thunk] {
  2041. // CHECK:STDOUT: <elided>
  2042. // CHECK:STDOUT: } {
  2043. // CHECK:STDOUT: <elided>
  2044. // CHECK:STDOUT: }
  2045. // CHECK:STDOUT: %operator+__carbon_thunk.decl: %operator+__carbon_thunk.type = fn_decl @operator+__carbon_thunk [concrete = constants.%operator+__carbon_thunk] {
  2046. // CHECK:STDOUT: <elided>
  2047. // CHECK:STDOUT: } {
  2048. // CHECK:STDOUT: <elided>
  2049. // CHECK:STDOUT: }
  2050. // CHECK:STDOUT: %operator-__carbon_thunk.decl: %operator-__carbon_thunk.type = fn_decl @operator-__carbon_thunk [concrete = constants.%operator-__carbon_thunk] {
  2051. // CHECK:STDOUT: <elided>
  2052. // CHECK:STDOUT: } {
  2053. // CHECK:STDOUT: <elided>
  2054. // CHECK:STDOUT: }
  2055. // CHECK:STDOUT: }
  2056. // CHECK:STDOUT:
  2057. // CHECK:STDOUT: fn @F() {
  2058. // CHECK:STDOUT: !entry:
  2059. // CHECK:STDOUT: name_binding_decl {
  2060. // CHECK:STDOUT: %c1.patt: %pattern_type.20f = binding_pattern c1 [concrete]
  2061. // CHECK:STDOUT: }
  2062. // CHECK:STDOUT: %Cpp.ref.loc8_23: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2063. // CHECK:STDOUT: %N1.ref.loc8_26: <namespace> = name_ref N1, imports.%N1 [concrete = imports.%N1]
  2064. // CHECK:STDOUT: %C1.ref.loc8_29: type = name_ref C1, imports.%C1.decl [concrete = constants.%C1]
  2065. // CHECK:STDOUT: %C1.ref.loc8_32: %.eb7 = name_ref C1, imports.%.91f [concrete = constants.%empty_struct.56f]
  2066. // CHECK:STDOUT: %.loc8_36.1: ref %C1 = temporary_storage
  2067. // CHECK:STDOUT: %addr.loc8_36.1: %ptr.087 = addr_of %.loc8_36.1
  2068. // CHECK:STDOUT: %C1__carbon_thunk.call: init %empty_tuple.type = call imports.%C1__carbon_thunk.decl(%addr.loc8_36.1)
  2069. // CHECK:STDOUT: %.loc8_36.2: init %C1 = in_place_init %C1__carbon_thunk.call, %.loc8_36.1
  2070. // CHECK:STDOUT: %.loc8_17: type = splice_block %C1.ref.loc8_17 [concrete = constants.%C1] {
  2071. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2072. // CHECK:STDOUT: %N1.ref.loc8_14: <namespace> = name_ref N1, imports.%N1 [concrete = imports.%N1]
  2073. // CHECK:STDOUT: %C1.ref.loc8_17: type = name_ref C1, imports.%C1.decl [concrete = constants.%C1]
  2074. // CHECK:STDOUT: }
  2075. // CHECK:STDOUT: %.loc8_36.3: ref %C1 = temporary %.loc8_36.1, %.loc8_36.2
  2076. // CHECK:STDOUT: %.loc8_36.4: %C1 = bind_value %.loc8_36.3
  2077. // CHECK:STDOUT: %c1: %C1 = bind_name c1, %.loc8_36.4
  2078. // CHECK:STDOUT: name_binding_decl {
  2079. // CHECK:STDOUT: %c2.patt: %pattern_type.846 = binding_pattern c2 [concrete]
  2080. // CHECK:STDOUT: }
  2081. // CHECK:STDOUT: %Cpp.ref.loc9_23: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2082. // CHECK:STDOUT: %N2.ref.loc9_26: <namespace> = name_ref N2, imports.%N2 [concrete = imports.%N2]
  2083. // CHECK:STDOUT: %C2.ref.loc9_29: type = name_ref C2, imports.%C2.decl [concrete = constants.%C2]
  2084. // CHECK:STDOUT: %C2.ref.loc9_32: %.74f = name_ref C2, imports.%.ed5 [concrete = constants.%empty_struct.c81]
  2085. // CHECK:STDOUT: %.loc9_36.1: ref %C2 = temporary_storage
  2086. // CHECK:STDOUT: %addr.loc9_36.1: %ptr.51f = addr_of %.loc9_36.1
  2087. // CHECK:STDOUT: %C2__carbon_thunk.call: init %empty_tuple.type = call imports.%C2__carbon_thunk.decl(%addr.loc9_36.1)
  2088. // CHECK:STDOUT: %.loc9_36.2: init %C2 = in_place_init %C2__carbon_thunk.call, %.loc9_36.1
  2089. // CHECK:STDOUT: %.loc9_17: type = splice_block %C2.ref.loc9_17 [concrete = constants.%C2] {
  2090. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2091. // CHECK:STDOUT: %N2.ref.loc9_14: <namespace> = name_ref N2, imports.%N2 [concrete = imports.%N2]
  2092. // CHECK:STDOUT: %C2.ref.loc9_17: type = name_ref C2, imports.%C2.decl [concrete = constants.%C2]
  2093. // CHECK:STDOUT: }
  2094. // CHECK:STDOUT: %.loc9_36.3: ref %C2 = temporary %.loc9_36.1, %.loc9_36.2
  2095. // CHECK:STDOUT: %.loc9_36.4: %C2 = bind_value %.loc9_36.3
  2096. // CHECK:STDOUT: %c2: %C2 = bind_name c2, %.loc9_36.4
  2097. // CHECK:STDOUT: name_binding_decl {
  2098. // CHECK:STDOUT: %c3.patt: %pattern_type.846 = binding_pattern c3 [concrete]
  2099. // CHECK:STDOUT: }
  2100. // CHECK:STDOUT: %c1.ref.loc10: %C1 = name_ref c1, %c1
  2101. // CHECK:STDOUT: %c2.ref.loc10: %C2 = name_ref c2, %c2
  2102. // CHECK:STDOUT: %.loc10_26.1: ref %C2 = temporary_storage
  2103. // CHECK:STDOUT: %.loc10_23: ref %C1 = value_as_ref %c1.ref.loc10
  2104. // CHECK:STDOUT: %addr.loc10_26.1: %ptr.087 = addr_of %.loc10_23
  2105. // CHECK:STDOUT: %.loc10_28: ref %C2 = value_as_ref %c2.ref.loc10
  2106. // CHECK:STDOUT: %addr.loc10_26.2: %ptr.51f = addr_of %.loc10_28
  2107. // CHECK:STDOUT: %addr.loc10_26.3: %ptr.51f = addr_of %.loc10_26.1
  2108. // 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)
  2109. // CHECK:STDOUT: %.loc10_26.2: init %C2 = in_place_init %operator+__carbon_thunk.call, %.loc10_26.1
  2110. // CHECK:STDOUT: %.loc10_17: type = splice_block %C2.ref.loc10 [concrete = constants.%C2] {
  2111. // CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2112. // CHECK:STDOUT: %N2.ref.loc10: <namespace> = name_ref N2, imports.%N2 [concrete = imports.%N2]
  2113. // CHECK:STDOUT: %C2.ref.loc10: type = name_ref C2, imports.%C2.decl [concrete = constants.%C2]
  2114. // CHECK:STDOUT: }
  2115. // CHECK:STDOUT: %.loc10_26.3: ref %C2 = temporary %.loc10_26.1, %.loc10_26.2
  2116. // CHECK:STDOUT: %.loc10_26.4: %C2 = bind_value %.loc10_26.3
  2117. // CHECK:STDOUT: %c3: %C2 = bind_name c3, %.loc10_26.4
  2118. // CHECK:STDOUT: name_binding_decl {
  2119. // CHECK:STDOUT: %c4.patt: %pattern_type.846 = binding_pattern c4 [concrete]
  2120. // CHECK:STDOUT: }
  2121. // CHECK:STDOUT: %c2.ref.loc11: %C2 = name_ref c2, %c2
  2122. // CHECK:STDOUT: %c1.ref.loc11: %C1 = name_ref c1, %c1
  2123. // CHECK:STDOUT: %.loc11_26.1: ref %C2 = temporary_storage
  2124. // CHECK:STDOUT: %.loc11_23: ref %C2 = value_as_ref %c2.ref.loc11
  2125. // CHECK:STDOUT: %addr.loc11_26.1: %ptr.51f = addr_of %.loc11_23
  2126. // CHECK:STDOUT: %.loc11_28: ref %C1 = value_as_ref %c1.ref.loc11
  2127. // CHECK:STDOUT: %addr.loc11_26.2: %ptr.087 = addr_of %.loc11_28
  2128. // CHECK:STDOUT: %addr.loc11_26.3: %ptr.51f = addr_of %.loc11_26.1
  2129. // 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)
  2130. // CHECK:STDOUT: %.loc11_26.2: init %C2 = in_place_init %operator-__carbon_thunk.call, %.loc11_26.1
  2131. // CHECK:STDOUT: %.loc11_17: type = splice_block %C2.ref.loc11 [concrete = constants.%C2] {
  2132. // CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2133. // CHECK:STDOUT: %N2.ref.loc11: <namespace> = name_ref N2, imports.%N2 [concrete = imports.%N2]
  2134. // CHECK:STDOUT: %C2.ref.loc11: type = name_ref C2, imports.%C2.decl [concrete = constants.%C2]
  2135. // CHECK:STDOUT: }
  2136. // CHECK:STDOUT: %.loc11_26.3: ref %C2 = temporary %.loc11_26.1, %.loc11_26.2
  2137. // CHECK:STDOUT: %.loc11_26.4: %C2 = bind_value %.loc11_26.3
  2138. // CHECK:STDOUT: %c4: %C2 = bind_name c4, %.loc11_26.4
  2139. // CHECK:STDOUT: %facet_value.loc11: %type_where = facet_value constants.%C2, () [concrete = constants.%facet_value.d7a]
  2140. // CHECK:STDOUT: %.loc11_26.5: %type_where = converted constants.%C2, %facet_value.loc11 [concrete = constants.%facet_value.d7a]
  2141. // 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
  2142. // CHECK:STDOUT: <elided>
  2143. // CHECK:STDOUT: %bound_method.loc11: <bound method> = bound_method %.loc11_26.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.1
  2144. // CHECK:STDOUT: %addr.loc11_26.4: %ptr.51f = addr_of %.loc11_26.3
  2145. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc11: init %empty_tuple.type = call %bound_method.loc11(%addr.loc11_26.4)
  2146. // CHECK:STDOUT: %facet_value.loc10: %type_where = facet_value constants.%C2, () [concrete = constants.%facet_value.d7a]
  2147. // CHECK:STDOUT: %.loc10_26.5: %type_where = converted constants.%C2, %facet_value.loc10 [concrete = constants.%facet_value.d7a]
  2148. // 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
  2149. // CHECK:STDOUT: <elided>
  2150. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %.loc10_26.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.2
  2151. // CHECK:STDOUT: %addr.loc10_26.4: %ptr.51f = addr_of %.loc10_26.3
  2152. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10_26.4)
  2153. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C2, () [concrete = constants.%facet_value.d7a]
  2154. // CHECK:STDOUT: %.loc9_36.5: %type_where = converted constants.%C2, %facet_value.loc9 [concrete = constants.%facet_value.d7a]
  2155. // 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
  2156. // CHECK:STDOUT: <elided>
  2157. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %.loc9_36.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.3
  2158. // CHECK:STDOUT: %addr.loc9_36.2: %ptr.51f = addr_of %.loc9_36.3
  2159. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9_36.2)
  2160. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C1, () [concrete = constants.%facet_value.e5d]
  2161. // CHECK:STDOUT: %.loc8_36.5: %type_where = converted constants.%C1, %facet_value.loc8 [concrete = constants.%facet_value.e5d]
  2162. // 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
  2163. // CHECK:STDOUT: <elided>
  2164. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %.loc8_36.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.4
  2165. // CHECK:STDOUT: %addr.loc8_36.2: %ptr.087 = addr_of %.loc8_36.3
  2166. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_36.2)
  2167. // CHECK:STDOUT: <elided>
  2168. // CHECK:STDOUT: }
  2169. // CHECK:STDOUT:
  2170. // CHECK:STDOUT: --- fail_todo_import_operands_in_namespace_operator_in_global.carbon
  2171. // CHECK:STDOUT:
  2172. // CHECK:STDOUT: constants {
  2173. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2174. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  2175. // CHECK:STDOUT: %pattern_type.69f: type = pattern_type %C [concrete]
  2176. // CHECK:STDOUT: %.169: type = cpp_overload_set_type @C__carbon_thunk [concrete]
  2177. // CHECK:STDOUT: %empty_struct.41c: %.169 = struct_value () [concrete]
  2178. // CHECK:STDOUT: %ptr.838: type = ptr_type %C [concrete]
  2179. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  2180. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  2181. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
  2182. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  2183. // 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]
  2184. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.1f8: %AggregateT.as_type.as.Destroy.impl.Op.type.523 = struct_value () [concrete]
  2185. // CHECK:STDOUT: }
  2186. // CHECK:STDOUT:
  2187. // CHECK:STDOUT: imports {
  2188. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  2189. // CHECK:STDOUT: .N = %N
  2190. // CHECK:STDOUT: import Cpp//...
  2191. // CHECK:STDOUT: }
  2192. // CHECK:STDOUT: %N: <namespace> = namespace [concrete] {
  2193. // CHECK:STDOUT: .C = %C.decl
  2194. // CHECK:STDOUT: import Cpp//...
  2195. // CHECK:STDOUT: }
  2196. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  2197. // CHECK:STDOUT: %.c52: %.169 = cpp_overload_set_value @C__carbon_thunk [concrete = constants.%empty_struct.41c]
  2198. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  2199. // CHECK:STDOUT: <elided>
  2200. // CHECK:STDOUT: } {
  2201. // CHECK:STDOUT: <elided>
  2202. // CHECK:STDOUT: }
  2203. // CHECK:STDOUT: }
  2204. // CHECK:STDOUT:
  2205. // CHECK:STDOUT: fn @F() {
  2206. // CHECK:STDOUT: !entry:
  2207. // CHECK:STDOUT: name_binding_decl {
  2208. // CHECK:STDOUT: %c1.patt: %pattern_type.69f = binding_pattern c1 [concrete]
  2209. // CHECK:STDOUT: }
  2210. // CHECK:STDOUT: %Cpp.ref.loc8_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2211. // CHECK:STDOUT: %N.ref.loc8_24: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2212. // CHECK:STDOUT: %C.ref.loc8_26: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2213. // CHECK:STDOUT: %C.ref.loc8_28: %.169 = name_ref C, imports.%.c52 [concrete = constants.%empty_struct.41c]
  2214. // CHECK:STDOUT: %.loc8_31.1: ref %C = temporary_storage
  2215. // CHECK:STDOUT: %addr.loc8_31.1: %ptr.838 = addr_of %.loc8_31.1
  2216. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_31.1)
  2217. // CHECK:STDOUT: %.loc8_31.2: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_31.1
  2218. // CHECK:STDOUT: %.loc8_16: type = splice_block %C.ref.loc8_16 [concrete = constants.%C] {
  2219. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2220. // CHECK:STDOUT: %N.ref.loc8_14: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2221. // CHECK:STDOUT: %C.ref.loc8_16: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2222. // CHECK:STDOUT: }
  2223. // CHECK:STDOUT: %.loc8_31.3: ref %C = temporary %.loc8_31.1, %.loc8_31.2
  2224. // CHECK:STDOUT: %.loc8_31.4: %C = bind_value %.loc8_31.3
  2225. // CHECK:STDOUT: %c1: %C = bind_name c1, %.loc8_31.4
  2226. // CHECK:STDOUT: name_binding_decl {
  2227. // CHECK:STDOUT: %c2.patt: %pattern_type.69f = binding_pattern c2 [concrete]
  2228. // CHECK:STDOUT: }
  2229. // CHECK:STDOUT: %Cpp.ref.loc9_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2230. // CHECK:STDOUT: %N.ref.loc9_24: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2231. // CHECK:STDOUT: %C.ref.loc9_26: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2232. // CHECK:STDOUT: %C.ref.loc9_28: %.169 = name_ref C, imports.%.c52 [concrete = constants.%empty_struct.41c]
  2233. // CHECK:STDOUT: %.loc9_31.1: ref %C = temporary_storage
  2234. // CHECK:STDOUT: %addr.loc9_31.1: %ptr.838 = addr_of %.loc9_31.1
  2235. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc9_31.1)
  2236. // CHECK:STDOUT: %.loc9_31.2: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_31.1
  2237. // CHECK:STDOUT: %.loc9_16: type = splice_block %C.ref.loc9_16 [concrete = constants.%C] {
  2238. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2239. // CHECK:STDOUT: %N.ref.loc9_14: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2240. // CHECK:STDOUT: %C.ref.loc9_16: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2241. // CHECK:STDOUT: }
  2242. // CHECK:STDOUT: %.loc9_31.3: ref %C = temporary %.loc9_31.1, %.loc9_31.2
  2243. // CHECK:STDOUT: %.loc9_31.4: %C = bind_value %.loc9_31.3
  2244. // CHECK:STDOUT: %c2: %C = bind_name c2, %.loc9_31.4
  2245. // CHECK:STDOUT: name_binding_decl {
  2246. // CHECK:STDOUT: %c3.patt: %pattern_type.69f = binding_pattern c3 [concrete]
  2247. // CHECK:STDOUT: }
  2248. // CHECK:STDOUT: %c1.ref: %C = name_ref c1, %c1
  2249. // CHECK:STDOUT: %c2.ref: %C = name_ref c2, %c2
  2250. // CHECK:STDOUT: %.loc14: type = splice_block %C.ref.loc14 [concrete = constants.%C] {
  2251. // CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2252. // CHECK:STDOUT: %N.ref.loc14: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2253. // CHECK:STDOUT: %C.ref.loc14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2254. // CHECK:STDOUT: }
  2255. // CHECK:STDOUT: %c3: %C = bind_name c3, <error> [concrete = <error>]
  2256. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2257. // CHECK:STDOUT: %.loc9_31.5: %type_where = converted constants.%C, %facet_value.loc9 [concrete = constants.%facet_value]
  2258. // 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
  2259. // CHECK:STDOUT: <elided>
  2260. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %.loc9_31.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.1
  2261. // CHECK:STDOUT: %addr.loc9_31.2: %ptr.838 = addr_of %.loc9_31.3
  2262. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9_31.2)
  2263. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2264. // CHECK:STDOUT: %.loc8_31.5: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  2265. // 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
  2266. // CHECK:STDOUT: <elided>
  2267. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %.loc8_31.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.2
  2268. // CHECK:STDOUT: %addr.loc8_31.2: %ptr.838 = addr_of %.loc8_31.3
  2269. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_31.2)
  2270. // CHECK:STDOUT: <elided>
  2271. // CHECK:STDOUT: }
  2272. // CHECK:STDOUT:
  2273. // CHECK:STDOUT: --- import_inner_class.carbon
  2274. // CHECK:STDOUT:
  2275. // CHECK:STDOUT: constants {
  2276. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2277. // CHECK:STDOUT: %O: type = class_type @O [concrete]
  2278. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  2279. // CHECK:STDOUT: %pattern_type.b28: type = pattern_type %C [concrete]
  2280. // CHECK:STDOUT: %.d80: type = cpp_overload_set_type @C__carbon_thunk [concrete]
  2281. // CHECK:STDOUT: %empty_struct.06f: %.d80 = struct_value () [concrete]
  2282. // CHECK:STDOUT: %ptr.de2: type = ptr_type %C [concrete]
  2283. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  2284. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  2285. // CHECK:STDOUT: %operator+__carbon_thunk.type: type = fn_type @operator+__carbon_thunk [concrete]
  2286. // CHECK:STDOUT: %operator+__carbon_thunk: %operator+__carbon_thunk.type = struct_value () [concrete]
  2287. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
  2288. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  2289. // 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]
  2290. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.0e1: %AggregateT.as_type.as.Destroy.impl.Op.type.fac = struct_value () [concrete]
  2291. // CHECK:STDOUT: }
  2292. // CHECK:STDOUT:
  2293. // CHECK:STDOUT: imports {
  2294. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  2295. // CHECK:STDOUT: .O = %O.decl
  2296. // CHECK:STDOUT: import Cpp//...
  2297. // CHECK:STDOUT: }
  2298. // CHECK:STDOUT: %O.decl: type = class_decl @O [concrete = constants.%O] {} {}
  2299. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  2300. // CHECK:STDOUT: %.7a9: %.d80 = cpp_overload_set_value @C__carbon_thunk [concrete = constants.%empty_struct.06f]
  2301. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  2302. // CHECK:STDOUT: <elided>
  2303. // CHECK:STDOUT: } {
  2304. // CHECK:STDOUT: <elided>
  2305. // CHECK:STDOUT: }
  2306. // CHECK:STDOUT: %operator+__carbon_thunk.decl: %operator+__carbon_thunk.type = fn_decl @operator+__carbon_thunk [concrete = constants.%operator+__carbon_thunk] {
  2307. // CHECK:STDOUT: <elided>
  2308. // CHECK:STDOUT: } {
  2309. // CHECK:STDOUT: <elided>
  2310. // CHECK:STDOUT: }
  2311. // CHECK:STDOUT: }
  2312. // CHECK:STDOUT:
  2313. // CHECK:STDOUT: fn @F() {
  2314. // CHECK:STDOUT: !entry:
  2315. // CHECK:STDOUT: name_binding_decl {
  2316. // CHECK:STDOUT: %c1.patt: %pattern_type.b28 = binding_pattern c1 [concrete]
  2317. // CHECK:STDOUT: }
  2318. // CHECK:STDOUT: %Cpp.ref.loc8_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2319. // CHECK:STDOUT: %O.ref.loc8_24: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2320. // CHECK:STDOUT: %C.ref.loc8_26: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2321. // CHECK:STDOUT: %C.ref.loc8_28: %.d80 = name_ref C, imports.%.7a9 [concrete = constants.%empty_struct.06f]
  2322. // CHECK:STDOUT: %.loc8_31.1: ref %C = temporary_storage
  2323. // CHECK:STDOUT: %addr.loc8_31.1: %ptr.de2 = addr_of %.loc8_31.1
  2324. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_31.1)
  2325. // CHECK:STDOUT: %.loc8_31.2: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_31.1
  2326. // CHECK:STDOUT: %.loc8_16: type = splice_block %C.ref.loc8_16 [concrete = constants.%C] {
  2327. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2328. // CHECK:STDOUT: %O.ref.loc8_14: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2329. // CHECK:STDOUT: %C.ref.loc8_16: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2330. // CHECK:STDOUT: }
  2331. // CHECK:STDOUT: %.loc8_31.3: ref %C = temporary %.loc8_31.1, %.loc8_31.2
  2332. // CHECK:STDOUT: %.loc8_31.4: %C = bind_value %.loc8_31.3
  2333. // CHECK:STDOUT: %c1: %C = bind_name c1, %.loc8_31.4
  2334. // CHECK:STDOUT: name_binding_decl {
  2335. // CHECK:STDOUT: %c2.patt: %pattern_type.b28 = binding_pattern c2 [concrete]
  2336. // CHECK:STDOUT: }
  2337. // CHECK:STDOUT: %Cpp.ref.loc9_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2338. // CHECK:STDOUT: %O.ref.loc9_24: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2339. // CHECK:STDOUT: %C.ref.loc9_26: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2340. // CHECK:STDOUT: %C.ref.loc9_28: %.d80 = name_ref C, imports.%.7a9 [concrete = constants.%empty_struct.06f]
  2341. // CHECK:STDOUT: %.loc9_31.1: ref %C = temporary_storage
  2342. // CHECK:STDOUT: %addr.loc9_31.1: %ptr.de2 = addr_of %.loc9_31.1
  2343. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc9_31.1)
  2344. // CHECK:STDOUT: %.loc9_31.2: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_31.1
  2345. // CHECK:STDOUT: %.loc9_16: type = splice_block %C.ref.loc9_16 [concrete = constants.%C] {
  2346. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2347. // CHECK:STDOUT: %O.ref.loc9_14: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2348. // CHECK:STDOUT: %C.ref.loc9_16: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2349. // CHECK:STDOUT: }
  2350. // CHECK:STDOUT: %.loc9_31.3: ref %C = temporary %.loc9_31.1, %.loc9_31.2
  2351. // CHECK:STDOUT: %.loc9_31.4: %C = bind_value %.loc9_31.3
  2352. // CHECK:STDOUT: %c2: %C = bind_name c2, %.loc9_31.4
  2353. // CHECK:STDOUT: name_binding_decl {
  2354. // CHECK:STDOUT: %c3.patt: %pattern_type.b28 = binding_pattern c3 [concrete]
  2355. // CHECK:STDOUT: }
  2356. // CHECK:STDOUT: %c1.ref: %C = name_ref c1, %c1
  2357. // CHECK:STDOUT: %c2.ref: %C = name_ref c2, %c2
  2358. // CHECK:STDOUT: %.loc10_24.1: ref %C = temporary_storage
  2359. // CHECK:STDOUT: %.loc10_21: ref %C = value_as_ref %c1.ref
  2360. // CHECK:STDOUT: %addr.loc10_24.1: %ptr.de2 = addr_of %.loc10_21
  2361. // CHECK:STDOUT: %.loc10_26: ref %C = value_as_ref %c2.ref
  2362. // CHECK:STDOUT: %addr.loc10_24.2: %ptr.de2 = addr_of %.loc10_26
  2363. // CHECK:STDOUT: %addr.loc10_24.3: %ptr.de2 = addr_of %.loc10_24.1
  2364. // 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)
  2365. // CHECK:STDOUT: %.loc10_24.2: init %C = in_place_init %operator+__carbon_thunk.call, %.loc10_24.1
  2366. // CHECK:STDOUT: %.loc10_16: type = splice_block %C.ref.loc10 [concrete = constants.%C] {
  2367. // CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2368. // CHECK:STDOUT: %O.ref.loc10: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2369. // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2370. // CHECK:STDOUT: }
  2371. // CHECK:STDOUT: %.loc10_24.3: ref %C = temporary %.loc10_24.1, %.loc10_24.2
  2372. // CHECK:STDOUT: %.loc10_24.4: %C = bind_value %.loc10_24.3
  2373. // CHECK:STDOUT: %c3: %C = bind_name c3, %.loc10_24.4
  2374. // CHECK:STDOUT: %facet_value.loc10: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2375. // CHECK:STDOUT: %.loc10_24.5: %type_where = converted constants.%C, %facet_value.loc10 [concrete = constants.%facet_value]
  2376. // 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
  2377. // CHECK:STDOUT: <elided>
  2378. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %.loc10_24.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.1
  2379. // CHECK:STDOUT: %addr.loc10_24.4: %ptr.de2 = addr_of %.loc10_24.3
  2380. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10_24.4)
  2381. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2382. // CHECK:STDOUT: %.loc9_31.5: %type_where = converted constants.%C, %facet_value.loc9 [concrete = constants.%facet_value]
  2383. // 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
  2384. // CHECK:STDOUT: <elided>
  2385. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %.loc9_31.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.2
  2386. // CHECK:STDOUT: %addr.loc9_31.2: %ptr.de2 = addr_of %.loc9_31.3
  2387. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9_31.2)
  2388. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2389. // CHECK:STDOUT: %.loc8_31.5: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  2390. // 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
  2391. // CHECK:STDOUT: <elided>
  2392. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %.loc8_31.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.3
  2393. // CHECK:STDOUT: %addr.loc8_31.2: %ptr.de2 = addr_of %.loc8_31.3
  2394. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_31.2)
  2395. // CHECK:STDOUT: <elided>
  2396. // CHECK:STDOUT: }
  2397. // CHECK:STDOUT:
  2398. // CHECK:STDOUT: --- import_inner_class_in_namespace.carbon
  2399. // CHECK:STDOUT:
  2400. // CHECK:STDOUT: constants {
  2401. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2402. // CHECK:STDOUT: %O: type = class_type @O [concrete]
  2403. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  2404. // CHECK:STDOUT: %pattern_type.84b: type = pattern_type %C [concrete]
  2405. // CHECK:STDOUT: %.62f: type = cpp_overload_set_type @C__carbon_thunk [concrete]
  2406. // CHECK:STDOUT: %empty_struct.e94: %.62f = struct_value () [concrete]
  2407. // CHECK:STDOUT: %ptr.4b2: type = ptr_type %C [concrete]
  2408. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  2409. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  2410. // CHECK:STDOUT: %operator+__carbon_thunk.type: type = fn_type @operator+__carbon_thunk [concrete]
  2411. // CHECK:STDOUT: %operator+__carbon_thunk: %operator+__carbon_thunk.type = struct_value () [concrete]
  2412. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
  2413. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  2414. // 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]
  2415. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.aaa: %AggregateT.as_type.as.Destroy.impl.Op.type.fda = struct_value () [concrete]
  2416. // CHECK:STDOUT: }
  2417. // CHECK:STDOUT:
  2418. // CHECK:STDOUT: imports {
  2419. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  2420. // CHECK:STDOUT: .N = %N
  2421. // CHECK:STDOUT: import Cpp//...
  2422. // CHECK:STDOUT: }
  2423. // CHECK:STDOUT: %N: <namespace> = namespace [concrete] {
  2424. // CHECK:STDOUT: .O = %O.decl
  2425. // CHECK:STDOUT: import Cpp//...
  2426. // CHECK:STDOUT: }
  2427. // CHECK:STDOUT: %O.decl: type = class_decl @O [concrete = constants.%O] {} {}
  2428. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  2429. // CHECK:STDOUT: %.f56: %.62f = cpp_overload_set_value @C__carbon_thunk [concrete = constants.%empty_struct.e94]
  2430. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  2431. // CHECK:STDOUT: <elided>
  2432. // CHECK:STDOUT: } {
  2433. // CHECK:STDOUT: <elided>
  2434. // CHECK:STDOUT: }
  2435. // CHECK:STDOUT: %operator+__carbon_thunk.decl: %operator+__carbon_thunk.type = fn_decl @operator+__carbon_thunk [concrete = constants.%operator+__carbon_thunk] {
  2436. // CHECK:STDOUT: <elided>
  2437. // CHECK:STDOUT: } {
  2438. // CHECK:STDOUT: <elided>
  2439. // CHECK:STDOUT: }
  2440. // CHECK:STDOUT: }
  2441. // CHECK:STDOUT:
  2442. // CHECK:STDOUT: fn @F() {
  2443. // CHECK:STDOUT: !entry:
  2444. // CHECK:STDOUT: name_binding_decl {
  2445. // CHECK:STDOUT: %c1.patt: %pattern_type.84b = binding_pattern c1 [concrete]
  2446. // CHECK:STDOUT: }
  2447. // CHECK:STDOUT: %Cpp.ref.loc8_23: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2448. // CHECK:STDOUT: %N.ref.loc8_26: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2449. // CHECK:STDOUT: %O.ref.loc8_28: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2450. // CHECK:STDOUT: %C.ref.loc8_30: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2451. // CHECK:STDOUT: %C.ref.loc8_32: %.62f = name_ref C, imports.%.f56 [concrete = constants.%empty_struct.e94]
  2452. // CHECK:STDOUT: %.loc8_35.1: ref %C = temporary_storage
  2453. // CHECK:STDOUT: %addr.loc8_35.1: %ptr.4b2 = addr_of %.loc8_35.1
  2454. // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_35.1)
  2455. // CHECK:STDOUT: %.loc8_35.2: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_35.1
  2456. // CHECK:STDOUT: %.loc8_18: type = splice_block %C.ref.loc8_18 [concrete = constants.%C] {
  2457. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2458. // CHECK:STDOUT: %N.ref.loc8_14: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2459. // CHECK:STDOUT: %O.ref.loc8_16: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2460. // CHECK:STDOUT: %C.ref.loc8_18: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2461. // CHECK:STDOUT: }
  2462. // CHECK:STDOUT: %.loc8_35.3: ref %C = temporary %.loc8_35.1, %.loc8_35.2
  2463. // CHECK:STDOUT: %.loc8_35.4: %C = bind_value %.loc8_35.3
  2464. // CHECK:STDOUT: %c1: %C = bind_name c1, %.loc8_35.4
  2465. // CHECK:STDOUT: name_binding_decl {
  2466. // CHECK:STDOUT: %c2.patt: %pattern_type.84b = binding_pattern c2 [concrete]
  2467. // CHECK:STDOUT: }
  2468. // CHECK:STDOUT: %Cpp.ref.loc9_23: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2469. // CHECK:STDOUT: %N.ref.loc9_26: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2470. // CHECK:STDOUT: %O.ref.loc9_28: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2471. // CHECK:STDOUT: %C.ref.loc9_30: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2472. // CHECK:STDOUT: %C.ref.loc9_32: %.62f = name_ref C, imports.%.f56 [concrete = constants.%empty_struct.e94]
  2473. // CHECK:STDOUT: %.loc9_35.1: ref %C = temporary_storage
  2474. // CHECK:STDOUT: %addr.loc9_35.1: %ptr.4b2 = addr_of %.loc9_35.1
  2475. // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc9_35.1)
  2476. // CHECK:STDOUT: %.loc9_35.2: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_35.1
  2477. // CHECK:STDOUT: %.loc9_18: type = splice_block %C.ref.loc9_18 [concrete = constants.%C] {
  2478. // CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2479. // CHECK:STDOUT: %N.ref.loc9_14: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2480. // CHECK:STDOUT: %O.ref.loc9_16: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2481. // CHECK:STDOUT: %C.ref.loc9_18: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2482. // CHECK:STDOUT: }
  2483. // CHECK:STDOUT: %.loc9_35.3: ref %C = temporary %.loc9_35.1, %.loc9_35.2
  2484. // CHECK:STDOUT: %.loc9_35.4: %C = bind_value %.loc9_35.3
  2485. // CHECK:STDOUT: %c2: %C = bind_name c2, %.loc9_35.4
  2486. // CHECK:STDOUT: name_binding_decl {
  2487. // CHECK:STDOUT: %c3.patt: %pattern_type.84b = binding_pattern c3 [concrete]
  2488. // CHECK:STDOUT: }
  2489. // CHECK:STDOUT: %c1.ref: %C = name_ref c1, %c1
  2490. // CHECK:STDOUT: %c2.ref: %C = name_ref c2, %c2
  2491. // CHECK:STDOUT: %.loc10_26.1: ref %C = temporary_storage
  2492. // CHECK:STDOUT: %.loc10_23: ref %C = value_as_ref %c1.ref
  2493. // CHECK:STDOUT: %addr.loc10_26.1: %ptr.4b2 = addr_of %.loc10_23
  2494. // CHECK:STDOUT: %.loc10_28: ref %C = value_as_ref %c2.ref
  2495. // CHECK:STDOUT: %addr.loc10_26.2: %ptr.4b2 = addr_of %.loc10_28
  2496. // CHECK:STDOUT: %addr.loc10_26.3: %ptr.4b2 = addr_of %.loc10_26.1
  2497. // 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)
  2498. // CHECK:STDOUT: %.loc10_26.2: init %C = in_place_init %operator+__carbon_thunk.call, %.loc10_26.1
  2499. // CHECK:STDOUT: %.loc10_18: type = splice_block %C.ref.loc10 [concrete = constants.%C] {
  2500. // CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2501. // CHECK:STDOUT: %N.ref.loc10: <namespace> = name_ref N, imports.%N [concrete = imports.%N]
  2502. // CHECK:STDOUT: %O.ref.loc10: type = name_ref O, imports.%O.decl [concrete = constants.%O]
  2503. // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2504. // CHECK:STDOUT: }
  2505. // CHECK:STDOUT: %.loc10_26.3: ref %C = temporary %.loc10_26.1, %.loc10_26.2
  2506. // CHECK:STDOUT: %.loc10_26.4: %C = bind_value %.loc10_26.3
  2507. // CHECK:STDOUT: %c3: %C = bind_name c3, %.loc10_26.4
  2508. // CHECK:STDOUT: %facet_value.loc10: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2509. // CHECK:STDOUT: %.loc10_26.5: %type_where = converted constants.%C, %facet_value.loc10 [concrete = constants.%facet_value]
  2510. // 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
  2511. // CHECK:STDOUT: <elided>
  2512. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %.loc10_26.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.1
  2513. // CHECK:STDOUT: %addr.loc10_26.4: %ptr.4b2 = addr_of %.loc10_26.3
  2514. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10_26.4)
  2515. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2516. // CHECK:STDOUT: %.loc9_35.5: %type_where = converted constants.%C, %facet_value.loc9 [concrete = constants.%facet_value]
  2517. // 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
  2518. // CHECK:STDOUT: <elided>
  2519. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %.loc9_35.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.2
  2520. // CHECK:STDOUT: %addr.loc9_35.2: %ptr.4b2 = addr_of %.loc9_35.3
  2521. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9_35.2)
  2522. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2523. // CHECK:STDOUT: %.loc8_35.5: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  2524. // 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
  2525. // CHECK:STDOUT: <elided>
  2526. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %.loc8_35.3, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.3
  2527. // CHECK:STDOUT: %addr.loc8_35.2: %ptr.4b2 = addr_of %.loc8_35.3
  2528. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_35.2)
  2529. // CHECK:STDOUT: <elided>
  2530. // CHECK:STDOUT: }
  2531. // CHECK:STDOUT:
  2532. // CHECK:STDOUT: --- import_member_add_with.carbon
  2533. // CHECK:STDOUT:
  2534. // CHECK:STDOUT: constants {
  2535. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  2536. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  2537. // CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
  2538. // CHECK:STDOUT: %.d40: type = cpp_overload_set_type @C.cpp_operator.1 [concrete]
  2539. // CHECK:STDOUT: %empty_struct.e73: %.d40 = struct_value () [concrete]
  2540. // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
  2541. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  2542. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  2543. // CHECK:STDOUT: %operator-__carbon_thunk.type: type = fn_type @operator-__carbon_thunk [concrete]
  2544. // CHECK:STDOUT: %operator-__carbon_thunk: %operator-__carbon_thunk.type = struct_value () [concrete]
  2545. // CHECK:STDOUT: %operator+__carbon_thunk.type: type = fn_type @operator+__carbon_thunk [concrete]
  2546. // CHECK:STDOUT: %operator+__carbon_thunk: %operator+__carbon_thunk.type = struct_value () [concrete]
  2547. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
  2548. // CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
  2549. // 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]
  2550. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.6b9: %AggregateT.as_type.as.Destroy.impl.Op.type.fc1 = struct_value () [concrete]
  2551. // CHECK:STDOUT: }
  2552. // CHECK:STDOUT:
  2553. // CHECK:STDOUT: imports {
  2554. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  2555. // CHECK:STDOUT: .C = %C.decl
  2556. // CHECK:STDOUT: import Cpp//...
  2557. // CHECK:STDOUT: }
  2558. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  2559. // CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @C.cpp_operator.1 [concrete = constants.%empty_struct.e73]
  2560. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  2561. // CHECK:STDOUT: <elided>
  2562. // CHECK:STDOUT: } {
  2563. // CHECK:STDOUT: <elided>
  2564. // CHECK:STDOUT: }
  2565. // CHECK:STDOUT: %operator-__carbon_thunk.decl: %operator-__carbon_thunk.type = fn_decl @operator-__carbon_thunk [concrete = constants.%operator-__carbon_thunk] {
  2566. // CHECK:STDOUT: <elided>
  2567. // CHECK:STDOUT: } {
  2568. // CHECK:STDOUT: <elided>
  2569. // CHECK:STDOUT: }
  2570. // CHECK:STDOUT: %operator+__carbon_thunk.decl: %operator+__carbon_thunk.type = fn_decl @operator+__carbon_thunk [concrete = constants.%operator+__carbon_thunk] {
  2571. // CHECK:STDOUT: <elided>
  2572. // CHECK:STDOUT: } {
  2573. // CHECK:STDOUT: <elided>
  2574. // CHECK:STDOUT: }
  2575. // CHECK:STDOUT: }
  2576. // CHECK:STDOUT:
  2577. // CHECK:STDOUT: fn @F() {
  2578. // CHECK:STDOUT: !entry:
  2579. // CHECK:STDOUT: name_binding_decl {
  2580. // CHECK:STDOUT: %c1.patt: %pattern_type.217 = binding_pattern c1 [concrete]
  2581. // CHECK:STDOUT: %c1.var_patt: %pattern_type.217 = var_pattern %c1.patt [concrete]
  2582. // CHECK:STDOUT: }
  2583. // CHECK:STDOUT: %c1.var: ref %C = var %c1.var_patt
  2584. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2585. // CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2586. // CHECK:STDOUT: %C.ref.loc8_24: %.d40 = name_ref C, imports.%.40b [concrete = constants.%empty_struct.e73]
  2587. // CHECK:STDOUT: %.loc8_3.1: ref %C = splice_block %c1.var {}
  2588. // CHECK:STDOUT: %addr.loc8_27: %ptr.d9e = addr_of %.loc8_3.1
  2589. // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_27)
  2590. // CHECK:STDOUT: %.loc8_27: init %C = in_place_init %C__carbon_thunk.call, %.loc8_3.1
  2591. // CHECK:STDOUT: assign %c1.var, %.loc8_27
  2592. // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] {
  2593. // CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2594. // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2595. // CHECK:STDOUT: }
  2596. // CHECK:STDOUT: %c1: ref %C = bind_name c1, %c1.var
  2597. // CHECK:STDOUT: name_binding_decl {
  2598. // CHECK:STDOUT: %c2.patt: %pattern_type.217 = binding_pattern c2 [concrete]
  2599. // CHECK:STDOUT: %c2.var_patt: %pattern_type.217 = var_pattern %c2.patt [concrete]
  2600. // CHECK:STDOUT: }
  2601. // CHECK:STDOUT: %c2.var: ref %C = var %c2.var_patt
  2602. // CHECK:STDOUT: %c1.ref.loc9: ref %C = name_ref c1, %c1
  2603. // CHECK:STDOUT: %.loc9_3.1: ref %C = splice_block %c2.var {}
  2604. // CHECK:STDOUT: %addr.loc9_20: %ptr.d9e = addr_of %c1.ref.loc9
  2605. // CHECK:STDOUT: %addr.loc9_19: %ptr.d9e = addr_of %.loc9_3.1
  2606. // CHECK:STDOUT: %operator-__carbon_thunk.call: init %empty_tuple.type = call imports.%operator-__carbon_thunk.decl(%addr.loc9_20, %addr.loc9_19)
  2607. // CHECK:STDOUT: %.loc9_19: init %C = in_place_init %operator-__carbon_thunk.call, %.loc9_3.1
  2608. // CHECK:STDOUT: assign %c2.var, %.loc9_19
  2609. // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9 [concrete = constants.%C] {
  2610. // CHECK:STDOUT: %Cpp.ref.loc9: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2611. // CHECK:STDOUT: %C.ref.loc9: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2612. // CHECK:STDOUT: }
  2613. // CHECK:STDOUT: %c2: ref %C = bind_name c2, %c2.var
  2614. // CHECK:STDOUT: name_binding_decl {
  2615. // CHECK:STDOUT: %c3.patt: %pattern_type.217 = binding_pattern c3 [concrete]
  2616. // CHECK:STDOUT: %c3.var_patt: %pattern_type.217 = var_pattern %c3.patt [concrete]
  2617. // CHECK:STDOUT: }
  2618. // CHECK:STDOUT: %c3.var: ref %C = var %c3.var_patt
  2619. // CHECK:STDOUT: %c1.ref.loc10: ref %C = name_ref c1, %c1
  2620. // CHECK:STDOUT: %c2.ref: ref %C = name_ref c2, %c2
  2621. // CHECK:STDOUT: %.loc10_3.1: ref %C = splice_block %c3.var {}
  2622. // CHECK:STDOUT: %addr.loc10_19: %ptr.d9e = addr_of %c1.ref.loc10
  2623. // CHECK:STDOUT: %.loc10_24.1: %C = bind_value %c2.ref
  2624. // CHECK:STDOUT: %.loc10_24.2: ref %C = value_as_ref %.loc10_24.1
  2625. // CHECK:STDOUT: %addr.loc10_22.1: %ptr.d9e = addr_of %.loc10_24.2
  2626. // CHECK:STDOUT: %addr.loc10_22.2: %ptr.d9e = addr_of %.loc10_3.1
  2627. // CHECK:STDOUT: %operator+__carbon_thunk.call: init %empty_tuple.type = call imports.%operator+__carbon_thunk.decl(%addr.loc10_19, %addr.loc10_22.1, %addr.loc10_22.2)
  2628. // CHECK:STDOUT: %.loc10_22: init %C = in_place_init %operator+__carbon_thunk.call, %.loc10_3.1
  2629. // CHECK:STDOUT: assign %c3.var, %.loc10_22
  2630. // CHECK:STDOUT: %.loc10_14: type = splice_block %C.ref.loc10 [concrete = constants.%C] {
  2631. // CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  2632. // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C]
  2633. // CHECK:STDOUT: }
  2634. // CHECK:STDOUT: %c3: ref %C = bind_name c3, %c3.var
  2635. // CHECK:STDOUT: %facet_value.loc10: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2636. // CHECK:STDOUT: %.loc10_3.2: %type_where = converted constants.%C, %facet_value.loc10 [concrete = constants.%facet_value]
  2637. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.bound.loc10: <bound method> = bound_method %c3.var, constants.%AggregateT.as_type.as.Destroy.impl.Op.6b9
  2638. // CHECK:STDOUT: <elided>
  2639. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %c3.var, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.1
  2640. // CHECK:STDOUT: %addr.loc10_3: %ptr.d9e = addr_of %c3.var
  2641. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10_3)
  2642. // CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2643. // CHECK:STDOUT: %.loc9_3.2: %type_where = converted constants.%C, %facet_value.loc9 [concrete = constants.%facet_value]
  2644. // 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
  2645. // CHECK:STDOUT: <elided>
  2646. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %c2.var, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.2
  2647. // CHECK:STDOUT: %addr.loc9_3: %ptr.d9e = addr_of %c2.var
  2648. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9(%addr.loc9_3)
  2649. // CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
  2650. // CHECK:STDOUT: %.loc8_3.2: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
  2651. // 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
  2652. // CHECK:STDOUT: <elided>
  2653. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %c1.var, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.3
  2654. // CHECK:STDOUT: %addr.loc8_3: %ptr.d9e = addr_of %c1.var
  2655. // CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8_3)
  2656. // CHECK:STDOUT: <elided>
  2657. // CHECK:STDOUT: }
  2658. // CHECK:STDOUT: