method.carbon 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775
  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/int.carbon
  6. // EXTRA-ARGS: --clang-arg=-std=c++23
  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/class/import/method.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/class/import/method.carbon
  13. // --- object_param_qualifiers.h
  14. struct HasQualifiers {
  15. void plain();
  16. void const_this() const;
  17. void volatile_this() volatile;
  18. void ref_this() &;
  19. void const_ref_this() const&;
  20. void ref_ref_this() &&;
  21. void const_ref_ref_this() const&&;
  22. };
  23. // --- use_object_param_qualifiers.carbon
  24. library "[[@TEST_NAME]]";
  25. import Cpp library "object_param_qualifiers.h";
  26. fn Make() -> Cpp.HasQualifiers;
  27. fn F(v: Cpp.HasQualifiers, p: Cpp.HasQualifiers*) {
  28. //@dump-sem-ir-begin
  29. v.const_this();
  30. v.const_ref_this();
  31. v.const_ref_ref_this();
  32. p->plain();
  33. p->ref_this();
  34. p->const_this();
  35. p->const_ref_this();
  36. Make().plain();
  37. Make().const_this();
  38. Make().const_ref_this();
  39. Make().ref_ref_this();
  40. Make().const_ref_ref_this();
  41. //@dump-sem-ir-end
  42. }
  43. // --- fail_bad_object_param_qualifiers_by_value.carbon
  44. library "[[@TEST_NAME]]";
  45. import Cpp library "object_param_qualifiers.h";
  46. fn Value(v: Cpp.HasQualifiers) {
  47. // CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+8]]:11: error: no matching function for call to 'plain' [CppInteropParseError]
  48. // CHECK:STDERR: 15 | v.plain();
  49. // CHECK:STDERR: | ^
  50. // CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
  51. // CHECK:STDERR: ./object_param_qualifiers.h:3:8: note: candidate function not viable: 'this' argument has type 'const HasQualifiers', but method is not marked const [CppInteropParseNote]
  52. // CHECK:STDERR: 3 | void plain();
  53. // CHECK:STDERR: | ^
  54. // CHECK:STDERR:
  55. v.plain();
  56. // TODO: This should remain invalid once we support `volatile`.
  57. // CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+8]]:19: error: no matching function for call to 'volatile_this' [CppInteropParseError]
  58. // CHECK:STDERR: 26 | v.volatile_this();
  59. // CHECK:STDERR: | ^
  60. // CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE-17]]:10: in file included here [InCppInclude]
  61. // CHECK:STDERR: ./object_param_qualifiers.h:5:8: note: candidate function not viable: 'this' argument has type 'const HasQualifiers', but method is not marked const [CppInteropParseNote]
  62. // CHECK:STDERR: 5 | void volatile_this() volatile;
  63. // CHECK:STDERR: | ^
  64. // CHECK:STDERR:
  65. v.volatile_this();
  66. // CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+8]]:14: error: no matching function for call to 'ref_this' [CppInteropParseError]
  67. // CHECK:STDERR: 36 | v.ref_this();
  68. // CHECK:STDERR: | ^
  69. // CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE-27]]:10: in file included here [InCppInclude]
  70. // CHECK:STDERR: ./object_param_qualifiers.h:7:8: note: candidate function not viable: 'this' argument has type 'const HasQualifiers', but method is not marked const [CppInteropParseNote]
  71. // CHECK:STDERR: 7 | void ref_this() &;
  72. // CHECK:STDERR: | ^
  73. // CHECK:STDERR:
  74. v.ref_this();
  75. // CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+8]]:18: error: no matching function for call to 'ref_ref_this' [CppInteropParseError]
  76. // CHECK:STDERR: 46 | v.ref_ref_this();
  77. // CHECK:STDERR: | ^
  78. // CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE-37]]:10: in file included here [InCppInclude]
  79. // CHECK:STDERR: ./object_param_qualifiers.h:10:8: note: candidate function not viable: 'this' argument has type 'const HasQualifiers', but method is not marked const [CppInteropParseNote]
  80. // CHECK:STDERR: 10 | void ref_ref_this() &&;
  81. // CHECK:STDERR: | ^
  82. // CHECK:STDERR:
  83. v.ref_ref_this();
  84. }
  85. // --- fail_todo_bad_object_param_qualifiers_by_ref.carbon
  86. library "[[@TEST_NAME]]";
  87. import Cpp library "object_param_qualifiers.h";
  88. fn Ref(p: Cpp.HasQualifiers*) {
  89. // TODO: This should eventually be accepted if we support `volatile`.
  90. // CHECK:STDERR: fail_todo_bad_object_param_qualifiers_by_ref.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: object parameter type: volatile struct HasQualifiers &` [SemanticsTodo]
  91. // CHECK:STDERR: p->volatile_this();
  92. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
  93. // CHECK:STDERR:
  94. p->volatile_this();
  95. }
  96. // --- fail_bad_object_param_qualifiers_ref_ref.carbon
  97. library "[[@TEST_NAME]]";
  98. import Cpp library "object_param_qualifiers.h";
  99. fn Ref(p: Cpp.HasQualifiers*) {
  100. // CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE+8]]:19: error: no matching function for call to 'ref_ref_this' [CppInteropParseError]
  101. // CHECK:STDERR: 15 | p->ref_ref_this();
  102. // CHECK:STDERR: | ^
  103. // CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
  104. // CHECK:STDERR: ./object_param_qualifiers.h:10:8: note: candidate function not viable: expects an rvalue for object argument [CppInteropParseNote]
  105. // CHECK:STDERR: 10 | void ref_ref_this() &&;
  106. // CHECK:STDERR: | ^
  107. // CHECK:STDERR:
  108. p->ref_ref_this();
  109. // CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE+8]]:25: error: no matching function for call to 'const_ref_ref_this' [CppInteropParseError]
  110. // CHECK:STDERR: 25 | p->const_ref_ref_this();
  111. // CHECK:STDERR: | ^
  112. // CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE-16]]:10: in file included here [InCppInclude]
  113. // CHECK:STDERR: ./object_param_qualifiers.h:11:8: note: candidate function not viable: expects an rvalue for object argument [CppInteropParseNote]
  114. // CHECK:STDERR: 11 | void const_ref_ref_this() const&&;
  115. // CHECK:STDERR: | ^
  116. // CHECK:STDERR:
  117. p->const_ref_ref_this();
  118. }
  119. // --- fail_bad_object_param_qualifiers_for_temporary.carbon
  120. library "[[@TEST_NAME]]";
  121. import Cpp library "object_param_qualifiers.h";
  122. fn Make() -> Cpp.HasQualifiers;
  123. fn F() {
  124. // CHECK:STDERR: fail_bad_object_param_qualifiers_for_temporary.carbon:[[@LINE+8]]:19: error: no matching function for call to 'ref_this' [CppInteropParseError]
  125. // CHECK:STDERR: 17 | Make().ref_this();
  126. // CHECK:STDERR: | ^
  127. // CHECK:STDERR: fail_bad_object_param_qualifiers_for_temporary.carbon:[[@LINE-8]]:10: in file included here [InCppInclude]
  128. // CHECK:STDERR: ./object_param_qualifiers.h:7:8: note: candidate function not viable: expects an lvalue for object argument [CppInteropParseNote]
  129. // CHECK:STDERR: 7 | void ref_this() &;
  130. // CHECK:STDERR: | ^
  131. // CHECK:STDERR:
  132. Make().ref_this();
  133. }
  134. // --- object_param_qualifiers_overloaded.h
  135. struct NoRefQualifier {
  136. int* _Nonnull F();
  137. int F() const;
  138. void F() volatile;
  139. };
  140. struct WithRefQualifier {
  141. int* _Nonnull F() &;
  142. int F() const &;
  143. void F() volatile &;
  144. };
  145. // --- use_object_param_qualifiers_overloaded.carbon
  146. library "[[@TEST_NAME]]";
  147. import Cpp library "object_param_qualifiers_overloaded.h";
  148. fn CallFNoRefQualifier(v: Cpp.NoRefQualifier, p: Cpp.NoRefQualifier*) {
  149. //@dump-sem-ir-begin
  150. var unused a: i32 = v.F();
  151. var unused b: i32* = p->F();
  152. //@dump-sem-ir-end
  153. }
  154. fn CallFWithRefQualifier(v: Cpp.WithRefQualifier, p: Cpp.WithRefQualifier*) {
  155. //@dump-sem-ir-begin
  156. var unused a: i32 = v.F();
  157. var unused b: i32* = p->F();
  158. //@dump-sem-ir-end
  159. }
  160. // --- explicit_object_param.h
  161. struct Another {
  162. };
  163. struct ExplicitObjectParam {
  164. void F(this ExplicitObjectParam);
  165. void G(this int);
  166. void H(this Another);
  167. };
  168. // --- call_explicit_object_param.carbon
  169. library "[[@TEST_NAME]]";
  170. import Cpp library "explicit_object_param.h";
  171. fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) {
  172. //@dump-sem-ir-begin
  173. e.F();
  174. n.(Cpp.ExplicitObjectParam.G)();
  175. a.(Cpp.ExplicitObjectParam.H)();
  176. //@dump-sem-ir-end
  177. }
  178. // --- fail_call_explicit_object_param_with_unsupported_type_param.carbon
  179. library "[[@TEST_NAME]]";
  180. import Cpp inline '''
  181. struct ExplicitObjectParam {
  182. void F(this ExplicitObjectParam, _BitInt(23) x);
  183. };
  184. ''';
  185. fn Call(e: Cpp.ExplicitObjectParam) {
  186. // CHECK:STDERR: fail_call_explicit_object_param_with_unsupported_type_param.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: parameter type: _BitInt(23)` [SemanticsTodo]
  187. // CHECK:STDERR: e.(Cpp.ExplicitObjectParam.F)(1);
  188. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  189. // CHECK:STDERR:
  190. e.(Cpp.ExplicitObjectParam.F)(1);
  191. }
  192. // --- explicit_object_param_overloaded.h
  193. struct Another {
  194. };
  195. struct ExplicitObjectParam {
  196. void F(this ExplicitObjectParam);
  197. void F(this int);
  198. void F(this Another);
  199. };
  200. // --- call_explicit_object_param_overloaded.carbon
  201. library "[[@TEST_NAME]]";
  202. import Cpp library "explicit_object_param_overloaded.h";
  203. fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) {
  204. //@dump-sem-ir-begin
  205. e.F();
  206. n.(Cpp.ExplicitObjectParam.F)();
  207. a.(Cpp.ExplicitObjectParam.F)();
  208. //@dump-sem-ir-end
  209. }
  210. // CHECK:STDOUT: --- use_object_param_qualifiers.carbon
  211. // CHECK:STDOUT:
  212. // CHECK:STDOUT: constants {
  213. // CHECK:STDOUT: %HasQualifiers: type = class_type @HasQualifiers [concrete]
  214. // CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete]
  215. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  216. // CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete]
  217. // CHECK:STDOUT: %ptr.ec3: type = ptr_type %HasQualifiers [concrete]
  218. // CHECK:STDOUT: %HasQualifiers.const_this.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.const_this.cpp_overload_set [concrete]
  219. // CHECK:STDOUT: %HasQualifiers.const_this.cpp_overload_set.value: %HasQualifiers.const_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.const_this.cpp_overload_set [concrete]
  220. // CHECK:STDOUT: %const_this__carbon_thunk.type: type = fn_type @const_this__carbon_thunk [concrete]
  221. // CHECK:STDOUT: %const_this__carbon_thunk: %const_this__carbon_thunk.type = struct_value () [concrete]
  222. // CHECK:STDOUT: %HasQualifiers.const_ref_this.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.const_ref_this.cpp_overload_set [concrete]
  223. // CHECK:STDOUT: %HasQualifiers.const_ref_this.cpp_overload_set.value: %HasQualifiers.const_ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.const_ref_this.cpp_overload_set [concrete]
  224. // CHECK:STDOUT: %const_ref_this__carbon_thunk.type: type = fn_type @const_ref_this__carbon_thunk [concrete]
  225. // CHECK:STDOUT: %const_ref_this__carbon_thunk: %const_ref_this__carbon_thunk.type = struct_value () [concrete]
  226. // CHECK:STDOUT: %HasQualifiers.const_ref_ref_this.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.const_ref_ref_this.cpp_overload_set [concrete]
  227. // CHECK:STDOUT: %HasQualifiers.const_ref_ref_this.cpp_overload_set.value: %HasQualifiers.const_ref_ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.const_ref_ref_this.cpp_overload_set [concrete]
  228. // CHECK:STDOUT: %const_ref_ref_this__carbon_thunk.type: type = fn_type @const_ref_ref_this__carbon_thunk [concrete]
  229. // CHECK:STDOUT: %const_ref_ref_this__carbon_thunk: %const_ref_ref_this__carbon_thunk.type = struct_value () [concrete]
  230. // CHECK:STDOUT: %HasQualifiers.plain.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.plain.cpp_overload_set [concrete]
  231. // CHECK:STDOUT: %HasQualifiers.plain.cpp_overload_set.value: %HasQualifiers.plain.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.plain.cpp_overload_set [concrete]
  232. // CHECK:STDOUT: %HasQualifiers.plain.type: type = fn_type @HasQualifiers.plain [concrete]
  233. // CHECK:STDOUT: %HasQualifiers.plain: %HasQualifiers.plain.type = struct_value () [concrete]
  234. // CHECK:STDOUT: %HasQualifiers.ref_this.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.ref_this.cpp_overload_set [concrete]
  235. // CHECK:STDOUT: %HasQualifiers.ref_this.cpp_overload_set.value: %HasQualifiers.ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.ref_this.cpp_overload_set [concrete]
  236. // CHECK:STDOUT: %HasQualifiers.ref_this.type: type = fn_type @HasQualifiers.ref_this [concrete]
  237. // CHECK:STDOUT: %HasQualifiers.ref_this: %HasQualifiers.ref_this.type = struct_value () [concrete]
  238. // CHECK:STDOUT: %HasQualifiers.ref_ref_this.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.ref_ref_this.cpp_overload_set [concrete]
  239. // CHECK:STDOUT: %HasQualifiers.ref_ref_this.cpp_overload_set.value: %HasQualifiers.ref_ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.ref_ref_this.cpp_overload_set [concrete]
  240. // CHECK:STDOUT: %ref_ref_this__carbon_thunk.type: type = fn_type @ref_ref_this__carbon_thunk [concrete]
  241. // CHECK:STDOUT: %ref_ref_this__carbon_thunk: %ref_ref_this__carbon_thunk.type = struct_value () [concrete]
  242. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  243. // CHECK:STDOUT: %HasQualifiers.HasQualifiers.type: type = fn_type @HasQualifiers.HasQualifiers [concrete]
  244. // CHECK:STDOUT: %HasQualifiers.HasQualifiers: %HasQualifiers.HasQualifiers.type = struct_value () [concrete]
  245. // CHECK:STDOUT: %const.2b5: type = const_type %HasQualifiers [concrete]
  246. // CHECK:STDOUT: %ptr.2cb: type = ptr_type %const.2b5 [concrete]
  247. // CHECK:STDOUT: %HasQualifiers__carbon_thunk.type: type = fn_type @HasQualifiers__carbon_thunk [concrete]
  248. // CHECK:STDOUT: %HasQualifiers__carbon_thunk: %HasQualifiers__carbon_thunk.type = struct_value () [concrete]
  249. // CHECK:STDOUT: %HasQualifiers.Op.type.ec4d87.1: type = fn_type @HasQualifiers.Op.1 [concrete]
  250. // CHECK:STDOUT: %HasQualifiers.Op.567da9.1: %HasQualifiers.Op.type.ec4d87.1 = struct_value () [concrete]
  251. // CHECK:STDOUT: %custom_witness.dbb: <witness> = custom_witness (%HasQualifiers.Op.567da9.1), @Copy [concrete]
  252. // CHECK:STDOUT: %Copy.facet.717: %Copy.type = facet_value %HasQualifiers, (%custom_witness.dbb) [concrete]
  253. // CHECK:STDOUT: %Copy.WithSelf.Op.type.4bc: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.717) [concrete]
  254. // CHECK:STDOUT: %.f42: type = fn_type_with_self_type %Copy.WithSelf.Op.type.4bc, %Copy.facet.717 [concrete]
  255. // CHECK:STDOUT: %HasQualifiers.cpp_destructor.type: type = fn_type @HasQualifiers.cpp_destructor [concrete]
  256. // CHECK:STDOUT: %HasQualifiers.cpp_destructor: %HasQualifiers.cpp_destructor.type = struct_value () [concrete]
  257. // CHECK:STDOUT: %HasQualifiers.Op.type.ec4d87.2: type = fn_type @HasQualifiers.Op.2 [concrete]
  258. // CHECK:STDOUT: %HasQualifiers.Op.567da9.2: %HasQualifiers.Op.type.ec4d87.2 = struct_value () [concrete]
  259. // CHECK:STDOUT: }
  260. // CHECK:STDOUT:
  261. // CHECK:STDOUT: imports {
  262. // CHECK:STDOUT: %HasQualifiers.const_this.cpp_overload_set.value: %HasQualifiers.const_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.const_this.cpp_overload_set [concrete = constants.%HasQualifiers.const_this.cpp_overload_set.value]
  263. // CHECK:STDOUT: %const_this__carbon_thunk.decl: %const_this__carbon_thunk.type = fn_decl @const_this__carbon_thunk [concrete = constants.%const_this__carbon_thunk] {
  264. // CHECK:STDOUT: <elided>
  265. // CHECK:STDOUT: } {
  266. // CHECK:STDOUT: <elided>
  267. // CHECK:STDOUT: }
  268. // CHECK:STDOUT: %HasQualifiers.const_ref_this.cpp_overload_set.value: %HasQualifiers.const_ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.const_ref_this.cpp_overload_set [concrete = constants.%HasQualifiers.const_ref_this.cpp_overload_set.value]
  269. // CHECK:STDOUT: %const_ref_this__carbon_thunk.decl: %const_ref_this__carbon_thunk.type = fn_decl @const_ref_this__carbon_thunk [concrete = constants.%const_ref_this__carbon_thunk] {
  270. // CHECK:STDOUT: <elided>
  271. // CHECK:STDOUT: } {
  272. // CHECK:STDOUT: <elided>
  273. // CHECK:STDOUT: }
  274. // CHECK:STDOUT: %HasQualifiers.const_ref_ref_this.cpp_overload_set.value: %HasQualifiers.const_ref_ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.const_ref_ref_this.cpp_overload_set [concrete = constants.%HasQualifiers.const_ref_ref_this.cpp_overload_set.value]
  275. // CHECK:STDOUT: %const_ref_ref_this__carbon_thunk.decl: %const_ref_ref_this__carbon_thunk.type = fn_decl @const_ref_ref_this__carbon_thunk [concrete = constants.%const_ref_ref_this__carbon_thunk] {
  276. // CHECK:STDOUT: <elided>
  277. // CHECK:STDOUT: } {
  278. // CHECK:STDOUT: <elided>
  279. // CHECK:STDOUT: }
  280. // CHECK:STDOUT: %HasQualifiers.plain.cpp_overload_set.value: %HasQualifiers.plain.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.plain.cpp_overload_set [concrete = constants.%HasQualifiers.plain.cpp_overload_set.value]
  281. // CHECK:STDOUT: %HasQualifiers.plain.decl: %HasQualifiers.plain.type = fn_decl @HasQualifiers.plain [concrete = constants.%HasQualifiers.plain] {
  282. // CHECK:STDOUT: <elided>
  283. // CHECK:STDOUT: } {
  284. // CHECK:STDOUT: <elided>
  285. // CHECK:STDOUT: }
  286. // CHECK:STDOUT: %HasQualifiers.ref_this.cpp_overload_set.value: %HasQualifiers.ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.ref_this.cpp_overload_set [concrete = constants.%HasQualifiers.ref_this.cpp_overload_set.value]
  287. // CHECK:STDOUT: %HasQualifiers.ref_this.decl: %HasQualifiers.ref_this.type = fn_decl @HasQualifiers.ref_this [concrete = constants.%HasQualifiers.ref_this] {
  288. // CHECK:STDOUT: <elided>
  289. // CHECK:STDOUT: } {
  290. // CHECK:STDOUT: <elided>
  291. // CHECK:STDOUT: }
  292. // CHECK:STDOUT: %HasQualifiers.ref_ref_this.cpp_overload_set.value: %HasQualifiers.ref_ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.ref_ref_this.cpp_overload_set [concrete = constants.%HasQualifiers.ref_ref_this.cpp_overload_set.value]
  293. // CHECK:STDOUT: %ref_ref_this__carbon_thunk.decl: %ref_ref_this__carbon_thunk.type = fn_decl @ref_ref_this__carbon_thunk [concrete = constants.%ref_ref_this__carbon_thunk] {
  294. // CHECK:STDOUT: <elided>
  295. // CHECK:STDOUT: } {
  296. // CHECK:STDOUT: <elided>
  297. // CHECK:STDOUT: }
  298. // CHECK:STDOUT: %HasQualifiers.HasQualifiers.decl: %HasQualifiers.HasQualifiers.type = fn_decl @HasQualifiers.HasQualifiers [concrete = constants.%HasQualifiers.HasQualifiers] {
  299. // CHECK:STDOUT: <elided>
  300. // CHECK:STDOUT: } {
  301. // CHECK:STDOUT: <elided>
  302. // CHECK:STDOUT: }
  303. // CHECK:STDOUT: %HasQualifiers__carbon_thunk.decl: %HasQualifiers__carbon_thunk.type = fn_decl @HasQualifiers__carbon_thunk [concrete = constants.%HasQualifiers__carbon_thunk] {
  304. // CHECK:STDOUT: <elided>
  305. // CHECK:STDOUT: } {
  306. // CHECK:STDOUT: <elided>
  307. // CHECK:STDOUT: }
  308. // CHECK:STDOUT: %HasQualifiers.cpp_destructor.decl: %HasQualifiers.cpp_destructor.type = fn_decl @HasQualifiers.cpp_destructor [concrete = constants.%HasQualifiers.cpp_destructor] {
  309. // CHECK:STDOUT: <elided>
  310. // CHECK:STDOUT: } {
  311. // CHECK:STDOUT: <elided>
  312. // CHECK:STDOUT: }
  313. // CHECK:STDOUT: }
  314. // CHECK:STDOUT:
  315. // CHECK:STDOUT: fn @F(%v.param: %HasQualifiers, %p.param: %ptr.ec3) {
  316. // CHECK:STDOUT: !entry:
  317. // CHECK:STDOUT: %v.ref.loc10: %HasQualifiers = name_ref v, %v
  318. // CHECK:STDOUT: %const_this.ref.loc10: %HasQualifiers.const_this.cpp_overload_set.type = name_ref const_this, imports.%HasQualifiers.const_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_this.cpp_overload_set.value]
  319. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %v.ref.loc10, %const_this.ref.loc10
  320. // CHECK:STDOUT: %const_this__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%const_this__carbon_thunk.decl(%v.ref.loc10)
  321. // CHECK:STDOUT: %v.ref.loc11: %HasQualifiers = name_ref v, %v
  322. // CHECK:STDOUT: %const_ref_this.ref.loc11: %HasQualifiers.const_ref_this.cpp_overload_set.type = name_ref const_ref_this, imports.%HasQualifiers.const_ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_ref_this.cpp_overload_set.value]
  323. // CHECK:STDOUT: %bound_method.loc11: <bound method> = bound_method %v.ref.loc11, %const_ref_this.ref.loc11
  324. // CHECK:STDOUT: %const_ref_this__carbon_thunk.call.loc11: init %empty_tuple.type = call imports.%const_ref_this__carbon_thunk.decl(%v.ref.loc11)
  325. // CHECK:STDOUT: %v.ref.loc12: %HasQualifiers = name_ref v, %v
  326. // CHECK:STDOUT: %const_ref_ref_this.ref.loc12: %HasQualifiers.const_ref_ref_this.cpp_overload_set.type = name_ref const_ref_ref_this, imports.%HasQualifiers.const_ref_ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_ref_ref_this.cpp_overload_set.value]
  327. // CHECK:STDOUT: %bound_method.loc12: <bound method> = bound_method %v.ref.loc12, %const_ref_ref_this.ref.loc12
  328. // CHECK:STDOUT: %const_ref_ref_this__carbon_thunk.call.loc12: init %empty_tuple.type = call imports.%const_ref_ref_this__carbon_thunk.decl(%v.ref.loc12)
  329. // CHECK:STDOUT: %p.ref.loc14: %ptr.ec3 = name_ref p, %p
  330. // CHECK:STDOUT: %.loc14: ref %HasQualifiers = deref %p.ref.loc14
  331. // CHECK:STDOUT: %plain.ref.loc14: %HasQualifiers.plain.cpp_overload_set.type = name_ref plain, imports.%HasQualifiers.plain.cpp_overload_set.value [concrete = constants.%HasQualifiers.plain.cpp_overload_set.value]
  332. // CHECK:STDOUT: %bound_method.loc14: <bound method> = bound_method %.loc14, %plain.ref.loc14
  333. // CHECK:STDOUT: %HasQualifiers.plain.call.loc14: init %empty_tuple.type = call imports.%HasQualifiers.plain.decl(%.loc14)
  334. // CHECK:STDOUT: %p.ref.loc15: %ptr.ec3 = name_ref p, %p
  335. // CHECK:STDOUT: %.loc15: ref %HasQualifiers = deref %p.ref.loc15
  336. // CHECK:STDOUT: %ref_this.ref: %HasQualifiers.ref_this.cpp_overload_set.type = name_ref ref_this, imports.%HasQualifiers.ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.ref_this.cpp_overload_set.value]
  337. // CHECK:STDOUT: %bound_method.loc15: <bound method> = bound_method %.loc15, %ref_this.ref
  338. // CHECK:STDOUT: %HasQualifiers.ref_this.call: init %empty_tuple.type = call imports.%HasQualifiers.ref_this.decl(%.loc15)
  339. // CHECK:STDOUT: %p.ref.loc16: %ptr.ec3 = name_ref p, %p
  340. // CHECK:STDOUT: %.loc16_4.1: ref %HasQualifiers = deref %p.ref.loc16
  341. // CHECK:STDOUT: %const_this.ref.loc16: %HasQualifiers.const_this.cpp_overload_set.type = name_ref const_this, imports.%HasQualifiers.const_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_this.cpp_overload_set.value]
  342. // CHECK:STDOUT: %bound_method.loc16: <bound method> = bound_method %.loc16_4.1, %const_this.ref.loc16
  343. // CHECK:STDOUT: %.loc16_4.2: %HasQualifiers = acquire_value %.loc16_4.1
  344. // CHECK:STDOUT: %const_this__carbon_thunk.call.loc16: init %empty_tuple.type = call imports.%const_this__carbon_thunk.decl(%.loc16_4.2)
  345. // CHECK:STDOUT: %p.ref.loc17: %ptr.ec3 = name_ref p, %p
  346. // CHECK:STDOUT: %.loc17_4.1: ref %HasQualifiers = deref %p.ref.loc17
  347. // CHECK:STDOUT: %const_ref_this.ref.loc17: %HasQualifiers.const_ref_this.cpp_overload_set.type = name_ref const_ref_this, imports.%HasQualifiers.const_ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_ref_this.cpp_overload_set.value]
  348. // CHECK:STDOUT: %bound_method.loc17: <bound method> = bound_method %.loc17_4.1, %const_ref_this.ref.loc17
  349. // CHECK:STDOUT: %.loc17_4.2: %HasQualifiers = acquire_value %.loc17_4.1
  350. // CHECK:STDOUT: %const_ref_this__carbon_thunk.call.loc17: init %empty_tuple.type = call imports.%const_ref_this__carbon_thunk.decl(%.loc17_4.2)
  351. // CHECK:STDOUT: %Make.ref.loc19: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make]
  352. // CHECK:STDOUT: %.loc19_8.1: ref %HasQualifiers = temporary_storage
  353. // CHECK:STDOUT: %Make.call.loc19: init %HasQualifiers to %.loc19_8.1 = call %Make.ref.loc19()
  354. // CHECK:STDOUT: %.loc19_8.2: ref %HasQualifiers = temporary %.loc19_8.1, %Make.call.loc19
  355. // CHECK:STDOUT: %plain.ref.loc19: %HasQualifiers.plain.cpp_overload_set.type = name_ref plain, imports.%HasQualifiers.plain.cpp_overload_set.value [concrete = constants.%HasQualifiers.plain.cpp_overload_set.value]
  356. // CHECK:STDOUT: %bound_method.loc19: <bound method> = bound_method %.loc19_8.2, %plain.ref.loc19
  357. // CHECK:STDOUT: %HasQualifiers.plain.call.loc19: init %empty_tuple.type = call imports.%HasQualifiers.plain.decl(%.loc19_8.2)
  358. // CHECK:STDOUT: %Make.ref.loc20: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make]
  359. // CHECK:STDOUT: %.loc20_8.1: ref %HasQualifiers = temporary_storage
  360. // CHECK:STDOUT: %Make.call.loc20: init %HasQualifiers to %.loc20_8.1 = call %Make.ref.loc20()
  361. // CHECK:STDOUT: %.loc20_8.2: ref %HasQualifiers = temporary %.loc20_8.1, %Make.call.loc20
  362. // CHECK:STDOUT: %const_this.ref.loc20: %HasQualifiers.const_this.cpp_overload_set.type = name_ref const_this, imports.%HasQualifiers.const_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_this.cpp_overload_set.value]
  363. // CHECK:STDOUT: %bound_method.loc20: <bound method> = bound_method %.loc20_8.2, %const_this.ref.loc20
  364. // CHECK:STDOUT: %.loc20_8.3: %HasQualifiers = acquire_value %.loc20_8.2
  365. // CHECK:STDOUT: %const_this__carbon_thunk.call.loc20: init %empty_tuple.type = call imports.%const_this__carbon_thunk.decl(%.loc20_8.3)
  366. // CHECK:STDOUT: %Make.ref.loc21: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make]
  367. // CHECK:STDOUT: %.loc21_8.1: ref %HasQualifiers = temporary_storage
  368. // CHECK:STDOUT: %Make.call.loc21: init %HasQualifiers to %.loc21_8.1 = call %Make.ref.loc21()
  369. // CHECK:STDOUT: %.loc21_8.2: ref %HasQualifiers = temporary %.loc21_8.1, %Make.call.loc21
  370. // CHECK:STDOUT: %const_ref_this.ref.loc21: %HasQualifiers.const_ref_this.cpp_overload_set.type = name_ref const_ref_this, imports.%HasQualifiers.const_ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_ref_this.cpp_overload_set.value]
  371. // CHECK:STDOUT: %bound_method.loc21: <bound method> = bound_method %.loc21_8.2, %const_ref_this.ref.loc21
  372. // CHECK:STDOUT: %.loc21_8.3: %HasQualifiers = acquire_value %.loc21_8.2
  373. // CHECK:STDOUT: %const_ref_this__carbon_thunk.call.loc21: init %empty_tuple.type = call imports.%const_ref_this__carbon_thunk.decl(%.loc21_8.3)
  374. // CHECK:STDOUT: %Make.ref.loc22: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make]
  375. // CHECK:STDOUT: %.loc22_8.1: ref %HasQualifiers = temporary_storage
  376. // CHECK:STDOUT: %Make.call.loc22: init %HasQualifiers to %.loc22_8.1 = call %Make.ref.loc22()
  377. // CHECK:STDOUT: %.loc22_8.2: ref %HasQualifiers = temporary %.loc22_8.1, %Make.call.loc22
  378. // CHECK:STDOUT: %ref_ref_this.ref: %HasQualifiers.ref_ref_this.cpp_overload_set.type = name_ref ref_ref_this, imports.%HasQualifiers.ref_ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.ref_ref_this.cpp_overload_set.value]
  379. // CHECK:STDOUT: %bound_method.loc22_9: <bound method> = bound_method %.loc22_8.2, %ref_ref_this.ref
  380. // CHECK:STDOUT: %.loc22_8.3: %HasQualifiers = acquire_value %.loc22_8.2
  381. // CHECK:STDOUT: <elided>
  382. // CHECK:STDOUT: %impl.elem0.loc22: %.f42 = impl_witness_access constants.%custom_witness.dbb, element0 [concrete = constants.%HasQualifiers.Op.567da9.1]
  383. // CHECK:STDOUT: %bound_method.loc22_8: <bound method> = bound_method %.loc22_8.3, %impl.elem0.loc22
  384. // CHECK:STDOUT: %.loc22_8.4: ref %HasQualifiers = temporary_storage
  385. // CHECK:STDOUT: %Op.ref.loc22_8.1: %HasQualifiers.HasQualifiers.type = name_ref Op, imports.%HasQualifiers.HasQualifiers.decl [concrete = constants.%HasQualifiers.HasQualifiers]
  386. // CHECK:STDOUT: <elided>
  387. // CHECK:STDOUT: %.loc22_8.5: ref %HasQualifiers = value_as_ref %.loc22_8.3
  388. // CHECK:STDOUT: %addr.loc22_8.1: %ptr.ec3 = addr_of %.loc22_8.5
  389. // CHECK:STDOUT: %.loc22_8.6: %ptr.2cb = as_compatible %addr.loc22_8.1
  390. // CHECK:STDOUT: %.loc22_8.7: %ptr.2cb = converted %addr.loc22_8.1, %.loc22_8.6
  391. // CHECK:STDOUT: %addr.loc22_8.2: %ptr.ec3 = addr_of %self.var
  392. // CHECK:STDOUT: %HasQualifiers__carbon_thunk.call: init %empty_tuple.type = call imports.%HasQualifiers__carbon_thunk.decl(%.loc22_8.7, %addr.loc22_8.2)
  393. // CHECK:STDOUT: %.loc22_8.8: init %HasQualifiers to %self.var = mark_in_place_init %HasQualifiers__carbon_thunk.call
  394. // CHECK:STDOUT: <elided>
  395. // CHECK:STDOUT: %ref_ref_this__carbon_thunk.call: init %empty_tuple.type = call imports.%ref_ref_this__carbon_thunk.decl(%self.var)
  396. // CHECK:STDOUT: %Make.ref.loc23: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make]
  397. // CHECK:STDOUT: %.loc23_8.1: ref %HasQualifiers = temporary_storage
  398. // CHECK:STDOUT: %Make.call.loc23: init %HasQualifiers to %.loc23_8.1 = call %Make.ref.loc23()
  399. // CHECK:STDOUT: %.loc23_8.2: ref %HasQualifiers = temporary %.loc23_8.1, %Make.call.loc23
  400. // CHECK:STDOUT: %const_ref_ref_this.ref.loc23: %HasQualifiers.const_ref_ref_this.cpp_overload_set.type = name_ref const_ref_ref_this, imports.%HasQualifiers.const_ref_ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_ref_ref_this.cpp_overload_set.value]
  401. // CHECK:STDOUT: %bound_method.loc23: <bound method> = bound_method %.loc23_8.2, %const_ref_ref_this.ref.loc23
  402. // CHECK:STDOUT: %.loc23_8.3: %HasQualifiers = acquire_value %.loc23_8.2
  403. // CHECK:STDOUT: %const_ref_ref_this__carbon_thunk.call.loc23: init %empty_tuple.type = call imports.%const_ref_ref_this__carbon_thunk.decl(%.loc23_8.3)
  404. // CHECK:STDOUT: <elided>
  405. // CHECK:STDOUT: %HasQualifiers.Op.bound.loc23: <bound method> = bound_method %.loc23_8.2, constants.%HasQualifiers.Op.567da9.2
  406. // CHECK:STDOUT: %Op.ref.loc23: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
  407. // CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc23: <bound method> = bound_method %.loc23_8.2, %Op.ref.loc23
  408. // CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc23: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc23(%.loc23_8.2)
  409. // CHECK:STDOUT: <elided>
  410. // CHECK:STDOUT: %HasQualifiers.Op.bound.loc22: <bound method> = bound_method %.loc22_8.2, constants.%HasQualifiers.Op.567da9.2
  411. // CHECK:STDOUT: %Op.ref.loc22_8.2: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
  412. // CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc22: <bound method> = bound_method %.loc22_8.2, %Op.ref.loc22_8.2
  413. // CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc22: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc22(%.loc22_8.2)
  414. // CHECK:STDOUT: %HasQualifiers.Op.bound.loc21: <bound method> = bound_method %.loc21_8.2, constants.%HasQualifiers.Op.567da9.2
  415. // CHECK:STDOUT: %Op.ref.loc21: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
  416. // CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc21: <bound method> = bound_method %.loc21_8.2, %Op.ref.loc21
  417. // CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc21: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc21(%.loc21_8.2)
  418. // CHECK:STDOUT: %HasQualifiers.Op.bound.loc20: <bound method> = bound_method %.loc20_8.2, constants.%HasQualifiers.Op.567da9.2
  419. // CHECK:STDOUT: %Op.ref.loc20: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
  420. // CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc20: <bound method> = bound_method %.loc20_8.2, %Op.ref.loc20
  421. // CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc20: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc20(%.loc20_8.2)
  422. // CHECK:STDOUT: %HasQualifiers.Op.bound.loc19: <bound method> = bound_method %.loc19_8.2, constants.%HasQualifiers.Op.567da9.2
  423. // CHECK:STDOUT: %Op.ref.loc19: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
  424. // CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc19: <bound method> = bound_method %.loc19_8.2, %Op.ref.loc19
  425. // CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc19: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc19(%.loc19_8.2)
  426. // CHECK:STDOUT: <elided>
  427. // CHECK:STDOUT: }
  428. // CHECK:STDOUT:
  429. // CHECK:STDOUT: --- use_object_param_qualifiers_overloaded.carbon
  430. // CHECK:STDOUT:
  431. // CHECK:STDOUT: constants {
  432. // CHECK:STDOUT: %NoRefQualifier: type = class_type @NoRefQualifier [concrete]
  433. // CHECK:STDOUT: %ptr.2a2: type = ptr_type %NoRefQualifier [concrete]
  434. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  435. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  436. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  437. // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
  438. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  439. // CHECK:STDOUT: %NoRefQualifier.F.cpp_overload_set.type: type = cpp_overload_set_type @NoRefQualifier.F.cpp_overload_set [concrete]
  440. // CHECK:STDOUT: %NoRefQualifier.F.cpp_overload_set.value: %NoRefQualifier.F.cpp_overload_set.type = cpp_overload_set_value @NoRefQualifier.F.cpp_overload_set [concrete]
  441. // CHECK:STDOUT: %F__carbon_thunk.type.eda1ac.1: type = fn_type @F__carbon_thunk.1 [concrete]
  442. // CHECK:STDOUT: %F__carbon_thunk.0cd6a8.1: %F__carbon_thunk.type.eda1ac.1 = struct_value () [concrete]
  443. // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete]
  444. // CHECK:STDOUT: %pattern_type.fe8: type = pattern_type %ptr.235 [concrete]
  445. // CHECK:STDOUT: %NoRefQualifier.F.type.b65611.2: type = fn_type @NoRefQualifier.F.2 [concrete]
  446. // CHECK:STDOUT: %NoRefQualifier.F.d50a5a.2: %NoRefQualifier.F.type.b65611.2 = struct_value () [concrete]
  447. // CHECK:STDOUT: %Destroy.Op.type.bae255.1: type = fn_type @Destroy.Op.loc9 [concrete]
  448. // CHECK:STDOUT: %Destroy.Op.651ba6.1: %Destroy.Op.type.bae255.1 = struct_value () [concrete]
  449. // CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc8_3.2 [concrete]
  450. // CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete]
  451. // CHECK:STDOUT: %WithRefQualifier: type = class_type @WithRefQualifier [concrete]
  452. // CHECK:STDOUT: %ptr.c86: type = ptr_type %WithRefQualifier [concrete]
  453. // CHECK:STDOUT: %WithRefQualifier.F.cpp_overload_set.type: type = cpp_overload_set_type @WithRefQualifier.F.cpp_overload_set [concrete]
  454. // CHECK:STDOUT: %WithRefQualifier.F.cpp_overload_set.value: %WithRefQualifier.F.cpp_overload_set.type = cpp_overload_set_value @WithRefQualifier.F.cpp_overload_set [concrete]
  455. // CHECK:STDOUT: %F__carbon_thunk.type.eda1ac.2: type = fn_type @F__carbon_thunk.2 [concrete]
  456. // CHECK:STDOUT: %F__carbon_thunk.0cd6a8.2: %F__carbon_thunk.type.eda1ac.2 = struct_value () [concrete]
  457. // CHECK:STDOUT: %WithRefQualifier.F.type.7c19e2.2: type = fn_type @WithRefQualifier.F.2 [concrete]
  458. // CHECK:STDOUT: %WithRefQualifier.F.d90b51.2: %WithRefQualifier.F.type.7c19e2.2 = struct_value () [concrete]
  459. // CHECK:STDOUT: }
  460. // CHECK:STDOUT:
  461. // CHECK:STDOUT: imports {
  462. // CHECK:STDOUT: %NoRefQualifier.F.cpp_overload_set.value: %NoRefQualifier.F.cpp_overload_set.type = cpp_overload_set_value @NoRefQualifier.F.cpp_overload_set [concrete = constants.%NoRefQualifier.F.cpp_overload_set.value]
  463. // CHECK:STDOUT: %F__carbon_thunk.decl.e1b8ec.1: %F__carbon_thunk.type.eda1ac.1 = fn_decl @F__carbon_thunk.1 [concrete = constants.%F__carbon_thunk.0cd6a8.1] {
  464. // CHECK:STDOUT: <elided>
  465. // CHECK:STDOUT: } {
  466. // CHECK:STDOUT: <elided>
  467. // CHECK:STDOUT: }
  468. // CHECK:STDOUT: %NoRefQualifier.F.decl.3dba03.2: %NoRefQualifier.F.type.b65611.2 = fn_decl @NoRefQualifier.F.2 [concrete = constants.%NoRefQualifier.F.d50a5a.2] {
  469. // CHECK:STDOUT: <elided>
  470. // CHECK:STDOUT: } {
  471. // CHECK:STDOUT: <elided>
  472. // CHECK:STDOUT: }
  473. // CHECK:STDOUT: %WithRefQualifier.F.cpp_overload_set.value: %WithRefQualifier.F.cpp_overload_set.type = cpp_overload_set_value @WithRefQualifier.F.cpp_overload_set [concrete = constants.%WithRefQualifier.F.cpp_overload_set.value]
  474. // CHECK:STDOUT: %F__carbon_thunk.decl.e1b8ec.2: %F__carbon_thunk.type.eda1ac.2 = fn_decl @F__carbon_thunk.2 [concrete = constants.%F__carbon_thunk.0cd6a8.2] {
  475. // CHECK:STDOUT: <elided>
  476. // CHECK:STDOUT: } {
  477. // CHECK:STDOUT: <elided>
  478. // CHECK:STDOUT: }
  479. // CHECK:STDOUT: %WithRefQualifier.F.decl.e3f32b.2: %WithRefQualifier.F.type.7c19e2.2 = fn_decl @WithRefQualifier.F.2 [concrete = constants.%WithRefQualifier.F.d90b51.2] {
  480. // CHECK:STDOUT: <elided>
  481. // CHECK:STDOUT: } {
  482. // CHECK:STDOUT: <elided>
  483. // CHECK:STDOUT: }
  484. // CHECK:STDOUT: }
  485. // CHECK:STDOUT:
  486. // CHECK:STDOUT: fn @CallFNoRefQualifier(%v.param: %NoRefQualifier, %p.param: %ptr.2a2) {
  487. // CHECK:STDOUT: !entry:
  488. // CHECK:STDOUT: name_binding_decl {
  489. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = ref_binding_pattern a [concrete]
  490. // CHECK:STDOUT: %a.var_patt: %pattern_type.7ce = var_pattern %a.patt [concrete]
  491. // CHECK:STDOUT: }
  492. // CHECK:STDOUT: %a.var: ref %i32 = var %a.var_patt
  493. // CHECK:STDOUT: %v.ref: %NoRefQualifier = name_ref v, %v
  494. // CHECK:STDOUT: %F.ref.loc8: %NoRefQualifier.F.cpp_overload_set.type = name_ref F, imports.%NoRefQualifier.F.cpp_overload_set.value [concrete = constants.%NoRefQualifier.F.cpp_overload_set.value]
  495. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %v.ref, %F.ref.loc8
  496. // CHECK:STDOUT: %F__carbon_thunk.call: init %i32 = call imports.%F__carbon_thunk.decl.e1b8ec.1(%v.ref)
  497. // CHECK:STDOUT: assign %a.var, %F__carbon_thunk.call
  498. // CHECK:STDOUT: %i32.loc8: type = type_literal constants.%i32 [concrete = constants.%i32]
  499. // CHECK:STDOUT: %a: ref %i32 = ref_binding a, %a.var
  500. // CHECK:STDOUT: name_binding_decl {
  501. // CHECK:STDOUT: %b.patt: %pattern_type.fe8 = ref_binding_pattern b [concrete]
  502. // CHECK:STDOUT: %b.var_patt: %pattern_type.fe8 = var_pattern %b.patt [concrete]
  503. // CHECK:STDOUT: }
  504. // CHECK:STDOUT: %b.var: ref %ptr.235 = var %b.var_patt
  505. // CHECK:STDOUT: %p.ref: %ptr.2a2 = name_ref p, %p
  506. // CHECK:STDOUT: %.loc9_25: ref %NoRefQualifier = deref %p.ref
  507. // CHECK:STDOUT: %F.ref.loc9: %NoRefQualifier.F.cpp_overload_set.type = name_ref F, imports.%NoRefQualifier.F.cpp_overload_set.value [concrete = constants.%NoRefQualifier.F.cpp_overload_set.value]
  508. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %.loc9_25, %F.ref.loc9
  509. // CHECK:STDOUT: %NoRefQualifier.F.call: init %ptr.235 = call imports.%NoRefQualifier.F.decl.3dba03.2(%.loc9_25)
  510. // CHECK:STDOUT: assign %b.var, %NoRefQualifier.F.call
  511. // CHECK:STDOUT: %.loc9_20: type = splice_block %ptr.loc9 [concrete = constants.%ptr.235] {
  512. // CHECK:STDOUT: %i32.loc9: type = type_literal constants.%i32 [concrete = constants.%i32]
  513. // CHECK:STDOUT: %ptr.loc9: type = ptr_type %i32.loc9 [concrete = constants.%ptr.235]
  514. // CHECK:STDOUT: }
  515. // CHECK:STDOUT: %b: ref %ptr.235 = ref_binding b, %b.var
  516. // CHECK:STDOUT: %Destroy.Op.bound.loc9: <bound method> = bound_method %b.var, constants.%Destroy.Op.651ba6.1
  517. // CHECK:STDOUT: %Destroy.Op.call.loc9: init %empty_tuple.type = call %Destroy.Op.bound.loc9(%b.var)
  518. // CHECK:STDOUT: %Destroy.Op.bound.loc8: <bound method> = bound_method %a.var, constants.%Destroy.Op.651ba6.3
  519. // CHECK:STDOUT: %Destroy.Op.call.loc8: init %empty_tuple.type = call %Destroy.Op.bound.loc8(%a.var)
  520. // CHECK:STDOUT: <elided>
  521. // CHECK:STDOUT: }
  522. // CHECK:STDOUT:
  523. // CHECK:STDOUT: fn @Destroy.Op.loc9(%self.param: ref %ptr.235) = "no_op";
  524. // CHECK:STDOUT:
  525. // CHECK:STDOUT: fn @Destroy.Op.loc8_3.1(%self.param: ref %i32.builtin) = "no_op";
  526. // CHECK:STDOUT:
  527. // CHECK:STDOUT: fn @Destroy.Op.loc8_3.2(%self.param: ref %i32) {
  528. // CHECK:STDOUT: !entry:
  529. // CHECK:STDOUT: return
  530. // CHECK:STDOUT: }
  531. // CHECK:STDOUT:
  532. // CHECK:STDOUT: fn @CallFWithRefQualifier(%v.param: %WithRefQualifier, %p.param: %ptr.c86) {
  533. // CHECK:STDOUT: !entry:
  534. // CHECK:STDOUT: name_binding_decl {
  535. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = ref_binding_pattern a [concrete]
  536. // CHECK:STDOUT: %a.var_patt: %pattern_type.7ce = var_pattern %a.patt [concrete]
  537. // CHECK:STDOUT: }
  538. // CHECK:STDOUT: %a.var: ref %i32 = var %a.var_patt
  539. // CHECK:STDOUT: %v.ref: %WithRefQualifier = name_ref v, %v
  540. // CHECK:STDOUT: %F.ref.loc15: %WithRefQualifier.F.cpp_overload_set.type = name_ref F, imports.%WithRefQualifier.F.cpp_overload_set.value [concrete = constants.%WithRefQualifier.F.cpp_overload_set.value]
  541. // CHECK:STDOUT: %bound_method.loc15: <bound method> = bound_method %v.ref, %F.ref.loc15
  542. // CHECK:STDOUT: %F__carbon_thunk.call: init %i32 = call imports.%F__carbon_thunk.decl.e1b8ec.2(%v.ref)
  543. // CHECK:STDOUT: assign %a.var, %F__carbon_thunk.call
  544. // CHECK:STDOUT: %i32.loc15: type = type_literal constants.%i32 [concrete = constants.%i32]
  545. // CHECK:STDOUT: %a: ref %i32 = ref_binding a, %a.var
  546. // CHECK:STDOUT: name_binding_decl {
  547. // CHECK:STDOUT: %b.patt: %pattern_type.fe8 = ref_binding_pattern b [concrete]
  548. // CHECK:STDOUT: %b.var_patt: %pattern_type.fe8 = var_pattern %b.patt [concrete]
  549. // CHECK:STDOUT: }
  550. // CHECK:STDOUT: %b.var: ref %ptr.235 = var %b.var_patt
  551. // CHECK:STDOUT: %p.ref: %ptr.c86 = name_ref p, %p
  552. // CHECK:STDOUT: %.loc16_25: ref %WithRefQualifier = deref %p.ref
  553. // CHECK:STDOUT: %F.ref.loc16: %WithRefQualifier.F.cpp_overload_set.type = name_ref F, imports.%WithRefQualifier.F.cpp_overload_set.value [concrete = constants.%WithRefQualifier.F.cpp_overload_set.value]
  554. // CHECK:STDOUT: %bound_method.loc16: <bound method> = bound_method %.loc16_25, %F.ref.loc16
  555. // CHECK:STDOUT: %WithRefQualifier.F.call: init %ptr.235 = call imports.%WithRefQualifier.F.decl.e3f32b.2(%.loc16_25)
  556. // CHECK:STDOUT: assign %b.var, %WithRefQualifier.F.call
  557. // CHECK:STDOUT: %.loc16_20: type = splice_block %ptr.loc16 [concrete = constants.%ptr.235] {
  558. // CHECK:STDOUT: %i32.loc16: type = type_literal constants.%i32 [concrete = constants.%i32]
  559. // CHECK:STDOUT: %ptr.loc16: type = ptr_type %i32.loc16 [concrete = constants.%ptr.235]
  560. // CHECK:STDOUT: }
  561. // CHECK:STDOUT: %b: ref %ptr.235 = ref_binding b, %b.var
  562. // CHECK:STDOUT: %Destroy.Op.bound.loc16: <bound method> = bound_method %b.var, constants.%Destroy.Op.651ba6.1
  563. // CHECK:STDOUT: %Destroy.Op.call.loc16: init %empty_tuple.type = call %Destroy.Op.bound.loc16(%b.var)
  564. // CHECK:STDOUT: %Destroy.Op.bound.loc15: <bound method> = bound_method %a.var, constants.%Destroy.Op.651ba6.3
  565. // CHECK:STDOUT: %Destroy.Op.call.loc15: init %empty_tuple.type = call %Destroy.Op.bound.loc15(%a.var)
  566. // CHECK:STDOUT: <elided>
  567. // CHECK:STDOUT: }
  568. // CHECK:STDOUT:
  569. // CHECK:STDOUT: --- call_explicit_object_param.carbon
  570. // CHECK:STDOUT:
  571. // CHECK:STDOUT: constants {
  572. // CHECK:STDOUT: %ExplicitObjectParam: type = class_type @ExplicitObjectParam [concrete]
  573. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  574. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  575. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  576. // CHECK:STDOUT: %Another: type = class_type @Another [concrete]
  577. // CHECK:STDOUT: %ExplicitObjectParam.F.cpp_overload_set.type: type = cpp_overload_set_type @ExplicitObjectParam.F.cpp_overload_set [concrete]
  578. // CHECK:STDOUT: %ExplicitObjectParam.F.cpp_overload_set.value: %ExplicitObjectParam.F.cpp_overload_set.type = cpp_overload_set_value @ExplicitObjectParam.F.cpp_overload_set [concrete]
  579. // CHECK:STDOUT: %ptr.7f5: type = ptr_type %ExplicitObjectParam [concrete]
  580. // CHECK:STDOUT: %F__carbon_thunk.type: type = fn_type @F__carbon_thunk [concrete]
  581. // CHECK:STDOUT: %F__carbon_thunk: %F__carbon_thunk.type = struct_value () [concrete]
  582. // CHECK:STDOUT: %ExplicitObjectParam.G.cpp_overload_set.type: type = cpp_overload_set_type @ExplicitObjectParam.G.cpp_overload_set [concrete]
  583. // CHECK:STDOUT: %ExplicitObjectParam.G.cpp_overload_set.value: %ExplicitObjectParam.G.cpp_overload_set.type = cpp_overload_set_value @ExplicitObjectParam.G.cpp_overload_set [concrete]
  584. // CHECK:STDOUT: %ExplicitObjectParam.G.type: type = fn_type @ExplicitObjectParam.G [concrete]
  585. // CHECK:STDOUT: %ExplicitObjectParam.G: %ExplicitObjectParam.G.type = struct_value () [concrete]
  586. // CHECK:STDOUT: %ExplicitObjectParam.H.cpp_overload_set.type: type = cpp_overload_set_type @ExplicitObjectParam.H.cpp_overload_set [concrete]
  587. // CHECK:STDOUT: %ExplicitObjectParam.H.cpp_overload_set.value: %ExplicitObjectParam.H.cpp_overload_set.type = cpp_overload_set_value @ExplicitObjectParam.H.cpp_overload_set [concrete]
  588. // CHECK:STDOUT: %ptr.289: type = ptr_type %Another [concrete]
  589. // CHECK:STDOUT: %H__carbon_thunk.type: type = fn_type @H__carbon_thunk [concrete]
  590. // CHECK:STDOUT: %H__carbon_thunk: %H__carbon_thunk.type = struct_value () [concrete]
  591. // CHECK:STDOUT: }
  592. // CHECK:STDOUT:
  593. // CHECK:STDOUT: imports {
  594. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  595. // CHECK:STDOUT: .ExplicitObjectParam = %ExplicitObjectParam.decl
  596. // CHECK:STDOUT: .Another = %Another.decl
  597. // CHECK:STDOUT: import Cpp//...
  598. // CHECK:STDOUT: }
  599. // CHECK:STDOUT: %ExplicitObjectParam.decl: type = class_decl @ExplicitObjectParam [concrete = constants.%ExplicitObjectParam] {} {}
  600. // CHECK:STDOUT: %Another.decl: type = class_decl @Another [concrete = constants.%Another] {} {}
  601. // CHECK:STDOUT: %ExplicitObjectParam.F.cpp_overload_set.value: %ExplicitObjectParam.F.cpp_overload_set.type = cpp_overload_set_value @ExplicitObjectParam.F.cpp_overload_set [concrete = constants.%ExplicitObjectParam.F.cpp_overload_set.value]
  602. // CHECK:STDOUT: %F__carbon_thunk.decl: %F__carbon_thunk.type = fn_decl @F__carbon_thunk [concrete = constants.%F__carbon_thunk] {
  603. // CHECK:STDOUT: <elided>
  604. // CHECK:STDOUT: } {
  605. // CHECK:STDOUT: <elided>
  606. // CHECK:STDOUT: }
  607. // CHECK:STDOUT: %ExplicitObjectParam.G.cpp_overload_set.value: %ExplicitObjectParam.G.cpp_overload_set.type = cpp_overload_set_value @ExplicitObjectParam.G.cpp_overload_set [concrete = constants.%ExplicitObjectParam.G.cpp_overload_set.value]
  608. // CHECK:STDOUT: %ExplicitObjectParam.G.decl: %ExplicitObjectParam.G.type = fn_decl @ExplicitObjectParam.G [concrete = constants.%ExplicitObjectParam.G] {
  609. // CHECK:STDOUT: <elided>
  610. // CHECK:STDOUT: } {
  611. // CHECK:STDOUT: <elided>
  612. // CHECK:STDOUT: }
  613. // CHECK:STDOUT: %ExplicitObjectParam.H.cpp_overload_set.value: %ExplicitObjectParam.H.cpp_overload_set.type = cpp_overload_set_value @ExplicitObjectParam.H.cpp_overload_set [concrete = constants.%ExplicitObjectParam.H.cpp_overload_set.value]
  614. // CHECK:STDOUT: %H__carbon_thunk.decl: %H__carbon_thunk.type = fn_decl @H__carbon_thunk [concrete = constants.%H__carbon_thunk] {
  615. // CHECK:STDOUT: <elided>
  616. // CHECK:STDOUT: } {
  617. // CHECK:STDOUT: <elided>
  618. // CHECK:STDOUT: }
  619. // CHECK:STDOUT: }
  620. // CHECK:STDOUT:
  621. // CHECK:STDOUT: fn @Call(%e.param: %ExplicitObjectParam, %n.param: %i32, %a.param: %Another) {
  622. // CHECK:STDOUT: !entry:
  623. // CHECK:STDOUT: %e.ref: %ExplicitObjectParam = name_ref e, %e
  624. // CHECK:STDOUT: %F.ref: %ExplicitObjectParam.F.cpp_overload_set.type = name_ref F, imports.%ExplicitObjectParam.F.cpp_overload_set.value [concrete = constants.%ExplicitObjectParam.F.cpp_overload_set.value]
  625. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %e.ref, %F.ref
  626. // CHECK:STDOUT: %.loc8: ref %ExplicitObjectParam = value_as_ref %e.ref
  627. // CHECK:STDOUT: %addr.loc8: %ptr.7f5 = addr_of %.loc8
  628. // CHECK:STDOUT: %F__carbon_thunk.call: init %empty_tuple.type = call imports.%F__carbon_thunk.decl(%addr.loc8)
  629. // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
  630. // CHECK:STDOUT: %Cpp.ref.loc9: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  631. // CHECK:STDOUT: %ExplicitObjectParam.ref.loc9: type = name_ref ExplicitObjectParam, imports.%ExplicitObjectParam.decl [concrete = constants.%ExplicitObjectParam]
  632. // CHECK:STDOUT: %G.ref: %ExplicitObjectParam.G.cpp_overload_set.type = name_ref G, imports.%ExplicitObjectParam.G.cpp_overload_set.value [concrete = constants.%ExplicitObjectParam.G.cpp_overload_set.value]
  633. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %n.ref, %G.ref
  634. // CHECK:STDOUT: %ExplicitObjectParam.G.call: init %empty_tuple.type = call imports.%ExplicitObjectParam.G.decl(%n.ref)
  635. // CHECK:STDOUT: %a.ref: %Another = name_ref a, %a
  636. // CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  637. // CHECK:STDOUT: %ExplicitObjectParam.ref.loc10: type = name_ref ExplicitObjectParam, imports.%ExplicitObjectParam.decl [concrete = constants.%ExplicitObjectParam]
  638. // CHECK:STDOUT: %H.ref: %ExplicitObjectParam.H.cpp_overload_set.type = name_ref H, imports.%ExplicitObjectParam.H.cpp_overload_set.value [concrete = constants.%ExplicitObjectParam.H.cpp_overload_set.value]
  639. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %a.ref, %H.ref
  640. // CHECK:STDOUT: %.loc10: ref %Another = value_as_ref %a.ref
  641. // CHECK:STDOUT: %addr.loc10: %ptr.289 = addr_of %.loc10
  642. // CHECK:STDOUT: %H__carbon_thunk.call: init %empty_tuple.type = call imports.%H__carbon_thunk.decl(%addr.loc10)
  643. // CHECK:STDOUT: <elided>
  644. // CHECK:STDOUT: }
  645. // CHECK:STDOUT:
  646. // CHECK:STDOUT: --- call_explicit_object_param_overloaded.carbon
  647. // CHECK:STDOUT:
  648. // CHECK:STDOUT: constants {
  649. // CHECK:STDOUT: %ExplicitObjectParam: type = class_type @ExplicitObjectParam [concrete]
  650. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  651. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  652. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  653. // CHECK:STDOUT: %Another: type = class_type @Another [concrete]
  654. // CHECK:STDOUT: %ExplicitObjectParam.F.cpp_overload_set.type: type = cpp_overload_set_type @ExplicitObjectParam.F.cpp_overload_set [concrete]
  655. // CHECK:STDOUT: %ExplicitObjectParam.F.cpp_overload_set.value: %ExplicitObjectParam.F.cpp_overload_set.type = cpp_overload_set_value @ExplicitObjectParam.F.cpp_overload_set [concrete]
  656. // CHECK:STDOUT: %ptr.7f5: type = ptr_type %ExplicitObjectParam [concrete]
  657. // CHECK:STDOUT: %F__carbon_thunk.type.eda1ac.1: type = fn_type @F__carbon_thunk.1 [concrete]
  658. // CHECK:STDOUT: %F__carbon_thunk.0cd6a8.1: %F__carbon_thunk.type.eda1ac.1 = struct_value () [concrete]
  659. // CHECK:STDOUT: %ExplicitObjectParam.F.type.5d25a8.2: type = fn_type @ExplicitObjectParam.F.2 [concrete]
  660. // CHECK:STDOUT: %ExplicitObjectParam.F.28cf2e.2: %ExplicitObjectParam.F.type.5d25a8.2 = struct_value () [concrete]
  661. // CHECK:STDOUT: %ptr.289: type = ptr_type %Another [concrete]
  662. // CHECK:STDOUT: %F__carbon_thunk.type.eda1ac.2: type = fn_type @F__carbon_thunk.2 [concrete]
  663. // CHECK:STDOUT: %F__carbon_thunk.0cd6a8.2: %F__carbon_thunk.type.eda1ac.2 = struct_value () [concrete]
  664. // CHECK:STDOUT: }
  665. // CHECK:STDOUT:
  666. // CHECK:STDOUT: imports {
  667. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  668. // CHECK:STDOUT: .ExplicitObjectParam = %ExplicitObjectParam.decl
  669. // CHECK:STDOUT: .Another = %Another.decl
  670. // CHECK:STDOUT: import Cpp//...
  671. // CHECK:STDOUT: }
  672. // CHECK:STDOUT: %ExplicitObjectParam.decl: type = class_decl @ExplicitObjectParam [concrete = constants.%ExplicitObjectParam] {} {}
  673. // CHECK:STDOUT: %Another.decl: type = class_decl @Another [concrete = constants.%Another] {} {}
  674. // CHECK:STDOUT: %ExplicitObjectParam.F.cpp_overload_set.value: %ExplicitObjectParam.F.cpp_overload_set.type = cpp_overload_set_value @ExplicitObjectParam.F.cpp_overload_set [concrete = constants.%ExplicitObjectParam.F.cpp_overload_set.value]
  675. // CHECK:STDOUT: %F__carbon_thunk.decl.e1b8ec.1: %F__carbon_thunk.type.eda1ac.1 = fn_decl @F__carbon_thunk.1 [concrete = constants.%F__carbon_thunk.0cd6a8.1] {
  676. // CHECK:STDOUT: <elided>
  677. // CHECK:STDOUT: } {
  678. // CHECK:STDOUT: <elided>
  679. // CHECK:STDOUT: }
  680. // CHECK:STDOUT: %ExplicitObjectParam.F.decl.28f5af.2: %ExplicitObjectParam.F.type.5d25a8.2 = fn_decl @ExplicitObjectParam.F.2 [concrete = constants.%ExplicitObjectParam.F.28cf2e.2] {
  681. // CHECK:STDOUT: <elided>
  682. // CHECK:STDOUT: } {
  683. // CHECK:STDOUT: <elided>
  684. // CHECK:STDOUT: }
  685. // CHECK:STDOUT: %F__carbon_thunk.decl.e1b8ec.2: %F__carbon_thunk.type.eda1ac.2 = fn_decl @F__carbon_thunk.2 [concrete = constants.%F__carbon_thunk.0cd6a8.2] {
  686. // CHECK:STDOUT: <elided>
  687. // CHECK:STDOUT: } {
  688. // CHECK:STDOUT: <elided>
  689. // CHECK:STDOUT: }
  690. // CHECK:STDOUT: }
  691. // CHECK:STDOUT:
  692. // CHECK:STDOUT: fn @Call(%e.param: %ExplicitObjectParam, %n.param: %i32, %a.param: %Another) {
  693. // CHECK:STDOUT: !entry:
  694. // CHECK:STDOUT: %e.ref: %ExplicitObjectParam = name_ref e, %e
  695. // CHECK:STDOUT: %F.ref.loc8: %ExplicitObjectParam.F.cpp_overload_set.type = name_ref F, imports.%ExplicitObjectParam.F.cpp_overload_set.value [concrete = constants.%ExplicitObjectParam.F.cpp_overload_set.value]
  696. // CHECK:STDOUT: %bound_method.loc8: <bound method> = bound_method %e.ref, %F.ref.loc8
  697. // CHECK:STDOUT: %.loc8: ref %ExplicitObjectParam = value_as_ref %e.ref
  698. // CHECK:STDOUT: %addr.loc8: %ptr.7f5 = addr_of %.loc8
  699. // CHECK:STDOUT: %F__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%F__carbon_thunk.decl.e1b8ec.1(%addr.loc8)
  700. // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
  701. // CHECK:STDOUT: %Cpp.ref.loc9: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  702. // CHECK:STDOUT: %ExplicitObjectParam.ref.loc9: type = name_ref ExplicitObjectParam, imports.%ExplicitObjectParam.decl [concrete = constants.%ExplicitObjectParam]
  703. // CHECK:STDOUT: %F.ref.loc9: %ExplicitObjectParam.F.cpp_overload_set.type = name_ref F, imports.%ExplicitObjectParam.F.cpp_overload_set.value [concrete = constants.%ExplicitObjectParam.F.cpp_overload_set.value]
  704. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %n.ref, %F.ref.loc9
  705. // CHECK:STDOUT: %ExplicitObjectParam.F.call: init %empty_tuple.type = call imports.%ExplicitObjectParam.F.decl.28f5af.2(%n.ref)
  706. // CHECK:STDOUT: %a.ref: %Another = name_ref a, %a
  707. // CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  708. // CHECK:STDOUT: %ExplicitObjectParam.ref.loc10: type = name_ref ExplicitObjectParam, imports.%ExplicitObjectParam.decl [concrete = constants.%ExplicitObjectParam]
  709. // CHECK:STDOUT: %F.ref.loc10: %ExplicitObjectParam.F.cpp_overload_set.type = name_ref F, imports.%ExplicitObjectParam.F.cpp_overload_set.value [concrete = constants.%ExplicitObjectParam.F.cpp_overload_set.value]
  710. // CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %a.ref, %F.ref.loc10
  711. // CHECK:STDOUT: %.loc10: ref %Another = value_as_ref %a.ref
  712. // CHECK:STDOUT: %addr.loc10: %ptr.289 = addr_of %.loc10
  713. // CHECK:STDOUT: %F__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%F__carbon_thunk.decl.e1b8ec.2(%addr.loc10)
  714. // CHECK:STDOUT: <elided>
  715. // CHECK:STDOUT: }
  716. // CHECK:STDOUT: