reference.carbon 66 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063
  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/convert.carbon
  6. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/reference.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/reference.carbon
  12. // ============================================================================
  13. // Lvalue reference as a parameter type
  14. // ============================================================================
  15. // --- param_lvalue_ref.h
  16. struct S {};
  17. struct T {};
  18. auto TakesLValue(S&) -> void;
  19. // --- call_param_lvalue_ref.carbon
  20. library "[[@TEST_NAME]]";
  21. import Cpp library "param_lvalue_ref.h";
  22. fn F() {
  23. //@dump-sem-ir-begin
  24. var s: Cpp.S = {};
  25. Cpp.TakesLValue(s);
  26. //@dump-sem-ir-end
  27. }
  28. // --- fail_param_lvalue_ref.carbon
  29. library "[[@TEST_NAME]]";
  30. import Cpp library "param_lvalue_ref.h";
  31. fn F() {
  32. //@dump-sem-ir-begin
  33. var v: Cpp.S;
  34. let s: Cpp.S = v;
  35. // CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+8]]:20: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
  36. // CHECK:STDERR: 18 | Cpp.TakesLValue(s);
  37. // CHECK:STDERR: | ^
  38. // CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE-9]]:10: in file included here [InCppInclude]
  39. // CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable: expects an lvalue for 1st argument [CppInteropParseNote]
  40. // CHECK:STDERR: 5 | auto TakesLValue(S&) -> void;
  41. // CHECK:STDERR: | ^ ~~
  42. // CHECK:STDERR:
  43. Cpp.TakesLValue(s);
  44. // CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+8]]:35: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
  45. // CHECK:STDERR: 28 | Cpp.TakesLValue(s as const Cpp.S);
  46. // CHECK:STDERR: | ^
  47. // CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE-19]]:10: in file included here [InCppInclude]
  48. // CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable: 1st argument ('const S') would lose const qualifier [CppInteropParseNote]
  49. // CHECK:STDERR: 5 | auto TakesLValue(S&) -> void;
  50. // CHECK:STDERR: | ^ ~~
  51. // CHECK:STDERR:
  52. Cpp.TakesLValue(s as const Cpp.S);
  53. var t: Cpp.T;
  54. // CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+8]]:20: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
  55. // CHECK:STDERR: 39 | Cpp.TakesLValue(t);
  56. // CHECK:STDERR: | ^
  57. // CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE-30]]:10: in file included here [InCppInclude]
  58. // CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable: no known conversion from 'T' to 'S &' for 1st argument [CppInteropParseNote]
  59. // CHECK:STDERR: 5 | auto TakesLValue(S&) -> void;
  60. // CHECK:STDERR: | ^ ~~
  61. // CHECK:STDERR:
  62. Cpp.TakesLValue(t);
  63. var u: Cpp.S;
  64. // CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+8]]:35: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
  65. // CHECK:STDERR: 50 | Cpp.TakesLValue(u as const Cpp.S);
  66. // CHECK:STDERR: | ^
  67. // CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE-41]]:10: in file included here [InCppInclude]
  68. // CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable: 1st argument ('const S') would lose const qualifier [CppInteropParseNote]
  69. // CHECK:STDERR: 5 | auto TakesLValue(S&) -> void;
  70. // CHECK:STDERR: | ^ ~~
  71. // CHECK:STDERR:
  72. Cpp.TakesLValue(u as const Cpp.S);
  73. //@dump-sem-ir-end
  74. }
  75. // ============================================================================
  76. // Rvalue reference as a parameter type
  77. // ============================================================================
  78. // --- param_rvalue_ref.h
  79. struct S {};
  80. struct T {};
  81. auto TakesRValue(S&&) -> void;
  82. // --- call_param_rvalue_ref.carbon
  83. library "[[@TEST_NAME]]";
  84. import Cpp library "param_rvalue_ref.h";
  85. fn F() {
  86. //@dump-sem-ir-begin
  87. Cpp.TakesRValue({} as Cpp.S);
  88. //@dump-sem-ir-end
  89. }
  90. // --- todo_fail_param_value_arg_for_rvalue_ref.carbon
  91. library "[[@TEST_NAME]]";
  92. import Cpp library "param_rvalue_ref.h";
  93. fn F() {
  94. //@dump-sem-ir-begin
  95. // TODO: We should probably reject binding an rvalue reference to a value
  96. // expression. If we don't reject, we should instead force a copy to be made,
  97. // at least if the type has a pointer value representation, so that moving
  98. // from the reference doesn't alter tne original value.
  99. let s: Cpp.S = {};
  100. Cpp.TakesRValue(s);
  101. //@dump-sem-ir-end
  102. }
  103. // --- fail_param_rvalue_ref.carbon
  104. library "[[@TEST_NAME]]";
  105. import Cpp library "param_rvalue_ref.h";
  106. fn F() {
  107. //@dump-sem-ir-begin
  108. var s: Cpp.S;
  109. // CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+8]]:20: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
  110. // CHECK:STDERR: 17 | Cpp.TakesRValue(s);
  111. // CHECK:STDERR: | ^
  112. // CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE-8]]:10: in file included here [InCppInclude]
  113. // CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable: expects an rvalue for 1st argument [CppInteropParseNote]
  114. // CHECK:STDERR: 5 | auto TakesRValue(S&&) -> void;
  115. // CHECK:STDERR: | ^ ~~~
  116. // CHECK:STDERR:
  117. Cpp.TakesRValue(s);
  118. var t: Cpp.T;
  119. // CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+8]]:20: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
  120. // CHECK:STDERR: 28 | Cpp.TakesRValue(t);
  121. // CHECK:STDERR: | ^
  122. // CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE-19]]:10: in file included here [InCppInclude]
  123. // CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable: no known conversion from 'T' to 'S' for 1st argument [CppInteropParseNote]
  124. // CHECK:STDERR: 5 | auto TakesRValue(S&&) -> void;
  125. // CHECK:STDERR: | ^ ~~~
  126. // CHECK:STDERR:
  127. Cpp.TakesRValue(t);
  128. // CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+8]]:47: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
  129. // CHECK:STDERR: 38 | Cpp.TakesRValue(({} as Cpp.S) as const Cpp.S);
  130. // CHECK:STDERR: | ^
  131. // CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE-29]]:10: in file included here [InCppInclude]
  132. // CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable: 1st argument ('const S') would lose const qualifier [CppInteropParseNote]
  133. // CHECK:STDERR: 5 | auto TakesRValue(S&&) -> void;
  134. // CHECK:STDERR: | ^ ~~~
  135. // CHECK:STDERR:
  136. Cpp.TakesRValue(({} as Cpp.S) as const Cpp.S);
  137. //@dump-sem-ir-end
  138. }
  139. // ============================================================================
  140. // Const reference as a parameter type
  141. // ============================================================================
  142. // --- param_const_lvalue_ref.h
  143. struct S {};
  144. struct T {};
  145. auto TakesConstLValue(const S&) -> void;
  146. // --- call_param_const_lvalue_ref_with_ref.carbon
  147. library "[[@TEST_NAME]]";
  148. import Cpp library "param_const_lvalue_ref.h";
  149. fn F() {
  150. //@dump-sem-ir-begin
  151. var s: Cpp.S = {};
  152. Cpp.TakesConstLValue(s as const Cpp.S);
  153. Cpp.TakesConstLValue(s);
  154. //@dump-sem-ir-end
  155. }
  156. // --- call_param_const_lvalue_ref_with_value.carbon
  157. library "[[@TEST_NAME]]";
  158. import Cpp library "param_const_lvalue_ref.h";
  159. fn F() {
  160. //@dump-sem-ir-begin
  161. let s: Cpp.S = {};
  162. Cpp.TakesConstLValue(s);
  163. Cpp.TakesConstLValue(s as const Cpp.S);
  164. //@dump-sem-ir-end
  165. }
  166. // --- fail_call_param_const_lvalue_ref_with_wrong_type.carbon
  167. library "[[@TEST_NAME]]";
  168. import Cpp library "param_const_lvalue_ref.h";
  169. fn F() {
  170. var t: Cpp.T;
  171. // CHECK:STDERR: fail_call_param_const_lvalue_ref_with_wrong_type.carbon:[[@LINE+8]]:25: error: no matching function for call to 'TakesConstLValue' [CppInteropParseError]
  172. // CHECK:STDERR: 16 | Cpp.TakesConstLValue(t);
  173. // CHECK:STDERR: | ^
  174. // CHECK:STDERR: fail_call_param_const_lvalue_ref_with_wrong_type.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
  175. // CHECK:STDERR: ./param_const_lvalue_ref.h:5:6: note: candidate function not viable: no known conversion from 'T' to 'const S' for 1st argument [CppInteropParseNote]
  176. // CHECK:STDERR: 5 | auto TakesConstLValue(const S&) -> void;
  177. // CHECK:STDERR: | ^ ~~~~~~~~
  178. // CHECK:STDERR:
  179. Cpp.TakesConstLValue(t);
  180. }
  181. // ============================================================================
  182. // Lvalue reference as return type
  183. // ============================================================================
  184. // --- return_lvalue_ref.h
  185. struct S {};
  186. auto ReturnsLValue() -> S&;
  187. // --- call_return_lvalue_ref.carbon
  188. library "[[@TEST_NAME]]";
  189. import Cpp library "return_lvalue_ref.h";
  190. fn F() {
  191. //@dump-sem-ir-begin
  192. let s: Cpp.S* = Cpp.ReturnsLValue();
  193. //@dump-sem-ir-end
  194. }
  195. // ============================================================================
  196. // Rvalue reference as return type
  197. // ============================================================================
  198. // --- return_rvalue_ref.h
  199. struct S {};
  200. auto ReturnsRValue() -> S&&;
  201. // --- call_return_rvalue_ref.carbon
  202. library "[[@TEST_NAME]]";
  203. import Cpp library "return_rvalue_ref.h";
  204. fn F() {
  205. //@dump-sem-ir-begin
  206. var s: Cpp.S* = Cpp.ReturnsRValue();
  207. //@dump-sem-ir-end
  208. }
  209. // ============================================================================
  210. // Const reference as return type
  211. // ============================================================================
  212. // --- return_const_lvalue_ref.h
  213. struct S {};
  214. auto ReturnConstLValue() -> const S&;
  215. // --- call_return_const_lvalue_ref.carbon
  216. library "[[@TEST_NAME]]";
  217. import Cpp library "return_const_lvalue_ref.h";
  218. fn F() {
  219. //@dump-sem-ir-begin
  220. var s: const Cpp.S* = Cpp.ReturnConstLValue();
  221. //@dump-sem-ir-end
  222. }
  223. // --- fail_call_return_const_lvalue_ref_const_correctness.carbon
  224. library "[[@TEST_NAME]]";
  225. import Cpp library "return_const_lvalue_ref.h";
  226. fn F() {
  227. // CHECK:STDERR: fail_call_return_const_lvalue_ref_const_correctness.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `const (const Cpp.S*)` to `Cpp.S*` [ConversionFailure]
  228. // CHECK:STDERR: var s: Cpp.S* = Cpp.ReturnConstLValue();
  229. // CHECK:STDERR: ^~~~~~~~~~~~~
  230. // CHECK:STDERR: fail_call_return_const_lvalue_ref_const_correctness.carbon:[[@LINE+4]]:3: note: type `const (const Cpp.S*)` does not implement interface `Core.ImplicitAs(Cpp.S*)` [MissingImplInMemberAccessNote]
  231. // CHECK:STDERR: var s: Cpp.S* = Cpp.ReturnConstLValue();
  232. // CHECK:STDERR: ^~~~~~~~~~~~~
  233. // CHECK:STDERR:
  234. var s: Cpp.S* = Cpp.ReturnConstLValue();
  235. }
  236. // CHECK:STDOUT: --- call_param_lvalue_ref.carbon
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: constants {
  239. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  240. // CHECK:STDOUT: %S: type = class_type @S [concrete]
  241. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  242. // CHECK:STDOUT: %pattern_type.7da: type = pattern_type %S [concrete]
  243. // CHECK:STDOUT: %S.val: %S = struct_value () [concrete]
  244. // CHECK:STDOUT: %TakesLValue.cpp_overload_set.type: type = cpp_overload_set_type @TakesLValue.cpp_overload_set [concrete]
  245. // CHECK:STDOUT: %TakesLValue.cpp_overload_set.value: %TakesLValue.cpp_overload_set.type = cpp_overload_set_value @TakesLValue.cpp_overload_set [concrete]
  246. // CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
  247. // CHECK:STDOUT: %TakesLValue.type: type = fn_type @TakesLValue [concrete]
  248. // CHECK:STDOUT: %TakesLValue: %TakesLValue.type = struct_value () [concrete]
  249. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  250. // CHECK:STDOUT: %facet_value: %type_where = facet_value %S, () [concrete]
  251. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.552: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  252. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.572: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.552 = struct_value () [concrete]
  253. // CHECK:STDOUT: }
  254. // CHECK:STDOUT:
  255. // CHECK:STDOUT: imports {
  256. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  257. // CHECK:STDOUT: .S = %S.decl
  258. // CHECK:STDOUT: .TakesLValue = %TakesLValue.cpp_overload_set.value
  259. // CHECK:STDOUT: import Cpp//...
  260. // CHECK:STDOUT: }
  261. // CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
  262. // CHECK:STDOUT: %TakesLValue.cpp_overload_set.value: %TakesLValue.cpp_overload_set.type = cpp_overload_set_value @TakesLValue.cpp_overload_set [concrete = constants.%TakesLValue.cpp_overload_set.value]
  263. // CHECK:STDOUT: %TakesLValue.decl: %TakesLValue.type = fn_decl @TakesLValue [concrete = constants.%TakesLValue] {
  264. // CHECK:STDOUT: <elided>
  265. // CHECK:STDOUT: } {
  266. // CHECK:STDOUT: <elided>
  267. // CHECK:STDOUT: }
  268. // CHECK:STDOUT: }
  269. // CHECK:STDOUT:
  270. // CHECK:STDOUT: fn @F() {
  271. // CHECK:STDOUT: !entry:
  272. // CHECK:STDOUT: name_binding_decl {
  273. // CHECK:STDOUT: %s.patt: %pattern_type.7da = ref_binding_pattern s [concrete]
  274. // CHECK:STDOUT: %s.var_patt: %pattern_type.7da = var_pattern %s.patt [concrete]
  275. // CHECK:STDOUT: }
  276. // CHECK:STDOUT: %s.var: ref %S = var %s.var_patt
  277. // CHECK:STDOUT: %.loc8_19.1: %empty_struct_type = struct_literal ()
  278. // CHECK:STDOUT: %.loc8_19.2: init %S = class_init (), %s.var [concrete = constants.%S.val]
  279. // CHECK:STDOUT: %.loc8_3: init %S = converted %.loc8_19.1, %.loc8_19.2 [concrete = constants.%S.val]
  280. // CHECK:STDOUT: assign %s.var, %.loc8_3
  281. // CHECK:STDOUT: %.loc8_13: type = splice_block %S.ref [concrete = constants.%S] {
  282. // CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  283. // CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  284. // CHECK:STDOUT: }
  285. // CHECK:STDOUT: %s: ref %S = ref_binding s, %s.var
  286. // CHECK:STDOUT: %Cpp.ref.loc9: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  287. // CHECK:STDOUT: %TakesLValue.ref: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
  288. // CHECK:STDOUT: %s.ref: ref %S = name_ref s, %s
  289. // CHECK:STDOUT: %addr.loc9: %ptr.5c7 = addr_of %s.ref
  290. // CHECK:STDOUT: %TakesLValue.call: init %empty_tuple.type = call imports.%TakesLValue.decl(%addr.loc9)
  291. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %s.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.572
  292. // CHECK:STDOUT: <elided>
  293. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %s.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  294. // CHECK:STDOUT: %addr.loc8: %ptr.5c7 = addr_of %s.var
  295. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc8)
  296. // CHECK:STDOUT: <elided>
  297. // CHECK:STDOUT: }
  298. // CHECK:STDOUT:
  299. // CHECK:STDOUT: --- fail_param_lvalue_ref.carbon
  300. // CHECK:STDOUT:
  301. // CHECK:STDOUT: constants {
  302. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  303. // CHECK:STDOUT: %S: type = class_type @S [concrete]
  304. // CHECK:STDOUT: %pattern_type.7da: type = pattern_type %S [concrete]
  305. // CHECK:STDOUT: %TakesLValue.cpp_overload_set.type: type = cpp_overload_set_type @TakesLValue.cpp_overload_set [concrete]
  306. // CHECK:STDOUT: %TakesLValue.cpp_overload_set.value: %TakesLValue.cpp_overload_set.type = cpp_overload_set_value @TakesLValue.cpp_overload_set [concrete]
  307. // CHECK:STDOUT: %const: type = const_type %S [concrete]
  308. // CHECK:STDOUT: %T: type = class_type @T [concrete]
  309. // CHECK:STDOUT: %pattern_type.e6b: type = pattern_type %T [concrete]
  310. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  311. // CHECK:STDOUT: %facet_value.7bd: %type_where = facet_value %S, () [concrete]
  312. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.552: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.7bd) [concrete]
  313. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.572: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.552 = struct_value () [concrete]
  314. // CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
  315. // CHECK:STDOUT: %facet_value.19d: %type_where = facet_value %T, () [concrete]
  316. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.d5a: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.19d) [concrete]
  317. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.24f: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.d5a = struct_value () [concrete]
  318. // CHECK:STDOUT: %ptr.b04: type = ptr_type %T [concrete]
  319. // CHECK:STDOUT: }
  320. // CHECK:STDOUT:
  321. // CHECK:STDOUT: imports {
  322. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  323. // CHECK:STDOUT: .S = %S.decl
  324. // CHECK:STDOUT: .TakesLValue = %TakesLValue.cpp_overload_set.value
  325. // CHECK:STDOUT: .T = %T.decl
  326. // CHECK:STDOUT: import Cpp//...
  327. // CHECK:STDOUT: }
  328. // CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
  329. // CHECK:STDOUT: %TakesLValue.cpp_overload_set.value: %TakesLValue.cpp_overload_set.type = cpp_overload_set_value @TakesLValue.cpp_overload_set [concrete = constants.%TakesLValue.cpp_overload_set.value]
  330. // CHECK:STDOUT: %T.decl: type = class_decl @T [concrete = constants.%T] {} {}
  331. // CHECK:STDOUT: }
  332. // CHECK:STDOUT:
  333. // CHECK:STDOUT: fn @F() {
  334. // CHECK:STDOUT: !entry:
  335. // CHECK:STDOUT: name_binding_decl {
  336. // CHECK:STDOUT: %v.patt: %pattern_type.7da = ref_binding_pattern v [concrete]
  337. // CHECK:STDOUT: %v.var_patt: %pattern_type.7da = var_pattern %v.patt [concrete]
  338. // CHECK:STDOUT: }
  339. // CHECK:STDOUT: %v.var: ref %S = var %v.var_patt
  340. // CHECK:STDOUT: %.loc8: type = splice_block %S.ref.loc8 [concrete = constants.%S] {
  341. // CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  342. // CHECK:STDOUT: %S.ref.loc8: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  343. // CHECK:STDOUT: }
  344. // CHECK:STDOUT: %v: ref %S = ref_binding v, %v.var
  345. // CHECK:STDOUT: name_binding_decl {
  346. // CHECK:STDOUT: %s.patt: %pattern_type.7da = value_binding_pattern s [concrete]
  347. // CHECK:STDOUT: }
  348. // CHECK:STDOUT: %v.ref: ref %S = name_ref v, %v
  349. // CHECK:STDOUT: %.loc9_13: type = splice_block %S.ref.loc9 [concrete = constants.%S] {
  350. // CHECK:STDOUT: %Cpp.ref.loc9: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  351. // CHECK:STDOUT: %S.ref.loc9: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  352. // CHECK:STDOUT: }
  353. // CHECK:STDOUT: %.loc9_18: %S = acquire_value %v.ref
  354. // CHECK:STDOUT: %s: %S = value_binding s, %.loc9_18
  355. // CHECK:STDOUT: %Cpp.ref.loc18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  356. // CHECK:STDOUT: %TakesLValue.ref.loc18: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
  357. // CHECK:STDOUT: %s.ref.loc18: %S = name_ref s, %s
  358. // CHECK:STDOUT: %Cpp.ref.loc28_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  359. // CHECK:STDOUT: %TakesLValue.ref.loc28: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
  360. // CHECK:STDOUT: %s.ref.loc28: %S = name_ref s, %s
  361. // CHECK:STDOUT: %Cpp.ref.loc28_30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  362. // CHECK:STDOUT: %S.ref.loc28: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  363. // CHECK:STDOUT: %const.loc28: type = const_type %S.ref.loc28 [concrete = constants.%const]
  364. // CHECK:STDOUT: %.loc28_21.1: %const = as_compatible %s.ref.loc28
  365. // CHECK:STDOUT: %.loc28_21.2: %const = converted %s.ref.loc28, %.loc28_21.1
  366. // CHECK:STDOUT: name_binding_decl {
  367. // CHECK:STDOUT: %t.patt: %pattern_type.e6b = ref_binding_pattern t [concrete]
  368. // CHECK:STDOUT: %t.var_patt: %pattern_type.e6b = var_pattern %t.patt [concrete]
  369. // CHECK:STDOUT: }
  370. // CHECK:STDOUT: %t.var: ref %T = var %t.var_patt
  371. // CHECK:STDOUT: %.loc30: type = splice_block %T.ref [concrete = constants.%T] {
  372. // CHECK:STDOUT: %Cpp.ref.loc30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  373. // CHECK:STDOUT: %T.ref: type = name_ref T, imports.%T.decl [concrete = constants.%T]
  374. // CHECK:STDOUT: }
  375. // CHECK:STDOUT: %t: ref %T = ref_binding t, %t.var
  376. // CHECK:STDOUT: %Cpp.ref.loc39: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  377. // CHECK:STDOUT: %TakesLValue.ref.loc39: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
  378. // CHECK:STDOUT: %t.ref: ref %T = name_ref t, %t
  379. // CHECK:STDOUT: name_binding_decl {
  380. // CHECK:STDOUT: %u.patt: %pattern_type.7da = ref_binding_pattern u [concrete]
  381. // CHECK:STDOUT: %u.var_patt: %pattern_type.7da = var_pattern %u.patt [concrete]
  382. // CHECK:STDOUT: }
  383. // CHECK:STDOUT: %u.var: ref %S = var %u.var_patt
  384. // CHECK:STDOUT: %.loc41: type = splice_block %S.ref.loc41 [concrete = constants.%S] {
  385. // CHECK:STDOUT: %Cpp.ref.loc41: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  386. // CHECK:STDOUT: %S.ref.loc41: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  387. // CHECK:STDOUT: }
  388. // CHECK:STDOUT: %u: ref %S = ref_binding u, %u.var
  389. // CHECK:STDOUT: %Cpp.ref.loc50_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  390. // CHECK:STDOUT: %TakesLValue.ref.loc50: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
  391. // CHECK:STDOUT: %u.ref: ref %S = name_ref u, %u
  392. // CHECK:STDOUT: %Cpp.ref.loc50_30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  393. // CHECK:STDOUT: %S.ref.loc50: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  394. // CHECK:STDOUT: %const.loc50: type = const_type %S.ref.loc50 [concrete = constants.%const]
  395. // CHECK:STDOUT: %.loc50_21.1: ref %const = as_compatible %u.ref
  396. // CHECK:STDOUT: %.loc50_21.2: ref %const = converted %u.ref, %.loc50_21.1
  397. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc41: <bound method> = bound_method %u.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.572
  398. // CHECK:STDOUT: <elided>
  399. // CHECK:STDOUT: %bound_method.loc41: <bound method> = bound_method %u.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
  400. // CHECK:STDOUT: %addr.loc41: %ptr.5c7 = addr_of %u.var
  401. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc41: init %empty_tuple.type = call %bound_method.loc41(%addr.loc41)
  402. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc30: <bound method> = bound_method %t.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.24f
  403. // CHECK:STDOUT: <elided>
  404. // CHECK:STDOUT: %bound_method.loc30: <bound method> = bound_method %t.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2
  405. // CHECK:STDOUT: %addr.loc30: %ptr.b04 = addr_of %t.var
  406. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc30: init %empty_tuple.type = call %bound_method.loc30(%addr.loc30)
  407. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %v.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.572
  408. // CHECK:STDOUT: <elided>
  409. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %v.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3
  410. // CHECK:STDOUT: %addr.loc8: %ptr.5c7 = addr_of %v.var
  411. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8)
  412. // CHECK:STDOUT: <elided>
  413. // CHECK:STDOUT: }
  414. // CHECK:STDOUT:
  415. // CHECK:STDOUT: --- call_param_rvalue_ref.carbon
  416. // CHECK:STDOUT:
  417. // CHECK:STDOUT: constants {
  418. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  419. // CHECK:STDOUT: %TakesRValue.cpp_overload_set.type: type = cpp_overload_set_type @TakesRValue.cpp_overload_set [concrete]
  420. // CHECK:STDOUT: %TakesRValue.cpp_overload_set.value: %TakesRValue.cpp_overload_set.type = cpp_overload_set_value @TakesRValue.cpp_overload_set [concrete]
  421. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  422. // CHECK:STDOUT: %S: type = class_type @S [concrete]
  423. // CHECK:STDOUT: %S.val: %S = struct_value () [concrete]
  424. // CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
  425. // CHECK:STDOUT: %TakesRValue__carbon_thunk.type: type = fn_type @TakesRValue__carbon_thunk [concrete]
  426. // CHECK:STDOUT: %TakesRValue__carbon_thunk: %TakesRValue__carbon_thunk.type = struct_value () [concrete]
  427. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  428. // CHECK:STDOUT: %facet_value: %type_where = facet_value %S, () [concrete]
  429. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.552: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  430. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.572: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.552 = struct_value () [concrete]
  431. // CHECK:STDOUT: }
  432. // CHECK:STDOUT:
  433. // CHECK:STDOUT: imports {
  434. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  435. // CHECK:STDOUT: .TakesRValue = %TakesRValue.cpp_overload_set.value
  436. // CHECK:STDOUT: .S = %S.decl
  437. // CHECK:STDOUT: import Cpp//...
  438. // CHECK:STDOUT: }
  439. // CHECK:STDOUT: %TakesRValue.cpp_overload_set.value: %TakesRValue.cpp_overload_set.type = cpp_overload_set_value @TakesRValue.cpp_overload_set [concrete = constants.%TakesRValue.cpp_overload_set.value]
  440. // CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
  441. // CHECK:STDOUT: %TakesRValue__carbon_thunk.decl: %TakesRValue__carbon_thunk.type = fn_decl @TakesRValue__carbon_thunk [concrete = constants.%TakesRValue__carbon_thunk] {
  442. // CHECK:STDOUT: <elided>
  443. // CHECK:STDOUT: } {
  444. // CHECK:STDOUT: <elided>
  445. // CHECK:STDOUT: }
  446. // CHECK:STDOUT: }
  447. // CHECK:STDOUT:
  448. // CHECK:STDOUT: fn @F() {
  449. // CHECK:STDOUT: !entry:
  450. // CHECK:STDOUT: %Cpp.ref.loc8_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  451. // CHECK:STDOUT: %TakesRValue.ref: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
  452. // CHECK:STDOUT: %.loc8_20.1: %empty_struct_type = struct_literal ()
  453. // CHECK:STDOUT: %Cpp.ref.loc8_25: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  454. // CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  455. // CHECK:STDOUT: %.loc8_20.2: ref %S = temporary_storage
  456. // CHECK:STDOUT: %.loc8_20.3: init %S = class_init (), %.loc8_20.2 [concrete = constants.%S.val]
  457. // CHECK:STDOUT: %.loc8_20.4: ref %S = temporary %.loc8_20.2, %.loc8_20.3
  458. // CHECK:STDOUT: %.loc8_22.1: ref %S = converted %.loc8_20.1, %.loc8_20.4
  459. // CHECK:STDOUT: %.loc8_22.2: %S = acquire_value %.loc8_22.1
  460. // CHECK:STDOUT: %.loc8_22.3: ref %S = value_as_ref %.loc8_22.2
  461. // CHECK:STDOUT: %addr.loc8_30: %ptr.5c7 = addr_of %.loc8_22.3
  462. // CHECK:STDOUT: %TakesRValue__carbon_thunk.call: init %empty_tuple.type = call imports.%TakesRValue__carbon_thunk.decl(%addr.loc8_30)
  463. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc8_20.4, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.572
  464. // CHECK:STDOUT: <elided>
  465. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc8_20.4, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  466. // CHECK:STDOUT: %addr.loc8_20: %ptr.5c7 = addr_of %.loc8_20.4
  467. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc8_20)
  468. // CHECK:STDOUT: <elided>
  469. // CHECK:STDOUT: }
  470. // CHECK:STDOUT:
  471. // CHECK:STDOUT: --- todo_fail_param_value_arg_for_rvalue_ref.carbon
  472. // CHECK:STDOUT:
  473. // CHECK:STDOUT: constants {
  474. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  475. // CHECK:STDOUT: %S: type = class_type @S [concrete]
  476. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  477. // CHECK:STDOUT: %pattern_type.7da: type = pattern_type %S [concrete]
  478. // CHECK:STDOUT: %S.val: %S = struct_value () [concrete]
  479. // CHECK:STDOUT: %TakesRValue.cpp_overload_set.type: type = cpp_overload_set_type @TakesRValue.cpp_overload_set [concrete]
  480. // CHECK:STDOUT: %TakesRValue.cpp_overload_set.value: %TakesRValue.cpp_overload_set.type = cpp_overload_set_value @TakesRValue.cpp_overload_set [concrete]
  481. // CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
  482. // CHECK:STDOUT: %TakesRValue__carbon_thunk.type: type = fn_type @TakesRValue__carbon_thunk [concrete]
  483. // CHECK:STDOUT: %TakesRValue__carbon_thunk: %TakesRValue__carbon_thunk.type = struct_value () [concrete]
  484. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  485. // CHECK:STDOUT: %facet_value: %type_where = facet_value %S, () [concrete]
  486. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.552: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  487. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.572: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.552 = struct_value () [concrete]
  488. // CHECK:STDOUT: }
  489. // CHECK:STDOUT:
  490. // CHECK:STDOUT: imports {
  491. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  492. // CHECK:STDOUT: .S = %S.decl
  493. // CHECK:STDOUT: .TakesRValue = %TakesRValue.cpp_overload_set.value
  494. // CHECK:STDOUT: import Cpp//...
  495. // CHECK:STDOUT: }
  496. // CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
  497. // CHECK:STDOUT: %TakesRValue.cpp_overload_set.value: %TakesRValue.cpp_overload_set.type = cpp_overload_set_value @TakesRValue.cpp_overload_set [concrete = constants.%TakesRValue.cpp_overload_set.value]
  498. // CHECK:STDOUT: %TakesRValue__carbon_thunk.decl: %TakesRValue__carbon_thunk.type = fn_decl @TakesRValue__carbon_thunk [concrete = constants.%TakesRValue__carbon_thunk] {
  499. // CHECK:STDOUT: <elided>
  500. // CHECK:STDOUT: } {
  501. // CHECK:STDOUT: <elided>
  502. // CHECK:STDOUT: }
  503. // CHECK:STDOUT: }
  504. // CHECK:STDOUT:
  505. // CHECK:STDOUT: fn @F() {
  506. // CHECK:STDOUT: !entry:
  507. // CHECK:STDOUT: name_binding_decl {
  508. // CHECK:STDOUT: %s.patt: %pattern_type.7da = value_binding_pattern s [concrete]
  509. // CHECK:STDOUT: }
  510. // CHECK:STDOUT: %.loc12_19.1: %empty_struct_type = struct_literal ()
  511. // CHECK:STDOUT: %.loc12_13: type = splice_block %S.ref [concrete = constants.%S] {
  512. // CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  513. // CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  514. // CHECK:STDOUT: }
  515. // CHECK:STDOUT: %.loc12_19.2: ref %S = temporary_storage
  516. // CHECK:STDOUT: %.loc12_19.3: init %S = class_init (), %.loc12_19.2 [concrete = constants.%S.val]
  517. // CHECK:STDOUT: %.loc12_19.4: ref %S = temporary %.loc12_19.2, %.loc12_19.3
  518. // CHECK:STDOUT: %.loc12_19.5: ref %S = converted %.loc12_19.1, %.loc12_19.4
  519. // CHECK:STDOUT: %.loc12_19.6: %S = acquire_value %.loc12_19.5
  520. // CHECK:STDOUT: %s: %S = value_binding s, %.loc12_19.6
  521. // CHECK:STDOUT: %Cpp.ref.loc13: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  522. // CHECK:STDOUT: %TakesRValue.ref: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
  523. // CHECK:STDOUT: %s.ref: %S = name_ref s, %s
  524. // CHECK:STDOUT: %.loc13: ref %S = value_as_ref %s.ref
  525. // CHECK:STDOUT: %addr.loc13: %ptr.5c7 = addr_of %.loc13
  526. // CHECK:STDOUT: %TakesRValue__carbon_thunk.call: init %empty_tuple.type = call imports.%TakesRValue__carbon_thunk.decl(%addr.loc13)
  527. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc12_19.4, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.572
  528. // CHECK:STDOUT: <elided>
  529. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc12_19.4, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  530. // CHECK:STDOUT: %addr.loc12: %ptr.5c7 = addr_of %.loc12_19.4
  531. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc12)
  532. // CHECK:STDOUT: <elided>
  533. // CHECK:STDOUT: }
  534. // CHECK:STDOUT:
  535. // CHECK:STDOUT: --- fail_param_rvalue_ref.carbon
  536. // CHECK:STDOUT:
  537. // CHECK:STDOUT: constants {
  538. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  539. // CHECK:STDOUT: %S: type = class_type @S [concrete]
  540. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  541. // CHECK:STDOUT: %pattern_type.7da: type = pattern_type %S [concrete]
  542. // CHECK:STDOUT: %TakesRValue.cpp_overload_set.type: type = cpp_overload_set_type @TakesRValue.cpp_overload_set [concrete]
  543. // CHECK:STDOUT: %TakesRValue.cpp_overload_set.value: %TakesRValue.cpp_overload_set.type = cpp_overload_set_value @TakesRValue.cpp_overload_set [concrete]
  544. // CHECK:STDOUT: %T: type = class_type @T [concrete]
  545. // CHECK:STDOUT: %pattern_type.e6b: type = pattern_type %T [concrete]
  546. // CHECK:STDOUT: %S.val: %S = struct_value () [concrete]
  547. // CHECK:STDOUT: %const: type = const_type %S [concrete]
  548. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  549. // CHECK:STDOUT: %facet_value.7bd: %type_where = facet_value %S, () [concrete]
  550. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.552: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.7bd) [concrete]
  551. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.572: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.552 = struct_value () [concrete]
  552. // CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
  553. // CHECK:STDOUT: %facet_value.19d: %type_where = facet_value %T, () [concrete]
  554. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.d5a: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.19d) [concrete]
  555. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.24f: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.d5a = struct_value () [concrete]
  556. // CHECK:STDOUT: %ptr.b04: type = ptr_type %T [concrete]
  557. // CHECK:STDOUT: }
  558. // CHECK:STDOUT:
  559. // CHECK:STDOUT: imports {
  560. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  561. // CHECK:STDOUT: .S = %S.decl
  562. // CHECK:STDOUT: .TakesRValue = %TakesRValue.cpp_overload_set.value
  563. // CHECK:STDOUT: .T = %T.decl
  564. // CHECK:STDOUT: import Cpp//...
  565. // CHECK:STDOUT: }
  566. // CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
  567. // CHECK:STDOUT: %TakesRValue.cpp_overload_set.value: %TakesRValue.cpp_overload_set.type = cpp_overload_set_value @TakesRValue.cpp_overload_set [concrete = constants.%TakesRValue.cpp_overload_set.value]
  568. // CHECK:STDOUT: %T.decl: type = class_decl @T [concrete = constants.%T] {} {}
  569. // CHECK:STDOUT: }
  570. // CHECK:STDOUT:
  571. // CHECK:STDOUT: fn @F() {
  572. // CHECK:STDOUT: !entry:
  573. // CHECK:STDOUT: name_binding_decl {
  574. // CHECK:STDOUT: %s.patt: %pattern_type.7da = ref_binding_pattern s [concrete]
  575. // CHECK:STDOUT: %s.var_patt: %pattern_type.7da = var_pattern %s.patt [concrete]
  576. // CHECK:STDOUT: }
  577. // CHECK:STDOUT: %s.var: ref %S = var %s.var_patt
  578. // CHECK:STDOUT: %.loc8: type = splice_block %S.ref.loc8 [concrete = constants.%S] {
  579. // CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  580. // CHECK:STDOUT: %S.ref.loc8: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  581. // CHECK:STDOUT: }
  582. // CHECK:STDOUT: %s: ref %S = ref_binding s, %s.var
  583. // CHECK:STDOUT: %Cpp.ref.loc17: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  584. // CHECK:STDOUT: %TakesRValue.ref.loc17: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
  585. // CHECK:STDOUT: %s.ref: ref %S = name_ref s, %s
  586. // CHECK:STDOUT: name_binding_decl {
  587. // CHECK:STDOUT: %t.patt: %pattern_type.e6b = ref_binding_pattern t [concrete]
  588. // CHECK:STDOUT: %t.var_patt: %pattern_type.e6b = var_pattern %t.patt [concrete]
  589. // CHECK:STDOUT: }
  590. // CHECK:STDOUT: %t.var: ref %T = var %t.var_patt
  591. // CHECK:STDOUT: %.loc19: type = splice_block %T.ref [concrete = constants.%T] {
  592. // CHECK:STDOUT: %Cpp.ref.loc19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  593. // CHECK:STDOUT: %T.ref: type = name_ref T, imports.%T.decl [concrete = constants.%T]
  594. // CHECK:STDOUT: }
  595. // CHECK:STDOUT: %t: ref %T = ref_binding t, %t.var
  596. // CHECK:STDOUT: %Cpp.ref.loc28: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  597. // CHECK:STDOUT: %TakesRValue.ref.loc28: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
  598. // CHECK:STDOUT: %t.ref: ref %T = name_ref t, %t
  599. // CHECK:STDOUT: %Cpp.ref.loc38_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  600. // CHECK:STDOUT: %TakesRValue.ref.loc38: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
  601. // CHECK:STDOUT: %.loc38_21.1: %empty_struct_type = struct_literal ()
  602. // CHECK:STDOUT: %Cpp.ref.loc38_26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  603. // CHECK:STDOUT: %S.ref.loc38_29: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  604. // CHECK:STDOUT: %.loc38_21.2: ref %S = temporary_storage
  605. // CHECK:STDOUT: %.loc38_21.3: init %S = class_init (), %.loc38_21.2 [concrete = constants.%S.val]
  606. // CHECK:STDOUT: %.loc38_21.4: ref %S = temporary %.loc38_21.2, %.loc38_21.3
  607. // CHECK:STDOUT: %.loc38_23: ref %S = converted %.loc38_21.1, %.loc38_21.4
  608. // CHECK:STDOUT: %Cpp.ref.loc38_42: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  609. // CHECK:STDOUT: %S.ref.loc38_45: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  610. // CHECK:STDOUT: %const: type = const_type %S.ref.loc38_45 [concrete = constants.%const]
  611. // CHECK:STDOUT: %.loc38_33.1: ref %const = as_compatible %.loc38_23
  612. // CHECK:STDOUT: %.loc38_33.2: ref %const = converted %.loc38_23, %.loc38_33.1
  613. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc38: <bound method> = bound_method %.loc38_21.4, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.572
  614. // CHECK:STDOUT: <elided>
  615. // CHECK:STDOUT: %bound_method.loc38: <bound method> = bound_method %.loc38_21.4, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
  616. // CHECK:STDOUT: %addr.loc38: %ptr.5c7 = addr_of %.loc38_21.4
  617. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc38: init %empty_tuple.type = call %bound_method.loc38(%addr.loc38)
  618. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc19: <bound method> = bound_method %t.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.24f
  619. // CHECK:STDOUT: <elided>
  620. // CHECK:STDOUT: %bound_method.loc19: <bound method> = bound_method %t.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2
  621. // CHECK:STDOUT: %addr.loc19: %ptr.b04 = addr_of %t.var
  622. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc19: init %empty_tuple.type = call %bound_method.loc19(%addr.loc19)
  623. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %s.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.572
  624. // CHECK:STDOUT: <elided>
  625. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %s.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3
  626. // CHECK:STDOUT: %addr.loc8: %ptr.5c7 = addr_of %s.var
  627. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8(%addr.loc8)
  628. // CHECK:STDOUT: <elided>
  629. // CHECK:STDOUT: }
  630. // CHECK:STDOUT:
  631. // CHECK:STDOUT: --- call_param_const_lvalue_ref_with_ref.carbon
  632. // CHECK:STDOUT:
  633. // CHECK:STDOUT: constants {
  634. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  635. // CHECK:STDOUT: %S: type = class_type @S [concrete]
  636. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  637. // CHECK:STDOUT: %pattern_type.7da: type = pattern_type %S [concrete]
  638. // CHECK:STDOUT: %S.val: %S = struct_value () [concrete]
  639. // CHECK:STDOUT: %TakesConstLValue.cpp_overload_set.type: type = cpp_overload_set_type @TakesConstLValue.cpp_overload_set [concrete]
  640. // CHECK:STDOUT: %TakesConstLValue.cpp_overload_set.value: %TakesConstLValue.cpp_overload_set.type = cpp_overload_set_value @TakesConstLValue.cpp_overload_set [concrete]
  641. // CHECK:STDOUT: %const: type = const_type %S [concrete]
  642. // CHECK:STDOUT: %ptr.ff5: type = ptr_type %const [concrete]
  643. // CHECK:STDOUT: %TakesConstLValue__carbon_thunk.type: type = fn_type @TakesConstLValue__carbon_thunk [concrete]
  644. // CHECK:STDOUT: %TakesConstLValue__carbon_thunk: %TakesConstLValue__carbon_thunk.type = struct_value () [concrete]
  645. // CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
  646. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  647. // CHECK:STDOUT: %facet_value: %type_where = facet_value %S, () [concrete]
  648. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.552: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  649. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.572: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.552 = struct_value () [concrete]
  650. // CHECK:STDOUT: }
  651. // CHECK:STDOUT:
  652. // CHECK:STDOUT: imports {
  653. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  654. // CHECK:STDOUT: .S = %S.decl
  655. // CHECK:STDOUT: .TakesConstLValue = %TakesConstLValue.cpp_overload_set.value
  656. // CHECK:STDOUT: import Cpp//...
  657. // CHECK:STDOUT: }
  658. // CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
  659. // CHECK:STDOUT: %TakesConstLValue.cpp_overload_set.value: %TakesConstLValue.cpp_overload_set.type = cpp_overload_set_value @TakesConstLValue.cpp_overload_set [concrete = constants.%TakesConstLValue.cpp_overload_set.value]
  660. // CHECK:STDOUT: %TakesConstLValue__carbon_thunk.decl: %TakesConstLValue__carbon_thunk.type = fn_decl @TakesConstLValue__carbon_thunk [concrete = constants.%TakesConstLValue__carbon_thunk] {
  661. // CHECK:STDOUT: <elided>
  662. // CHECK:STDOUT: } {
  663. // CHECK:STDOUT: <elided>
  664. // CHECK:STDOUT: }
  665. // CHECK:STDOUT: }
  666. // CHECK:STDOUT:
  667. // CHECK:STDOUT: fn @F() {
  668. // CHECK:STDOUT: !entry:
  669. // CHECK:STDOUT: name_binding_decl {
  670. // CHECK:STDOUT: %s.patt: %pattern_type.7da = ref_binding_pattern s [concrete]
  671. // CHECK:STDOUT: %s.var_patt: %pattern_type.7da = var_pattern %s.patt [concrete]
  672. // CHECK:STDOUT: }
  673. // CHECK:STDOUT: %s.var: ref %S = var %s.var_patt
  674. // CHECK:STDOUT: %.loc8_19.1: %empty_struct_type = struct_literal ()
  675. // CHECK:STDOUT: %.loc8_19.2: init %S = class_init (), %s.var [concrete = constants.%S.val]
  676. // CHECK:STDOUT: %.loc8_3: init %S = converted %.loc8_19.1, %.loc8_19.2 [concrete = constants.%S.val]
  677. // CHECK:STDOUT: assign %s.var, %.loc8_3
  678. // CHECK:STDOUT: %.loc8_13: type = splice_block %S.ref.loc8 [concrete = constants.%S] {
  679. // CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  680. // CHECK:STDOUT: %S.ref.loc8: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  681. // CHECK:STDOUT: }
  682. // CHECK:STDOUT: %s: ref %S = ref_binding s, %s.var
  683. // CHECK:STDOUT: %Cpp.ref.loc9_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  684. // CHECK:STDOUT: %TakesConstLValue.ref.loc9: %TakesConstLValue.cpp_overload_set.type = name_ref TakesConstLValue, imports.%TakesConstLValue.cpp_overload_set.value [concrete = constants.%TakesConstLValue.cpp_overload_set.value]
  685. // CHECK:STDOUT: %s.ref.loc9: ref %S = name_ref s, %s
  686. // CHECK:STDOUT: %Cpp.ref.loc9_35: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  687. // CHECK:STDOUT: %S.ref.loc9: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  688. // CHECK:STDOUT: %const: type = const_type %S.ref.loc9 [concrete = constants.%const]
  689. // CHECK:STDOUT: %.loc9_26.1: ref %const = as_compatible %s.ref.loc9
  690. // CHECK:STDOUT: %.loc9_26.2: ref %const = converted %s.ref.loc9, %.loc9_26.1
  691. // CHECK:STDOUT: %.loc9_26.3: ref %S = as_compatible %.loc9_26.2
  692. // CHECK:STDOUT: %.loc9_26.4: ref %S = converted %.loc9_26.2, %.loc9_26.3
  693. // CHECK:STDOUT: %.loc9_26.5: %S = acquire_value %.loc9_26.4
  694. // CHECK:STDOUT: %.loc9_26.6: ref %S = value_as_ref %.loc9_26.5
  695. // CHECK:STDOUT: %addr.loc9: %ptr.5c7 = addr_of %.loc9_26.6
  696. // CHECK:STDOUT: %.loc9_40.1: %ptr.ff5 = as_compatible %addr.loc9
  697. // CHECK:STDOUT: %.loc9_40.2: %ptr.ff5 = converted %addr.loc9, %.loc9_40.1
  698. // CHECK:STDOUT: %TakesConstLValue__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%TakesConstLValue__carbon_thunk.decl(%.loc9_40.2)
  699. // CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  700. // CHECK:STDOUT: %TakesConstLValue.ref.loc11: %TakesConstLValue.cpp_overload_set.type = name_ref TakesConstLValue, imports.%TakesConstLValue.cpp_overload_set.value [concrete = constants.%TakesConstLValue.cpp_overload_set.value]
  701. // CHECK:STDOUT: %s.ref.loc11: ref %S = name_ref s, %s
  702. // CHECK:STDOUT: %.loc11_24.1: %S = acquire_value %s.ref.loc11
  703. // CHECK:STDOUT: %.loc11_24.2: ref %S = value_as_ref %.loc11_24.1
  704. // CHECK:STDOUT: %addr.loc11: %ptr.5c7 = addr_of %.loc11_24.2
  705. // CHECK:STDOUT: %.loc11_25.1: %ptr.ff5 = as_compatible %addr.loc11
  706. // CHECK:STDOUT: %.loc11_25.2: %ptr.ff5 = converted %addr.loc11, %.loc11_25.1
  707. // CHECK:STDOUT: %TakesConstLValue__carbon_thunk.call.loc11: init %empty_tuple.type = call imports.%TakesConstLValue__carbon_thunk.decl(%.loc11_25.2)
  708. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %s.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.572
  709. // CHECK:STDOUT: <elided>
  710. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %s.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  711. // CHECK:STDOUT: %addr.loc8: %ptr.5c7 = addr_of %s.var
  712. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc8)
  713. // CHECK:STDOUT: <elided>
  714. // CHECK:STDOUT: }
  715. // CHECK:STDOUT:
  716. // CHECK:STDOUT: --- call_param_const_lvalue_ref_with_value.carbon
  717. // CHECK:STDOUT:
  718. // CHECK:STDOUT: constants {
  719. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  720. // CHECK:STDOUT: %S: type = class_type @S [concrete]
  721. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  722. // CHECK:STDOUT: %pattern_type.7da: type = pattern_type %S [concrete]
  723. // CHECK:STDOUT: %S.val: %S = struct_value () [concrete]
  724. // CHECK:STDOUT: %TakesConstLValue.cpp_overload_set.type: type = cpp_overload_set_type @TakesConstLValue.cpp_overload_set [concrete]
  725. // CHECK:STDOUT: %TakesConstLValue.cpp_overload_set.value: %TakesConstLValue.cpp_overload_set.type = cpp_overload_set_value @TakesConstLValue.cpp_overload_set [concrete]
  726. // CHECK:STDOUT: %const: type = const_type %S [concrete]
  727. // CHECK:STDOUT: %ptr.ff5: type = ptr_type %const [concrete]
  728. // CHECK:STDOUT: %TakesConstLValue__carbon_thunk.type: type = fn_type @TakesConstLValue__carbon_thunk [concrete]
  729. // CHECK:STDOUT: %TakesConstLValue__carbon_thunk: %TakesConstLValue__carbon_thunk.type = struct_value () [concrete]
  730. // CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
  731. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  732. // CHECK:STDOUT: %facet_value: %type_where = facet_value %S, () [concrete]
  733. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.552: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  734. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.572: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.552 = struct_value () [concrete]
  735. // CHECK:STDOUT: }
  736. // CHECK:STDOUT:
  737. // CHECK:STDOUT: imports {
  738. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  739. // CHECK:STDOUT: .S = %S.decl
  740. // CHECK:STDOUT: .TakesConstLValue = %TakesConstLValue.cpp_overload_set.value
  741. // CHECK:STDOUT: import Cpp//...
  742. // CHECK:STDOUT: }
  743. // CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
  744. // CHECK:STDOUT: %TakesConstLValue.cpp_overload_set.value: %TakesConstLValue.cpp_overload_set.type = cpp_overload_set_value @TakesConstLValue.cpp_overload_set [concrete = constants.%TakesConstLValue.cpp_overload_set.value]
  745. // CHECK:STDOUT: %TakesConstLValue__carbon_thunk.decl: %TakesConstLValue__carbon_thunk.type = fn_decl @TakesConstLValue__carbon_thunk [concrete = constants.%TakesConstLValue__carbon_thunk] {
  746. // CHECK:STDOUT: <elided>
  747. // CHECK:STDOUT: } {
  748. // CHECK:STDOUT: <elided>
  749. // CHECK:STDOUT: }
  750. // CHECK:STDOUT: }
  751. // CHECK:STDOUT:
  752. // CHECK:STDOUT: fn @F() {
  753. // CHECK:STDOUT: !entry:
  754. // CHECK:STDOUT: name_binding_decl {
  755. // CHECK:STDOUT: %s.patt: %pattern_type.7da = value_binding_pattern s [concrete]
  756. // CHECK:STDOUT: }
  757. // CHECK:STDOUT: %.loc8_19.1: %empty_struct_type = struct_literal ()
  758. // CHECK:STDOUT: %.loc8_13: type = splice_block %S.ref.loc8 [concrete = constants.%S] {
  759. // CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  760. // CHECK:STDOUT: %S.ref.loc8: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  761. // CHECK:STDOUT: }
  762. // CHECK:STDOUT: %.loc8_19.2: ref %S = temporary_storage
  763. // CHECK:STDOUT: %.loc8_19.3: init %S = class_init (), %.loc8_19.2 [concrete = constants.%S.val]
  764. // CHECK:STDOUT: %.loc8_19.4: ref %S = temporary %.loc8_19.2, %.loc8_19.3
  765. // CHECK:STDOUT: %.loc8_19.5: ref %S = converted %.loc8_19.1, %.loc8_19.4
  766. // CHECK:STDOUT: %.loc8_19.6: %S = acquire_value %.loc8_19.5
  767. // CHECK:STDOUT: %s: %S = value_binding s, %.loc8_19.6
  768. // CHECK:STDOUT: %Cpp.ref.loc9: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  769. // CHECK:STDOUT: %TakesConstLValue.ref.loc9: %TakesConstLValue.cpp_overload_set.type = name_ref TakesConstLValue, imports.%TakesConstLValue.cpp_overload_set.value [concrete = constants.%TakesConstLValue.cpp_overload_set.value]
  770. // CHECK:STDOUT: %s.ref.loc9: %S = name_ref s, %s
  771. // CHECK:STDOUT: %.loc9_24: ref %S = value_as_ref %s.ref.loc9
  772. // CHECK:STDOUT: %addr.loc9: %ptr.5c7 = addr_of %.loc9_24
  773. // CHECK:STDOUT: %.loc9_25.1: %ptr.ff5 = as_compatible %addr.loc9
  774. // CHECK:STDOUT: %.loc9_25.2: %ptr.ff5 = converted %addr.loc9, %.loc9_25.1
  775. // CHECK:STDOUT: %TakesConstLValue__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%TakesConstLValue__carbon_thunk.decl(%.loc9_25.2)
  776. // CHECK:STDOUT: %Cpp.ref.loc11_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  777. // CHECK:STDOUT: %TakesConstLValue.ref.loc11: %TakesConstLValue.cpp_overload_set.type = name_ref TakesConstLValue, imports.%TakesConstLValue.cpp_overload_set.value [concrete = constants.%TakesConstLValue.cpp_overload_set.value]
  778. // CHECK:STDOUT: %s.ref.loc11: %S = name_ref s, %s
  779. // CHECK:STDOUT: %Cpp.ref.loc11_35: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  780. // CHECK:STDOUT: %S.ref.loc11: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  781. // CHECK:STDOUT: %const: type = const_type %S.ref.loc11 [concrete = constants.%const]
  782. // CHECK:STDOUT: %.loc11_26.1: %const = as_compatible %s.ref.loc11
  783. // CHECK:STDOUT: %.loc11_26.2: %const = converted %s.ref.loc11, %.loc11_26.1
  784. // CHECK:STDOUT: %.loc11_26.3: %S = as_compatible %.loc11_26.2
  785. // CHECK:STDOUT: %.loc11_26.4: %S = converted %.loc11_26.2, %.loc11_26.3
  786. // CHECK:STDOUT: %.loc11_26.5: ref %S = value_as_ref %.loc11_26.4
  787. // CHECK:STDOUT: %addr.loc11: %ptr.5c7 = addr_of %.loc11_26.5
  788. // CHECK:STDOUT: %.loc11_40.1: %ptr.ff5 = as_compatible %addr.loc11
  789. // CHECK:STDOUT: %.loc11_40.2: %ptr.ff5 = converted %addr.loc11, %.loc11_40.1
  790. // CHECK:STDOUT: %TakesConstLValue__carbon_thunk.call.loc11: init %empty_tuple.type = call imports.%TakesConstLValue__carbon_thunk.decl(%.loc11_40.2)
  791. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc8_19.4, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.572
  792. // CHECK:STDOUT: <elided>
  793. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc8_19.4, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  794. // CHECK:STDOUT: %addr.loc8: %ptr.5c7 = addr_of %.loc8_19.4
  795. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc8)
  796. // CHECK:STDOUT: <elided>
  797. // CHECK:STDOUT: }
  798. // CHECK:STDOUT:
  799. // CHECK:STDOUT: --- call_return_lvalue_ref.carbon
  800. // CHECK:STDOUT:
  801. // CHECK:STDOUT: constants {
  802. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  803. // CHECK:STDOUT: %S: type = class_type @S [concrete]
  804. // CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
  805. // CHECK:STDOUT: %pattern_type.259: type = pattern_type %ptr.5c7 [concrete]
  806. // CHECK:STDOUT: %ReturnsLValue.cpp_overload_set.type: type = cpp_overload_set_type @ReturnsLValue.cpp_overload_set [concrete]
  807. // CHECK:STDOUT: %ReturnsLValue.cpp_overload_set.value: %ReturnsLValue.cpp_overload_set.type = cpp_overload_set_value @ReturnsLValue.cpp_overload_set [concrete]
  808. // CHECK:STDOUT: %const: type = const_type %ptr.5c7 [concrete]
  809. // CHECK:STDOUT: %ReturnsLValue.type: type = fn_type @ReturnsLValue [concrete]
  810. // CHECK:STDOUT: %ReturnsLValue: %ReturnsLValue.type = struct_value () [concrete]
  811. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  812. // CHECK:STDOUT: %facet_value: %type_where = facet_value %ptr.5c7, () [concrete]
  813. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.7f4: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  814. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.d4c: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.7f4 = struct_value () [concrete]
  815. // CHECK:STDOUT: %ptr.dfe: type = ptr_type %ptr.5c7 [concrete]
  816. // CHECK:STDOUT: }
  817. // CHECK:STDOUT:
  818. // CHECK:STDOUT: imports {
  819. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  820. // CHECK:STDOUT: .S = %S.decl
  821. // CHECK:STDOUT: .ReturnsLValue = %ReturnsLValue.cpp_overload_set.value
  822. // CHECK:STDOUT: import Cpp//...
  823. // CHECK:STDOUT: }
  824. // CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
  825. // CHECK:STDOUT: %ReturnsLValue.cpp_overload_set.value: %ReturnsLValue.cpp_overload_set.type = cpp_overload_set_value @ReturnsLValue.cpp_overload_set [concrete = constants.%ReturnsLValue.cpp_overload_set.value]
  826. // CHECK:STDOUT: %ReturnsLValue.decl: %ReturnsLValue.type = fn_decl @ReturnsLValue [concrete = constants.%ReturnsLValue] {
  827. // CHECK:STDOUT: <elided>
  828. // CHECK:STDOUT: } {
  829. // CHECK:STDOUT: <elided>
  830. // CHECK:STDOUT: }
  831. // CHECK:STDOUT: }
  832. // CHECK:STDOUT:
  833. // CHECK:STDOUT: fn @F() {
  834. // CHECK:STDOUT: !entry:
  835. // CHECK:STDOUT: name_binding_decl {
  836. // CHECK:STDOUT: %s.patt: %pattern_type.259 = value_binding_pattern s [concrete]
  837. // CHECK:STDOUT: }
  838. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  839. // CHECK:STDOUT: %ReturnsLValue.ref: %ReturnsLValue.cpp_overload_set.type = name_ref ReturnsLValue, imports.%ReturnsLValue.cpp_overload_set.value [concrete = constants.%ReturnsLValue.cpp_overload_set.value]
  840. // CHECK:STDOUT: %ReturnsLValue.call: init %const = call imports.%ReturnsLValue.decl()
  841. // CHECK:STDOUT: %.loc8_15: type = splice_block %ptr [concrete = constants.%ptr.5c7] {
  842. // CHECK:STDOUT: %Cpp.ref.loc8_10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  843. // CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  844. // CHECK:STDOUT: %ptr: type = ptr_type %S.ref [concrete = constants.%ptr.5c7]
  845. // CHECK:STDOUT: }
  846. // CHECK:STDOUT: %.loc8_37.1: init %ptr.5c7 = as_compatible %ReturnsLValue.call
  847. // CHECK:STDOUT: %.loc8_37.2: init %ptr.5c7 = converted %ReturnsLValue.call, %.loc8_37.1
  848. // CHECK:STDOUT: %.loc8_37.3: ref %ptr.5c7 = temporary_storage
  849. // CHECK:STDOUT: %.loc8_37.4: ref %ptr.5c7 = temporary %.loc8_37.3, %.loc8_37.2
  850. // CHECK:STDOUT: %.loc8_37.5: %ptr.5c7 = acquire_value %.loc8_37.4
  851. // CHECK:STDOUT: %s: %ptr.5c7 = value_binding s, %.loc8_37.5
  852. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc8_37.4, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.d4c
  853. // CHECK:STDOUT: <elided>
  854. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc8_37.4, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  855. // CHECK:STDOUT: %addr: %ptr.dfe = addr_of %.loc8_37.4
  856. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  857. // CHECK:STDOUT: <elided>
  858. // CHECK:STDOUT: }
  859. // CHECK:STDOUT:
  860. // CHECK:STDOUT: --- call_return_rvalue_ref.carbon
  861. // CHECK:STDOUT:
  862. // CHECK:STDOUT: constants {
  863. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  864. // CHECK:STDOUT: %S: type = class_type @S [concrete]
  865. // CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
  866. // CHECK:STDOUT: %pattern_type.259: type = pattern_type %ptr.5c7 [concrete]
  867. // CHECK:STDOUT: %ReturnsRValue.cpp_overload_set.type: type = cpp_overload_set_type @ReturnsRValue.cpp_overload_set [concrete]
  868. // CHECK:STDOUT: %ReturnsRValue.cpp_overload_set.value: %ReturnsRValue.cpp_overload_set.type = cpp_overload_set_value @ReturnsRValue.cpp_overload_set [concrete]
  869. // CHECK:STDOUT: %const: type = const_type %ptr.5c7 [concrete]
  870. // CHECK:STDOUT: %ReturnsRValue.type: type = fn_type @ReturnsRValue [concrete]
  871. // CHECK:STDOUT: %ReturnsRValue: %ReturnsRValue.type = struct_value () [concrete]
  872. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  873. // CHECK:STDOUT: %facet_value: %type_where = facet_value %ptr.5c7, () [concrete]
  874. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.7f4: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  875. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.d4c: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.7f4 = struct_value () [concrete]
  876. // CHECK:STDOUT: %ptr.dfe: type = ptr_type %ptr.5c7 [concrete]
  877. // CHECK:STDOUT: }
  878. // CHECK:STDOUT:
  879. // CHECK:STDOUT: imports {
  880. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  881. // CHECK:STDOUT: .S = %S.decl
  882. // CHECK:STDOUT: .ReturnsRValue = %ReturnsRValue.cpp_overload_set.value
  883. // CHECK:STDOUT: import Cpp//...
  884. // CHECK:STDOUT: }
  885. // CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
  886. // CHECK:STDOUT: %ReturnsRValue.cpp_overload_set.value: %ReturnsRValue.cpp_overload_set.type = cpp_overload_set_value @ReturnsRValue.cpp_overload_set [concrete = constants.%ReturnsRValue.cpp_overload_set.value]
  887. // CHECK:STDOUT: %ReturnsRValue.decl: %ReturnsRValue.type = fn_decl @ReturnsRValue [concrete = constants.%ReturnsRValue] {
  888. // CHECK:STDOUT: <elided>
  889. // CHECK:STDOUT: } {
  890. // CHECK:STDOUT: <elided>
  891. // CHECK:STDOUT: }
  892. // CHECK:STDOUT: }
  893. // CHECK:STDOUT:
  894. // CHECK:STDOUT: fn @F() {
  895. // CHECK:STDOUT: !entry:
  896. // CHECK:STDOUT: name_binding_decl {
  897. // CHECK:STDOUT: %s.patt: %pattern_type.259 = ref_binding_pattern s [concrete]
  898. // CHECK:STDOUT: %s.var_patt: %pattern_type.259 = var_pattern %s.patt [concrete]
  899. // CHECK:STDOUT: }
  900. // CHECK:STDOUT: %s.var: ref %ptr.5c7 = var %s.var_patt
  901. // CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  902. // CHECK:STDOUT: %ReturnsRValue.ref: %ReturnsRValue.cpp_overload_set.type = name_ref ReturnsRValue, imports.%ReturnsRValue.cpp_overload_set.value [concrete = constants.%ReturnsRValue.cpp_overload_set.value]
  903. // CHECK:STDOUT: %ReturnsRValue.call: init %const = call imports.%ReturnsRValue.decl()
  904. // CHECK:STDOUT: %.loc8_3.1: init %ptr.5c7 = as_compatible %ReturnsRValue.call
  905. // CHECK:STDOUT: %.loc8_3.2: init %ptr.5c7 = converted %ReturnsRValue.call, %.loc8_3.1
  906. // CHECK:STDOUT: assign %s.var, %.loc8_3.2
  907. // CHECK:STDOUT: %.loc8_15: type = splice_block %ptr [concrete = constants.%ptr.5c7] {
  908. // CHECK:STDOUT: %Cpp.ref.loc8_10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  909. // CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  910. // CHECK:STDOUT: %ptr: type = ptr_type %S.ref [concrete = constants.%ptr.5c7]
  911. // CHECK:STDOUT: }
  912. // CHECK:STDOUT: %s: ref %ptr.5c7 = ref_binding s, %s.var
  913. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %s.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.d4c
  914. // CHECK:STDOUT: <elided>
  915. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %s.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  916. // CHECK:STDOUT: %addr: %ptr.dfe = addr_of %s.var
  917. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  918. // CHECK:STDOUT: <elided>
  919. // CHECK:STDOUT: }
  920. // CHECK:STDOUT:
  921. // CHECK:STDOUT: --- call_return_const_lvalue_ref.carbon
  922. // CHECK:STDOUT:
  923. // CHECK:STDOUT: constants {
  924. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  925. // CHECK:STDOUT: %S: type = class_type @S [concrete]
  926. // CHECK:STDOUT: %const.e39: type = const_type %S [concrete]
  927. // CHECK:STDOUT: %ptr.ff5: type = ptr_type %const.e39 [concrete]
  928. // CHECK:STDOUT: %pattern_type.32f: type = pattern_type %ptr.ff5 [concrete]
  929. // CHECK:STDOUT: %ReturnConstLValue.cpp_overload_set.type: type = cpp_overload_set_type @ReturnConstLValue.cpp_overload_set [concrete]
  930. // CHECK:STDOUT: %ReturnConstLValue.cpp_overload_set.value: %ReturnConstLValue.cpp_overload_set.type = cpp_overload_set_value @ReturnConstLValue.cpp_overload_set [concrete]
  931. // CHECK:STDOUT: %const.179: type = const_type %ptr.ff5 [concrete]
  932. // CHECK:STDOUT: %ReturnConstLValue.type: type = fn_type @ReturnConstLValue [concrete]
  933. // CHECK:STDOUT: %ReturnConstLValue: %ReturnConstLValue.type = struct_value () [concrete]
  934. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  935. // CHECK:STDOUT: %facet_value: %type_where = facet_value %ptr.ff5, () [concrete]
  936. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a58: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  937. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.df0: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.a58 = struct_value () [concrete]
  938. // CHECK:STDOUT: %ptr.dec: type = ptr_type %ptr.ff5 [concrete]
  939. // CHECK:STDOUT: }
  940. // CHECK:STDOUT:
  941. // CHECK:STDOUT: imports {
  942. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  943. // CHECK:STDOUT: .S = %S.decl
  944. // CHECK:STDOUT: .ReturnConstLValue = %ReturnConstLValue.cpp_overload_set.value
  945. // CHECK:STDOUT: import Cpp//...
  946. // CHECK:STDOUT: }
  947. // CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
  948. // CHECK:STDOUT: %ReturnConstLValue.cpp_overload_set.value: %ReturnConstLValue.cpp_overload_set.type = cpp_overload_set_value @ReturnConstLValue.cpp_overload_set [concrete = constants.%ReturnConstLValue.cpp_overload_set.value]
  949. // CHECK:STDOUT: %ReturnConstLValue.decl: %ReturnConstLValue.type = fn_decl @ReturnConstLValue [concrete = constants.%ReturnConstLValue] {
  950. // CHECK:STDOUT: <elided>
  951. // CHECK:STDOUT: } {
  952. // CHECK:STDOUT: <elided>
  953. // CHECK:STDOUT: }
  954. // CHECK:STDOUT: }
  955. // CHECK:STDOUT:
  956. // CHECK:STDOUT: fn @F() {
  957. // CHECK:STDOUT: !entry:
  958. // CHECK:STDOUT: name_binding_decl {
  959. // CHECK:STDOUT: %s.patt: %pattern_type.32f = ref_binding_pattern s [concrete]
  960. // CHECK:STDOUT: %s.var_patt: %pattern_type.32f = var_pattern %s.patt [concrete]
  961. // CHECK:STDOUT: }
  962. // CHECK:STDOUT: %s.var: ref %ptr.ff5 = var %s.var_patt
  963. // CHECK:STDOUT: %Cpp.ref.loc8_25: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  964. // CHECK:STDOUT: %ReturnConstLValue.ref: %ReturnConstLValue.cpp_overload_set.type = name_ref ReturnConstLValue, imports.%ReturnConstLValue.cpp_overload_set.value [concrete = constants.%ReturnConstLValue.cpp_overload_set.value]
  965. // CHECK:STDOUT: %ReturnConstLValue.call: init %const.179 = call imports.%ReturnConstLValue.decl()
  966. // CHECK:STDOUT: %.loc8_3.1: init %ptr.ff5 = as_compatible %ReturnConstLValue.call
  967. // CHECK:STDOUT: %.loc8_3.2: init %ptr.ff5 = converted %ReturnConstLValue.call, %.loc8_3.1
  968. // CHECK:STDOUT: assign %s.var, %.loc8_3.2
  969. // CHECK:STDOUT: %.loc8_21: type = splice_block %ptr [concrete = constants.%ptr.ff5] {
  970. // CHECK:STDOUT: %Cpp.ref.loc8_16: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  971. // CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S]
  972. // CHECK:STDOUT: %const: type = const_type %S.ref [concrete = constants.%const.e39]
  973. // CHECK:STDOUT: %ptr: type = ptr_type %const [concrete = constants.%ptr.ff5]
  974. // CHECK:STDOUT: }
  975. // CHECK:STDOUT: %s: ref %ptr.ff5 = ref_binding s, %s.var
  976. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %s.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.df0
  977. // CHECK:STDOUT: <elided>
  978. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %s.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  979. // CHECK:STDOUT: %addr: %ptr.dec = addr_of %s.var
  980. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  981. // CHECK:STDOUT: <elided>
  982. // CHECK:STDOUT: }
  983. // CHECK:STDOUT: