default_arg.carbon 88 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933
  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/function/default_arg.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/default_arg.carbon
  13. // --- functions.h
  14. auto GlobalNoReturn(int a, int b, int c = 1, int d = 2) -> void;
  15. auto GlobalReturnInt(int a, int b, int c = 1, int d = 2) -> int;
  16. struct X {
  17. void B(int a, int b = 1);
  18. static void C(int a, int b = 1);
  19. void D(this X, int a, int b = 1);
  20. };
  21. // --- call_without_default.carbon
  22. library "[[@TEST_NAME]]";
  23. import Cpp library "functions.h";
  24. fn Call() {
  25. //@dump-sem-ir-begin
  26. Cpp.GlobalNoReturn(1, 2, 3, 4);
  27. let unused value: i32 = Cpp.GlobalReturnInt(1, 2, 3, 4);
  28. ({} as Cpp.X).B(1, 2);
  29. Cpp.X.C(1, 2);
  30. ({} as Cpp.X).D(1, 2);
  31. //@dump-sem-ir-end
  32. }
  33. // --- call_with_default.carbon
  34. //@include-in-dumps
  35. library "[[@TEST_NAME]]";
  36. import Cpp library "functions.h";
  37. fn Call() {
  38. // //@dump-sem-ir-begin
  39. Cpp.GlobalNoReturn(1, 2);
  40. let unused value: i32 = Cpp.GlobalReturnInt(1, 2);
  41. Cpp.GlobalNoReturn(1, 2, 3);
  42. ({} as Cpp.X).B(1);
  43. Cpp.X.C(1);
  44. ({} as Cpp.X).D(1);
  45. // //@dump-sem-ir-end
  46. }
  47. // --- fail_call_too_few_args.carbon
  48. library "[[@TEST_NAME]]";
  49. import Cpp library "functions.h";
  50. fn Call() {
  51. //@dump-sem-ir-begin
  52. // CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:23: error: no matching function for call to 'GlobalNoReturn' [CppInteropParseError]
  53. // CHECK:STDERR: 16 | Cpp.GlobalNoReturn(1);
  54. // CHECK:STDERR: | ^
  55. // CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
  56. // CHECK:STDERR: ./functions.h:2:6: note: candidate function not viable: requires at least 2 arguments, but 1 was provided [CppInteropParseNote]
  57. // CHECK:STDERR: 2 | auto GlobalNoReturn(int a, int b, int c = 1, int d = 2) -> void;
  58. // CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  59. // CHECK:STDERR:
  60. Cpp.GlobalNoReturn(1);
  61. // CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:22: error: no matching function for call to 'GlobalNoReturn' [CppInteropParseError]
  62. // CHECK:STDERR: 26 | Cpp.GlobalNoReturn();
  63. // CHECK:STDERR: | ^
  64. // CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-17]]:10: in file included here [InCppInclude]
  65. // CHECK:STDERR: ./functions.h:2:6: note: candidate function not viable: requires at least 2 arguments, but 0 were provided [CppInteropParseNote]
  66. // CHECK:STDERR: 2 | auto GlobalNoReturn(int a, int b, int c = 1, int d = 2) -> void;
  67. // CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  68. // CHECK:STDERR:
  69. Cpp.GlobalNoReturn();
  70. // CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:24: error: no matching function for call to 'GlobalReturnInt' [CppInteropParseError]
  71. // CHECK:STDERR: 36 | Cpp.GlobalReturnInt(1);
  72. // CHECK:STDERR: | ^
  73. // CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-27]]:10: in file included here [InCppInclude]
  74. // CHECK:STDERR: ./functions.h:3:6: note: candidate function not viable: requires at least 2 arguments, but 1 was provided [CppInteropParseNote]
  75. // CHECK:STDERR: 3 | auto GlobalReturnInt(int a, int b, int c = 1, int d = 2) -> int;
  76. // CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  77. // CHECK:STDERR:
  78. Cpp.GlobalReturnInt(1);
  79. // CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:23: error: no matching function for call to 'GlobalReturnInt' [CppInteropParseError]
  80. // CHECK:STDERR: 46 | Cpp.GlobalReturnInt();
  81. // CHECK:STDERR: | ^
  82. // CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-37]]:10: in file included here [InCppInclude]
  83. // CHECK:STDERR: ./functions.h:3:6: note: candidate function not viable: requires at least 2 arguments, but 0 were provided [CppInteropParseNote]
  84. // CHECK:STDERR: 3 | auto GlobalReturnInt(int a, int b, int c = 1, int d = 2) -> int;
  85. // CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  86. // CHECK:STDERR:
  87. Cpp.GlobalReturnInt();
  88. // CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:19: error: no matching function for call to 'B' [CppInteropParseError]
  89. // CHECK:STDERR: 56 | ({} as Cpp.X).B();
  90. // CHECK:STDERR: | ^
  91. // CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-47]]:10: in file included here [InCppInclude]
  92. // CHECK:STDERR: ./functions.h:6:8: note: candidate function not viable: requires at least argument 'a', but no arguments were provided [CppInteropParseNote]
  93. // CHECK:STDERR: 6 | void B(int a, int b = 1);
  94. // CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~
  95. // CHECK:STDERR:
  96. ({} as Cpp.X).B();
  97. // CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:11: error: no matching function for call to 'C' [CppInteropParseError]
  98. // CHECK:STDERR: 66 | Cpp.X.C();
  99. // CHECK:STDERR: | ^
  100. // CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-57]]:10: in file included here [InCppInclude]
  101. // CHECK:STDERR: ./functions.h:7:15: note: candidate function not viable: requires at least argument 'a', but no arguments were provided [CppInteropParseNote]
  102. // CHECK:STDERR: 7 | static void C(int a, int b = 1);
  103. // CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~
  104. // CHECK:STDERR:
  105. Cpp.X.C();
  106. // CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:19: error: no matching function for call to 'D' [CppInteropParseError]
  107. // CHECK:STDERR: 76 | ({} as Cpp.X).D();
  108. // CHECK:STDERR: | ^
  109. // CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-67]]:10: in file included here [InCppInclude]
  110. // CHECK:STDERR: ./functions.h:8:8: note: candidate function not viable: requires at least non-object argument 'a', but no arguments were provided [CppInteropParseNote]
  111. // CHECK:STDERR: 8 | void D(this X, int a, int b = 1);
  112. // CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~~~~
  113. // CHECK:STDERR:
  114. ({} as Cpp.X).D();
  115. //@dump-sem-ir-end
  116. }
  117. // CHECK:STDOUT: --- call_without_default.carbon
  118. // CHECK:STDOUT:
  119. // CHECK:STDOUT: constants {
  120. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  121. // CHECK:STDOUT: %GlobalNoReturn.cpp_overload_set.type: type = cpp_overload_set_type @GlobalNoReturn.cpp_overload_set [concrete]
  122. // CHECK:STDOUT: %GlobalNoReturn.cpp_overload_set.value: %GlobalNoReturn.cpp_overload_set.type = cpp_overload_set_value @GlobalNoReturn.cpp_overload_set [concrete]
  123. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  124. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  125. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
  126. // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete]
  127. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  128. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  129. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  130. // CHECK:STDOUT: %GlobalNoReturn.type: type = fn_type @GlobalNoReturn [concrete]
  131. // CHECK:STDOUT: %GlobalNoReturn: %GlobalNoReturn.type = struct_value () [concrete]
  132. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  133. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  134. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  135. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  136. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  137. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  138. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  139. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  140. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete]
  141. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet [concrete]
  142. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  143. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  144. // CHECK:STDOUT: %bound_method.38b: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  145. // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
  146. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  147. // CHECK:STDOUT: %bound_method.646: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  148. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  149. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  150. // CHECK:STDOUT: %bound_method.fa7: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  151. // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
  152. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f0c: <bound method> = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  153. // CHECK:STDOUT: %bound_method.6d7: <bound method> = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  154. // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete]
  155. // CHECK:STDOUT: %GlobalReturnInt.cpp_overload_set.type: type = cpp_overload_set_type @GlobalReturnInt.cpp_overload_set [concrete]
  156. // CHECK:STDOUT: %GlobalReturnInt.cpp_overload_set.value: %GlobalReturnInt.cpp_overload_set.type = cpp_overload_set_value @GlobalReturnInt.cpp_overload_set [concrete]
  157. // CHECK:STDOUT: %GlobalReturnInt.type: type = fn_type @GlobalReturnInt [concrete]
  158. // CHECK:STDOUT: %GlobalReturnInt: %GlobalReturnInt.type = struct_value () [concrete]
  159. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  160. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  161. // CHECK:STDOUT: %X: type = class_type @X [concrete]
  162. // CHECK:STDOUT: %X.val: %X = struct_value () [concrete]
  163. // CHECK:STDOUT: %.3af: ref %X = temporary invalid, %X.val [concrete]
  164. // CHECK:STDOUT: %X.B.cpp_overload_set.type: type = cpp_overload_set_type @X.B.cpp_overload_set [concrete]
  165. // CHECK:STDOUT: %X.B.cpp_overload_set.value: %X.B.cpp_overload_set.type = cpp_overload_set_value @X.B.cpp_overload_set [concrete]
  166. // CHECK:STDOUT: %bound_method.a5d: <bound method> = bound_method %.3af, %X.B.cpp_overload_set.value [concrete]
  167. // CHECK:STDOUT: %pattern_type.46b: type = pattern_type %X [concrete]
  168. // CHECK:STDOUT: %X.B.type: type = fn_type @X.B [concrete]
  169. // CHECK:STDOUT: %X.B: %X.B.type = struct_value () [concrete]
  170. // CHECK:STDOUT: %X.C.cpp_overload_set.type: type = cpp_overload_set_type @X.C.cpp_overload_set [concrete]
  171. // CHECK:STDOUT: %X.C.cpp_overload_set.value: %X.C.cpp_overload_set.type = cpp_overload_set_value @X.C.cpp_overload_set [concrete]
  172. // CHECK:STDOUT: %X.C.type: type = fn_type @X.C [concrete]
  173. // CHECK:STDOUT: %X.C: %X.C.type = struct_value () [concrete]
  174. // CHECK:STDOUT: %X.D.cpp_overload_set.type: type = cpp_overload_set_type @X.D.cpp_overload_set [concrete]
  175. // CHECK:STDOUT: %X.D.cpp_overload_set.value: %X.D.cpp_overload_set.type = cpp_overload_set_value @X.D.cpp_overload_set [concrete]
  176. // CHECK:STDOUT: %bound_method.d5c: <bound method> = bound_method %.3af, %X.D.cpp_overload_set.value [concrete]
  177. // CHECK:STDOUT: %ptr.1f9: type = ptr_type %X [concrete]
  178. // CHECK:STDOUT: %D__carbon_thunk.type: type = fn_type @D__carbon_thunk [concrete]
  179. // CHECK:STDOUT: %D__carbon_thunk: %D__carbon_thunk.type = struct_value () [concrete]
  180. // CHECK:STDOUT: %X.cpp_destructor.type: type = fn_type @X.cpp_destructor [concrete]
  181. // CHECK:STDOUT: %X.cpp_destructor: %X.cpp_destructor.type = struct_value () [concrete]
  182. // CHECK:STDOUT: }
  183. // CHECK:STDOUT:
  184. // CHECK:STDOUT: imports {
  185. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  186. // CHECK:STDOUT: .GlobalNoReturn = %GlobalNoReturn.cpp_overload_set.value
  187. // CHECK:STDOUT: .GlobalReturnInt = %GlobalReturnInt.cpp_overload_set.value
  188. // CHECK:STDOUT: .X = %X.decl
  189. // CHECK:STDOUT: import Cpp//...
  190. // CHECK:STDOUT: }
  191. // CHECK:STDOUT: %GlobalNoReturn.cpp_overload_set.value: %GlobalNoReturn.cpp_overload_set.type = cpp_overload_set_value @GlobalNoReturn.cpp_overload_set [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
  192. // CHECK:STDOUT: %GlobalNoReturn.decl: %GlobalNoReturn.type = fn_decl @GlobalNoReturn [concrete = constants.%GlobalNoReturn] {
  193. // CHECK:STDOUT: <elided>
  194. // CHECK:STDOUT: } {
  195. // CHECK:STDOUT: <elided>
  196. // CHECK:STDOUT: }
  197. // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
  198. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  199. // CHECK:STDOUT: %GlobalReturnInt.cpp_overload_set.value: %GlobalReturnInt.cpp_overload_set.type = cpp_overload_set_value @GlobalReturnInt.cpp_overload_set [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
  200. // CHECK:STDOUT: %GlobalReturnInt.decl: %GlobalReturnInt.type = fn_decl @GlobalReturnInt [concrete = constants.%GlobalReturnInt] {
  201. // CHECK:STDOUT: <elided>
  202. // CHECK:STDOUT: } {
  203. // CHECK:STDOUT: <elided>
  204. // CHECK:STDOUT: }
  205. // CHECK:STDOUT: %X.decl: type = class_decl @X [concrete = constants.%X] {} {}
  206. // CHECK:STDOUT: %X.B.cpp_overload_set.value: %X.B.cpp_overload_set.type = cpp_overload_set_value @X.B.cpp_overload_set [concrete = constants.%X.B.cpp_overload_set.value]
  207. // CHECK:STDOUT: %X.B.decl: %X.B.type = fn_decl @X.B [concrete = constants.%X.B] {
  208. // CHECK:STDOUT: %self.param_patt: %pattern_type.46b = ref_param_pattern [concrete]
  209. // CHECK:STDOUT: %self.patt: %pattern_type.46b = at_binding_pattern self, %self.param_patt [concrete]
  210. // CHECK:STDOUT: <elided>
  211. // CHECK:STDOUT: } {
  212. // CHECK:STDOUT: %self.param: ref %X = ref_param call_param0
  213. // CHECK:STDOUT: %self: ref %X = ref_binding self, %self.param
  214. // CHECK:STDOUT: <elided>
  215. // CHECK:STDOUT: }
  216. // CHECK:STDOUT: %X.C.cpp_overload_set.value: %X.C.cpp_overload_set.type = cpp_overload_set_value @X.C.cpp_overload_set [concrete = constants.%X.C.cpp_overload_set.value]
  217. // CHECK:STDOUT: %X.C.decl: %X.C.type = fn_decl @X.C [concrete = constants.%X.C] {
  218. // CHECK:STDOUT: <elided>
  219. // CHECK:STDOUT: } {
  220. // CHECK:STDOUT: <elided>
  221. // CHECK:STDOUT: }
  222. // CHECK:STDOUT: %X.D.cpp_overload_set.value: %X.D.cpp_overload_set.type = cpp_overload_set_value @X.D.cpp_overload_set [concrete = constants.%X.D.cpp_overload_set.value]
  223. // CHECK:STDOUT: %D__carbon_thunk.decl: %D__carbon_thunk.type = fn_decl @D__carbon_thunk [concrete = constants.%D__carbon_thunk] {
  224. // CHECK:STDOUT: <elided>
  225. // CHECK:STDOUT: } {
  226. // CHECK:STDOUT: <elided>
  227. // CHECK:STDOUT: }
  228. // CHECK:STDOUT: %X.cpp_destructor.decl: %X.cpp_destructor.type = fn_decl @X.cpp_destructor [concrete = constants.%X.cpp_destructor] {
  229. // CHECK:STDOUT: %self.param_patt: %pattern_type.46b = ref_param_pattern [concrete]
  230. // CHECK:STDOUT: %self.patt: %pattern_type.46b = at_binding_pattern self, %self.param_patt [concrete]
  231. // CHECK:STDOUT: } {
  232. // CHECK:STDOUT: %self.param: ref %X = ref_param call_param0
  233. // CHECK:STDOUT: %self: ref %X = ref_binding self, %self.param
  234. // CHECK:STDOUT: }
  235. // CHECK:STDOUT: }
  236. // CHECK:STDOUT:
  237. // CHECK:STDOUT: fn @Call() {
  238. // CHECK:STDOUT: !entry:
  239. // CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  240. // CHECK:STDOUT: %GlobalNoReturn.ref: %GlobalNoReturn.cpp_overload_set.type = name_ref GlobalNoReturn, imports.%GlobalNoReturn.cpp_overload_set.value [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
  241. // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  242. // CHECK:STDOUT: %int_2.loc8: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  243. // CHECK:STDOUT: %int_3.loc8: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
  244. // CHECK:STDOUT: %int_4.loc8: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1]
  245. // CHECK:STDOUT: %impl.elem0.loc8_22: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  246. // CHECK:STDOUT: %bound_method.loc8_22.1: <bound method> = bound_method %int_1.loc8, %impl.elem0.loc8_22 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215]
  247. // CHECK:STDOUT: %specific_fn.loc8_22: <specific function> = specific_function %impl.elem0.loc8_22, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  248. // CHECK:STDOUT: %bound_method.loc8_22.2: <bound method> = bound_method %int_1.loc8, %specific_fn.loc8_22 [concrete = constants.%bound_method.38b]
  249. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_22: init %i32 = call %bound_method.loc8_22.2(%int_1.loc8) [concrete = constants.%int_1.5d2]
  250. // CHECK:STDOUT: %.loc8_22.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_22 [concrete = constants.%int_1.5d2]
  251. // CHECK:STDOUT: %.loc8_22.2: %i32 = converted %int_1.loc8, %.loc8_22.1 [concrete = constants.%int_1.5d2]
  252. // CHECK:STDOUT: %impl.elem0.loc8_25: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  253. // CHECK:STDOUT: %bound_method.loc8_25.1: <bound method> = bound_method %int_2.loc8, %impl.elem0.loc8_25 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5]
  254. // CHECK:STDOUT: %specific_fn.loc8_25: <specific function> = specific_function %impl.elem0.loc8_25, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  255. // CHECK:STDOUT: %bound_method.loc8_25.2: <bound method> = bound_method %int_2.loc8, %specific_fn.loc8_25 [concrete = constants.%bound_method.646]
  256. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_25: init %i32 = call %bound_method.loc8_25.2(%int_2.loc8) [concrete = constants.%int_2.ef8]
  257. // CHECK:STDOUT: %.loc8_25.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_25 [concrete = constants.%int_2.ef8]
  258. // CHECK:STDOUT: %.loc8_25.2: %i32 = converted %int_2.loc8, %.loc8_25.1 [concrete = constants.%int_2.ef8]
  259. // CHECK:STDOUT: %impl.elem0.loc8_28: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  260. // CHECK:STDOUT: %bound_method.loc8_28.1: <bound method> = bound_method %int_3.loc8, %impl.elem0.loc8_28 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061]
  261. // CHECK:STDOUT: %specific_fn.loc8_28: <specific function> = specific_function %impl.elem0.loc8_28, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  262. // CHECK:STDOUT: %bound_method.loc8_28.2: <bound method> = bound_method %int_3.loc8, %specific_fn.loc8_28 [concrete = constants.%bound_method.fa7]
  263. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_28: init %i32 = call %bound_method.loc8_28.2(%int_3.loc8) [concrete = constants.%int_3.822]
  264. // CHECK:STDOUT: %.loc8_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_28 [concrete = constants.%int_3.822]
  265. // CHECK:STDOUT: %.loc8_28.2: %i32 = converted %int_3.loc8, %.loc8_28.1 [concrete = constants.%int_3.822]
  266. // CHECK:STDOUT: %impl.elem0.loc8_31: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  267. // CHECK:STDOUT: %bound_method.loc8_31.1: <bound method> = bound_method %int_4.loc8, %impl.elem0.loc8_31 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f0c]
  268. // CHECK:STDOUT: %specific_fn.loc8_31: <specific function> = specific_function %impl.elem0.loc8_31, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  269. // CHECK:STDOUT: %bound_method.loc8_31.2: <bound method> = bound_method %int_4.loc8, %specific_fn.loc8_31 [concrete = constants.%bound_method.6d7]
  270. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_31: init %i32 = call %bound_method.loc8_31.2(%int_4.loc8) [concrete = constants.%int_4.940]
  271. // CHECK:STDOUT: %.loc8_31.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_31 [concrete = constants.%int_4.940]
  272. // CHECK:STDOUT: %.loc8_31.2: %i32 = converted %int_4.loc8, %.loc8_31.1 [concrete = constants.%int_4.940]
  273. // CHECK:STDOUT: %GlobalNoReturn.call: init %empty_tuple.type = call imports.%GlobalNoReturn.decl(%.loc8_22.2, %.loc8_25.2, %.loc8_28.2, %.loc8_31.2)
  274. // CHECK:STDOUT: name_binding_decl {
  275. // CHECK:STDOUT: %value.patt: %pattern_type.7ce = value_binding_pattern value [concrete]
  276. // CHECK:STDOUT: }
  277. // CHECK:STDOUT: %Cpp.ref.loc9: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  278. // CHECK:STDOUT: %GlobalReturnInt.ref: %GlobalReturnInt.cpp_overload_set.type = name_ref GlobalReturnInt, imports.%GlobalReturnInt.cpp_overload_set.value [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
  279. // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  280. // CHECK:STDOUT: %int_2.loc9: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  281. // CHECK:STDOUT: %int_3.loc9: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
  282. // CHECK:STDOUT: %int_4.loc9: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1]
  283. // CHECK:STDOUT: %impl.elem0.loc9_47: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  284. // CHECK:STDOUT: %bound_method.loc9_47.1: <bound method> = bound_method %int_1.loc9, %impl.elem0.loc9_47 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215]
  285. // CHECK:STDOUT: %specific_fn.loc9_47: <specific function> = specific_function %impl.elem0.loc9_47, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  286. // CHECK:STDOUT: %bound_method.loc9_47.2: <bound method> = bound_method %int_1.loc9, %specific_fn.loc9_47 [concrete = constants.%bound_method.38b]
  287. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_47: init %i32 = call %bound_method.loc9_47.2(%int_1.loc9) [concrete = constants.%int_1.5d2]
  288. // CHECK:STDOUT: %.loc9_47.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_47 [concrete = constants.%int_1.5d2]
  289. // CHECK:STDOUT: %.loc9_47.2: %i32 = converted %int_1.loc9, %.loc9_47.1 [concrete = constants.%int_1.5d2]
  290. // CHECK:STDOUT: %impl.elem0.loc9_50: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  291. // CHECK:STDOUT: %bound_method.loc9_50.1: <bound method> = bound_method %int_2.loc9, %impl.elem0.loc9_50 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5]
  292. // CHECK:STDOUT: %specific_fn.loc9_50: <specific function> = specific_function %impl.elem0.loc9_50, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  293. // CHECK:STDOUT: %bound_method.loc9_50.2: <bound method> = bound_method %int_2.loc9, %specific_fn.loc9_50 [concrete = constants.%bound_method.646]
  294. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_50: init %i32 = call %bound_method.loc9_50.2(%int_2.loc9) [concrete = constants.%int_2.ef8]
  295. // CHECK:STDOUT: %.loc9_50.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_50 [concrete = constants.%int_2.ef8]
  296. // CHECK:STDOUT: %.loc9_50.2: %i32 = converted %int_2.loc9, %.loc9_50.1 [concrete = constants.%int_2.ef8]
  297. // CHECK:STDOUT: %impl.elem0.loc9_53: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  298. // CHECK:STDOUT: %bound_method.loc9_53.1: <bound method> = bound_method %int_3.loc9, %impl.elem0.loc9_53 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061]
  299. // CHECK:STDOUT: %specific_fn.loc9_53: <specific function> = specific_function %impl.elem0.loc9_53, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  300. // CHECK:STDOUT: %bound_method.loc9_53.2: <bound method> = bound_method %int_3.loc9, %specific_fn.loc9_53 [concrete = constants.%bound_method.fa7]
  301. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_53: init %i32 = call %bound_method.loc9_53.2(%int_3.loc9) [concrete = constants.%int_3.822]
  302. // CHECK:STDOUT: %.loc9_53.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_53 [concrete = constants.%int_3.822]
  303. // CHECK:STDOUT: %.loc9_53.2: %i32 = converted %int_3.loc9, %.loc9_53.1 [concrete = constants.%int_3.822]
  304. // CHECK:STDOUT: %impl.elem0.loc9_56: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  305. // CHECK:STDOUT: %bound_method.loc9_56.1: <bound method> = bound_method %int_4.loc9, %impl.elem0.loc9_56 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f0c]
  306. // CHECK:STDOUT: %specific_fn.loc9_56: <specific function> = specific_function %impl.elem0.loc9_56, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  307. // CHECK:STDOUT: %bound_method.loc9_56.2: <bound method> = bound_method %int_4.loc9, %specific_fn.loc9_56 [concrete = constants.%bound_method.6d7]
  308. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_56: init %i32 = call %bound_method.loc9_56.2(%int_4.loc9) [concrete = constants.%int_4.940]
  309. // CHECK:STDOUT: %.loc9_56.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_56 [concrete = constants.%int_4.940]
  310. // CHECK:STDOUT: %.loc9_56.2: %i32 = converted %int_4.loc9, %.loc9_56.1 [concrete = constants.%int_4.940]
  311. // CHECK:STDOUT: %GlobalReturnInt.call: init %i32 = call imports.%GlobalReturnInt.decl(%.loc9_47.2, %.loc9_50.2, %.loc9_53.2, %.loc9_56.2)
  312. // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
  313. // CHECK:STDOUT: %.loc9_57.1: %i32 = value_of_initializer %GlobalReturnInt.call
  314. // CHECK:STDOUT: %.loc9_57.2: %i32 = converted %GlobalReturnInt.call, %.loc9_57.1
  315. // CHECK:STDOUT: %value: %i32 = value_binding value, %.loc9_57.2
  316. // CHECK:STDOUT: %.loc10_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  317. // CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  318. // CHECK:STDOUT: %X.ref.loc10: type = name_ref X, imports.%X.decl [concrete = constants.%X]
  319. // CHECK:STDOUT: %.loc10_5.2: ref %X = temporary_storage
  320. // CHECK:STDOUT: %.loc10_5.3: init %X to %.loc10_5.2 = class_init () [concrete = constants.%X.val]
  321. // CHECK:STDOUT: %.loc10_7.1: init %X = converted %.loc10_5.1, %.loc10_5.3 [concrete = constants.%X.val]
  322. // CHECK:STDOUT: %.loc10_7.2: ref %X = temporary %.loc10_5.2, %.loc10_7.1 [concrete = constants.%.3af]
  323. // CHECK:STDOUT: %B.ref: %X.B.cpp_overload_set.type = name_ref B, imports.%X.B.cpp_overload_set.value [concrete = constants.%X.B.cpp_overload_set.value]
  324. // CHECK:STDOUT: %bound_method.loc10_16: <bound method> = bound_method %.loc10_7.2, %B.ref [concrete = constants.%bound_method.a5d]
  325. // CHECK:STDOUT: %int_1.loc10: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  326. // CHECK:STDOUT: %int_2.loc10: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  327. // CHECK:STDOUT: %impl.elem0.loc10_19: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  328. // CHECK:STDOUT: %bound_method.loc10_19.1: <bound method> = bound_method %int_1.loc10, %impl.elem0.loc10_19 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215]
  329. // CHECK:STDOUT: %specific_fn.loc10_19: <specific function> = specific_function %impl.elem0.loc10_19, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  330. // CHECK:STDOUT: %bound_method.loc10_19.2: <bound method> = bound_method %int_1.loc10, %specific_fn.loc10_19 [concrete = constants.%bound_method.38b]
  331. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_19: init %i32 = call %bound_method.loc10_19.2(%int_1.loc10) [concrete = constants.%int_1.5d2]
  332. // CHECK:STDOUT: %.loc10_19.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_19 [concrete = constants.%int_1.5d2]
  333. // CHECK:STDOUT: %.loc10_19.2: %i32 = converted %int_1.loc10, %.loc10_19.1 [concrete = constants.%int_1.5d2]
  334. // CHECK:STDOUT: %impl.elem0.loc10_22: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  335. // CHECK:STDOUT: %bound_method.loc10_22.1: <bound method> = bound_method %int_2.loc10, %impl.elem0.loc10_22 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5]
  336. // CHECK:STDOUT: %specific_fn.loc10_22: <specific function> = specific_function %impl.elem0.loc10_22, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  337. // CHECK:STDOUT: %bound_method.loc10_22.2: <bound method> = bound_method %int_2.loc10, %specific_fn.loc10_22 [concrete = constants.%bound_method.646]
  338. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_22: init %i32 = call %bound_method.loc10_22.2(%int_2.loc10) [concrete = constants.%int_2.ef8]
  339. // CHECK:STDOUT: %.loc10_22.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_22 [concrete = constants.%int_2.ef8]
  340. // CHECK:STDOUT: %.loc10_22.2: %i32 = converted %int_2.loc10, %.loc10_22.1 [concrete = constants.%int_2.ef8]
  341. // CHECK:STDOUT: %X.B.call: init %empty_tuple.type = call imports.%X.B.decl(%.loc10_7.2, %.loc10_19.2, %.loc10_22.2)
  342. // CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  343. // CHECK:STDOUT: %X.ref.loc11: type = name_ref X, imports.%X.decl [concrete = constants.%X]
  344. // CHECK:STDOUT: %C.ref: %X.C.cpp_overload_set.type = name_ref C, imports.%X.C.cpp_overload_set.value [concrete = constants.%X.C.cpp_overload_set.value]
  345. // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  346. // CHECK:STDOUT: %int_2.loc11: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  347. // CHECK:STDOUT: %impl.elem0.loc11_11: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  348. // CHECK:STDOUT: %bound_method.loc11_11.1: <bound method> = bound_method %int_1.loc11, %impl.elem0.loc11_11 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215]
  349. // CHECK:STDOUT: %specific_fn.loc11_11: <specific function> = specific_function %impl.elem0.loc11_11, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  350. // CHECK:STDOUT: %bound_method.loc11_11.2: <bound method> = bound_method %int_1.loc11, %specific_fn.loc11_11 [concrete = constants.%bound_method.38b]
  351. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc11_11: init %i32 = call %bound_method.loc11_11.2(%int_1.loc11) [concrete = constants.%int_1.5d2]
  352. // CHECK:STDOUT: %.loc11_11.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc11_11 [concrete = constants.%int_1.5d2]
  353. // CHECK:STDOUT: %.loc11_11.2: %i32 = converted %int_1.loc11, %.loc11_11.1 [concrete = constants.%int_1.5d2]
  354. // CHECK:STDOUT: %impl.elem0.loc11_14: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  355. // CHECK:STDOUT: %bound_method.loc11_14.1: <bound method> = bound_method %int_2.loc11, %impl.elem0.loc11_14 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5]
  356. // CHECK:STDOUT: %specific_fn.loc11_14: <specific function> = specific_function %impl.elem0.loc11_14, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  357. // CHECK:STDOUT: %bound_method.loc11_14.2: <bound method> = bound_method %int_2.loc11, %specific_fn.loc11_14 [concrete = constants.%bound_method.646]
  358. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc11_14: init %i32 = call %bound_method.loc11_14.2(%int_2.loc11) [concrete = constants.%int_2.ef8]
  359. // CHECK:STDOUT: %.loc11_14.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc11_14 [concrete = constants.%int_2.ef8]
  360. // CHECK:STDOUT: %.loc11_14.2: %i32 = converted %int_2.loc11, %.loc11_14.1 [concrete = constants.%int_2.ef8]
  361. // CHECK:STDOUT: %X.C.call: init %empty_tuple.type = call imports.%X.C.decl(%.loc11_11.2, %.loc11_14.2)
  362. // CHECK:STDOUT: %.loc12_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  363. // CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  364. // CHECK:STDOUT: %X.ref.loc12: type = name_ref X, imports.%X.decl [concrete = constants.%X]
  365. // CHECK:STDOUT: %.loc12_5.2: ref %X = temporary_storage
  366. // CHECK:STDOUT: %.loc12_5.3: init %X to %.loc12_5.2 = class_init () [concrete = constants.%X.val]
  367. // CHECK:STDOUT: %.loc12_7.1: init %X = converted %.loc12_5.1, %.loc12_5.3 [concrete = constants.%X.val]
  368. // CHECK:STDOUT: %.loc12_7.2: ref %X = temporary %.loc12_5.2, %.loc12_7.1 [concrete = constants.%.3af]
  369. // CHECK:STDOUT: %D.ref: %X.D.cpp_overload_set.type = name_ref D, imports.%X.D.cpp_overload_set.value [concrete = constants.%X.D.cpp_overload_set.value]
  370. // CHECK:STDOUT: %bound_method.loc12_16: <bound method> = bound_method %.loc12_7.2, %D.ref [concrete = constants.%bound_method.d5c]
  371. // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  372. // CHECK:STDOUT: %int_2.loc12: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  373. // CHECK:STDOUT: %.loc12_7.3: %X = acquire_value %.loc12_7.2
  374. // CHECK:STDOUT: %impl.elem0.loc12_19: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  375. // CHECK:STDOUT: %bound_method.loc12_19.1: <bound method> = bound_method %int_1.loc12, %impl.elem0.loc12_19 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215]
  376. // CHECK:STDOUT: %specific_fn.loc12_19: <specific function> = specific_function %impl.elem0.loc12_19, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  377. // CHECK:STDOUT: %bound_method.loc12_19.2: <bound method> = bound_method %int_1.loc12, %specific_fn.loc12_19 [concrete = constants.%bound_method.38b]
  378. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc12_19: init %i32 = call %bound_method.loc12_19.2(%int_1.loc12) [concrete = constants.%int_1.5d2]
  379. // CHECK:STDOUT: %.loc12_19.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc12_19 [concrete = constants.%int_1.5d2]
  380. // CHECK:STDOUT: %.loc12_19.2: %i32 = converted %int_1.loc12, %.loc12_19.1 [concrete = constants.%int_1.5d2]
  381. // CHECK:STDOUT: %impl.elem0.loc12_22: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  382. // CHECK:STDOUT: %bound_method.loc12_22.1: <bound method> = bound_method %int_2.loc12, %impl.elem0.loc12_22 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5]
  383. // CHECK:STDOUT: %specific_fn.loc12_22: <specific function> = specific_function %impl.elem0.loc12_22, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  384. // CHECK:STDOUT: %bound_method.loc12_22.2: <bound method> = bound_method %int_2.loc12, %specific_fn.loc12_22 [concrete = constants.%bound_method.646]
  385. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc12_22: init %i32 = call %bound_method.loc12_22.2(%int_2.loc12) [concrete = constants.%int_2.ef8]
  386. // CHECK:STDOUT: %.loc12_22.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc12_22 [concrete = constants.%int_2.ef8]
  387. // CHECK:STDOUT: %.loc12_22.2: %i32 = converted %int_2.loc12, %.loc12_22.1 [concrete = constants.%int_2.ef8]
  388. // CHECK:STDOUT: %.loc12_7.4: ref %X = value_as_ref %.loc12_7.3
  389. // CHECK:STDOUT: %addr: %ptr.1f9 = addr_of %.loc12_7.4
  390. // CHECK:STDOUT: %D__carbon_thunk.call: init %empty_tuple.type = call imports.%D__carbon_thunk.decl(%addr, %.loc12_19.2, %.loc12_22.2)
  391. // CHECK:STDOUT: <elided>
  392. // CHECK:STDOUT: %Op.ref.loc12: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor]
  393. // CHECK:STDOUT: %Op.ref.loc10: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor]
  394. // CHECK:STDOUT: <elided>
  395. // CHECK:STDOUT: }
  396. // CHECK:STDOUT:
  397. // CHECK:STDOUT: --- call_with_default.carbon
  398. // CHECK:STDOUT:
  399. // CHECK:STDOUT: constants {
  400. // CHECK:STDOUT: %Call.type: type = fn_type @Call [concrete]
  401. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  402. // CHECK:STDOUT: %Call: %Call.type = struct_value () [concrete]
  403. // CHECK:STDOUT: %GlobalNoReturn.cpp_overload_set.type: type = cpp_overload_set_type @GlobalNoReturn.cpp_overload_set [concrete]
  404. // CHECK:STDOUT: %GlobalNoReturn.cpp_overload_set.value: %GlobalNoReturn.cpp_overload_set.type = cpp_overload_set_value @GlobalNoReturn.cpp_overload_set [concrete]
  405. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  406. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  407. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  408. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  409. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  410. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  411. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  412. // CHECK:STDOUT: %GlobalNoReturn__carbon_thunk.type.f197cb.1: type = fn_type @GlobalNoReturn__carbon_thunk.1 [concrete]
  413. // CHECK:STDOUT: %GlobalNoReturn__carbon_thunk.ea1e66.1: %GlobalNoReturn__carbon_thunk.type.f197cb.1 = struct_value () [concrete]
  414. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  415. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  416. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  417. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  418. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  419. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  420. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  421. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  422. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  423. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  424. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete]
  425. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet [concrete]
  426. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  427. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  428. // CHECK:STDOUT: %bound_method.38b: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  429. // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
  430. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  431. // CHECK:STDOUT: %bound_method.646: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  432. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  433. // CHECK:STDOUT: %GlobalReturnInt.cpp_overload_set.type: type = cpp_overload_set_type @GlobalReturnInt.cpp_overload_set [concrete]
  434. // CHECK:STDOUT: %GlobalReturnInt.cpp_overload_set.value: %GlobalReturnInt.cpp_overload_set.type = cpp_overload_set_value @GlobalReturnInt.cpp_overload_set [concrete]
  435. // CHECK:STDOUT: %GlobalReturnInt__carbon_thunk.type: type = fn_type @GlobalReturnInt__carbon_thunk [concrete]
  436. // CHECK:STDOUT: %GlobalReturnInt__carbon_thunk: %GlobalReturnInt__carbon_thunk.type = struct_value () [concrete]
  437. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
  438. // CHECK:STDOUT: %GlobalNoReturn__carbon_thunk.type.f197cb.2: type = fn_type @GlobalNoReturn__carbon_thunk.2 [concrete]
  439. // CHECK:STDOUT: %GlobalNoReturn__carbon_thunk.ea1e66.2: %GlobalNoReturn__carbon_thunk.type.f197cb.2 = struct_value () [concrete]
  440. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  441. // CHECK:STDOUT: %bound_method.fa7: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  442. // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
  443. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  444. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  445. // CHECK:STDOUT: %X: type = class_type @X [concrete]
  446. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  447. // CHECK:STDOUT: %X.val: %X = struct_value () [concrete]
  448. // CHECK:STDOUT: %.3af: ref %X = temporary invalid, %X.val [concrete]
  449. // CHECK:STDOUT: %X.B.cpp_overload_set.type: type = cpp_overload_set_type @X.B.cpp_overload_set [concrete]
  450. // CHECK:STDOUT: %X.B.cpp_overload_set.value: %X.B.cpp_overload_set.type = cpp_overload_set_value @X.B.cpp_overload_set [concrete]
  451. // CHECK:STDOUT: %bound_method.a5d: <bound method> = bound_method %.3af, %X.B.cpp_overload_set.value [concrete]
  452. // CHECK:STDOUT: %pattern_type.46b: type = pattern_type %X [concrete]
  453. // CHECK:STDOUT: %B__carbon_thunk.type: type = fn_type @B__carbon_thunk [concrete]
  454. // CHECK:STDOUT: %B__carbon_thunk: %B__carbon_thunk.type = struct_value () [concrete]
  455. // CHECK:STDOUT: %X.C.cpp_overload_set.type: type = cpp_overload_set_type @X.C.cpp_overload_set [concrete]
  456. // CHECK:STDOUT: %X.C.cpp_overload_set.value: %X.C.cpp_overload_set.type = cpp_overload_set_value @X.C.cpp_overload_set [concrete]
  457. // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
  458. // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
  459. // CHECK:STDOUT: %X.D.cpp_overload_set.type: type = cpp_overload_set_type @X.D.cpp_overload_set [concrete]
  460. // CHECK:STDOUT: %X.D.cpp_overload_set.value: %X.D.cpp_overload_set.type = cpp_overload_set_value @X.D.cpp_overload_set [concrete]
  461. // CHECK:STDOUT: %bound_method.d5c: <bound method> = bound_method %.3af, %X.D.cpp_overload_set.value [concrete]
  462. // CHECK:STDOUT: %ptr.1f9: type = ptr_type %X [concrete]
  463. // CHECK:STDOUT: %pattern_type.45c: type = pattern_type %ptr.1f9 [concrete]
  464. // CHECK:STDOUT: %D__carbon_thunk.type: type = fn_type @D__carbon_thunk [concrete]
  465. // CHECK:STDOUT: %D__carbon_thunk: %D__carbon_thunk.type = struct_value () [concrete]
  466. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  467. // CHECK:STDOUT: %X.cpp_destructor.type: type = fn_type @X.cpp_destructor [concrete]
  468. // CHECK:STDOUT: %X.cpp_destructor: %X.cpp_destructor.type = struct_value () [concrete]
  469. // CHECK:STDOUT: %X.Op.type: type = fn_type @X.Op [concrete]
  470. // CHECK:STDOUT: %X.Op: %X.Op.type = struct_value () [concrete]
  471. // CHECK:STDOUT: }
  472. // CHECK:STDOUT:
  473. // CHECK:STDOUT: imports {
  474. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  475. // CHECK:STDOUT: .Int = %Core.Int
  476. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  477. // CHECK:STDOUT: .Destroy = %Core.Destroy
  478. // CHECK:STDOUT: import Core//prelude
  479. // CHECK:STDOUT: import Core//prelude/...
  480. // CHECK:STDOUT: }
  481. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  482. // CHECK:STDOUT: .GlobalNoReturn = %GlobalNoReturn.cpp_overload_set.value
  483. // CHECK:STDOUT: .GlobalReturnInt = %GlobalReturnInt.cpp_overload_set.value
  484. // CHECK:STDOUT: .X = %X.decl
  485. // CHECK:STDOUT: import Cpp//...
  486. // CHECK:STDOUT: }
  487. // CHECK:STDOUT: %GlobalNoReturn.cpp_overload_set.value: %GlobalNoReturn.cpp_overload_set.type = cpp_overload_set_value @GlobalNoReturn.cpp_overload_set [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
  488. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  489. // CHECK:STDOUT: %GlobalNoReturn__carbon_thunk.decl.305fd1.1: %GlobalNoReturn__carbon_thunk.type.f197cb.1 = fn_decl @GlobalNoReturn__carbon_thunk.1 [concrete = constants.%GlobalNoReturn__carbon_thunk.ea1e66.1] {
  490. // CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern [concrete]
  491. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = at_binding_pattern a, %a.param_patt [concrete]
  492. // CHECK:STDOUT: %b.param_patt: %pattern_type.7ce = value_param_pattern [concrete]
  493. // CHECK:STDOUT: %b.patt: %pattern_type.7ce = at_binding_pattern b, %b.param_patt [concrete]
  494. // CHECK:STDOUT: } {
  495. // CHECK:STDOUT: %a.param: %i32 = value_param call_param0
  496. // CHECK:STDOUT: %.1: type = splice_block %i32.4 [concrete = constants.%i32] {
  497. // CHECK:STDOUT: %int_32.2: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  498. // CHECK:STDOUT: %i32.3: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  499. // CHECK:STDOUT: %i32.4: type = type_literal %i32.3 [concrete = constants.%i32]
  500. // CHECK:STDOUT: }
  501. // CHECK:STDOUT: %a: %i32 = value_binding a, %a.param
  502. // CHECK:STDOUT: %b.param: %i32 = value_param call_param1
  503. // CHECK:STDOUT: %.2: type = splice_block %i32.2 [concrete = constants.%i32] {
  504. // CHECK:STDOUT: %int_32.1: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  505. // CHECK:STDOUT: %i32.1: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  506. // CHECK:STDOUT: %i32.2: type = type_literal %i32.1 [concrete = constants.%i32]
  507. // CHECK:STDOUT: }
  508. // CHECK:STDOUT: %b: %i32 = value_binding b, %b.param
  509. // CHECK:STDOUT: }
  510. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  511. // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
  512. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  513. // CHECK:STDOUT: %GlobalReturnInt.cpp_overload_set.value: %GlobalReturnInt.cpp_overload_set.type = cpp_overload_set_value @GlobalReturnInt.cpp_overload_set [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
  514. // CHECK:STDOUT: %GlobalReturnInt__carbon_thunk.decl: %GlobalReturnInt__carbon_thunk.type = fn_decl @GlobalReturnInt__carbon_thunk [concrete = constants.%GlobalReturnInt__carbon_thunk] {
  515. // CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern [concrete]
  516. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = at_binding_pattern a, %a.param_patt [concrete]
  517. // CHECK:STDOUT: %b.param_patt: %pattern_type.7ce = value_param_pattern [concrete]
  518. // CHECK:STDOUT: %b.patt: %pattern_type.7ce = at_binding_pattern b, %b.param_patt [concrete]
  519. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern [concrete]
  520. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern %return.param_patt, %i32.2 [concrete]
  521. // CHECK:STDOUT: } {
  522. // CHECK:STDOUT: %int_32.1: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  523. // CHECK:STDOUT: %i32.1: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  524. // CHECK:STDOUT: %i32.2: type = type_literal %i32.1 [concrete = constants.%i32]
  525. // CHECK:STDOUT: %a.param: %i32 = value_param call_param0
  526. // CHECK:STDOUT: %.1: type = splice_block %i32.6 [concrete = constants.%i32] {
  527. // CHECK:STDOUT: %int_32.3: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  528. // CHECK:STDOUT: %i32.5: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  529. // CHECK:STDOUT: %i32.6: type = type_literal %i32.5 [concrete = constants.%i32]
  530. // CHECK:STDOUT: }
  531. // CHECK:STDOUT: %a: %i32 = value_binding a, %a.param
  532. // CHECK:STDOUT: %b.param: %i32 = value_param call_param1
  533. // CHECK:STDOUT: %.2: type = splice_block %i32.4 [concrete = constants.%i32] {
  534. // CHECK:STDOUT: %int_32.2: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  535. // CHECK:STDOUT: %i32.3: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  536. // CHECK:STDOUT: %i32.4: type = type_literal %i32.3 [concrete = constants.%i32]
  537. // CHECK:STDOUT: }
  538. // CHECK:STDOUT: %b: %i32 = value_binding b, %b.param
  539. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2
  540. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  541. // CHECK:STDOUT: }
  542. // CHECK:STDOUT: %GlobalNoReturn__carbon_thunk.decl.305fd1.2: %GlobalNoReturn__carbon_thunk.type.f197cb.2 = fn_decl @GlobalNoReturn__carbon_thunk.2 [concrete = constants.%GlobalNoReturn__carbon_thunk.ea1e66.2] {
  543. // CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern [concrete]
  544. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = at_binding_pattern a, %a.param_patt [concrete]
  545. // CHECK:STDOUT: %b.param_patt: %pattern_type.7ce = value_param_pattern [concrete]
  546. // CHECK:STDOUT: %b.patt: %pattern_type.7ce = at_binding_pattern b, %b.param_patt [concrete]
  547. // CHECK:STDOUT: %c.param_patt: %pattern_type.7ce = value_param_pattern [concrete]
  548. // CHECK:STDOUT: %c.patt: %pattern_type.7ce = at_binding_pattern c, %c.param_patt [concrete]
  549. // CHECK:STDOUT: } {
  550. // CHECK:STDOUT: %a.param: %i32 = value_param call_param0
  551. // CHECK:STDOUT: %.1: type = splice_block %i32.6 [concrete = constants.%i32] {
  552. // CHECK:STDOUT: %int_32.3: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  553. // CHECK:STDOUT: %i32.5: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  554. // CHECK:STDOUT: %i32.6: type = type_literal %i32.5 [concrete = constants.%i32]
  555. // CHECK:STDOUT: }
  556. // CHECK:STDOUT: %a: %i32 = value_binding a, %a.param
  557. // CHECK:STDOUT: %b.param: %i32 = value_param call_param1
  558. // CHECK:STDOUT: %.2: type = splice_block %i32.4 [concrete = constants.%i32] {
  559. // CHECK:STDOUT: %int_32.2: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  560. // CHECK:STDOUT: %i32.3: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  561. // CHECK:STDOUT: %i32.4: type = type_literal %i32.3 [concrete = constants.%i32]
  562. // CHECK:STDOUT: }
  563. // CHECK:STDOUT: %b: %i32 = value_binding b, %b.param
  564. // CHECK:STDOUT: %c.param: %i32 = value_param call_param2
  565. // CHECK:STDOUT: %.3: type = splice_block %i32.2 [concrete = constants.%i32] {
  566. // CHECK:STDOUT: %int_32.1: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  567. // CHECK:STDOUT: %i32.1: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  568. // CHECK:STDOUT: %i32.2: type = type_literal %i32.1 [concrete = constants.%i32]
  569. // CHECK:STDOUT: }
  570. // CHECK:STDOUT: %c: %i32 = value_binding c, %c.param
  571. // CHECK:STDOUT: }
  572. // CHECK:STDOUT: %X.decl: type = class_decl @X [concrete = constants.%X] {} {}
  573. // CHECK:STDOUT: %X.B.cpp_overload_set.value: %X.B.cpp_overload_set.type = cpp_overload_set_value @X.B.cpp_overload_set [concrete = constants.%X.B.cpp_overload_set.value]
  574. // CHECK:STDOUT: %B__carbon_thunk.decl: %B__carbon_thunk.type = fn_decl @B__carbon_thunk [concrete = constants.%B__carbon_thunk] {
  575. // CHECK:STDOUT: %this.param_patt: %pattern_type.46b = ref_param_pattern [concrete]
  576. // CHECK:STDOUT: %this.patt: %pattern_type.46b = at_binding_pattern this, %this.param_patt [concrete]
  577. // CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern [concrete]
  578. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = at_binding_pattern a, %a.param_patt [concrete]
  579. // CHECK:STDOUT: } {
  580. // CHECK:STDOUT: %this.param: ref %X = ref_param call_param0
  581. // CHECK:STDOUT: %this: ref %X = ref_binding this, %this.param
  582. // CHECK:STDOUT: %a.param: %i32 = value_param call_param1
  583. // CHECK:STDOUT: %.1: type = splice_block %i32.2 [concrete = constants.%i32] {
  584. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  585. // CHECK:STDOUT: %i32.1: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  586. // CHECK:STDOUT: %i32.2: type = type_literal %i32.1 [concrete = constants.%i32]
  587. // CHECK:STDOUT: }
  588. // CHECK:STDOUT: %a: %i32 = value_binding a, %a.param
  589. // CHECK:STDOUT: }
  590. // CHECK:STDOUT: %X.C.cpp_overload_set.value: %X.C.cpp_overload_set.type = cpp_overload_set_value @X.C.cpp_overload_set [concrete = constants.%X.C.cpp_overload_set.value]
  591. // CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
  592. // CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern [concrete]
  593. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = at_binding_pattern a, %a.param_patt [concrete]
  594. // CHECK:STDOUT: } {
  595. // CHECK:STDOUT: %a.param: %i32 = value_param call_param0
  596. // CHECK:STDOUT: %.1: type = splice_block %i32.2 [concrete = constants.%i32] {
  597. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  598. // CHECK:STDOUT: %i32.1: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  599. // CHECK:STDOUT: %i32.2: type = type_literal %i32.1 [concrete = constants.%i32]
  600. // CHECK:STDOUT: }
  601. // CHECK:STDOUT: %a: %i32 = value_binding a, %a.param
  602. // CHECK:STDOUT: }
  603. // CHECK:STDOUT: %X.D.cpp_overload_set.value: %X.D.cpp_overload_set.type = cpp_overload_set_value @X.D.cpp_overload_set [concrete = constants.%X.D.cpp_overload_set.value]
  604. // CHECK:STDOUT: %D__carbon_thunk.decl: %D__carbon_thunk.type = fn_decl @D__carbon_thunk [concrete = constants.%D__carbon_thunk] {
  605. // CHECK:STDOUT: %_.param_patt: %pattern_type.45c = value_param_pattern [concrete]
  606. // CHECK:STDOUT: %_.patt: %pattern_type.45c = at_binding_pattern _, %_.param_patt [concrete]
  607. // CHECK:STDOUT: %a.param_patt: %pattern_type.7ce = value_param_pattern [concrete]
  608. // CHECK:STDOUT: %a.patt: %pattern_type.7ce = at_binding_pattern a, %a.param_patt [concrete]
  609. // CHECK:STDOUT: } {
  610. // CHECK:STDOUT: %_.param: %ptr.1f9 = value_param call_param0
  611. // CHECK:STDOUT: %_: %ptr.1f9 = value_binding _, %_.param
  612. // CHECK:STDOUT: %a.param: %i32 = value_param call_param1
  613. // CHECK:STDOUT: %.1: type = splice_block %i32.2 [concrete = constants.%i32] {
  614. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  615. // CHECK:STDOUT: %i32.1: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  616. // CHECK:STDOUT: %i32.2: type = type_literal %i32.1 [concrete = constants.%i32]
  617. // CHECK:STDOUT: }
  618. // CHECK:STDOUT: %a: %i32 = value_binding a, %a.param
  619. // CHECK:STDOUT: }
  620. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  621. // CHECK:STDOUT: %X.cpp_destructor.decl: %X.cpp_destructor.type = fn_decl @X.cpp_destructor [concrete = constants.%X.cpp_destructor] {
  622. // CHECK:STDOUT: %self.param_patt: %pattern_type.46b = ref_param_pattern [concrete]
  623. // CHECK:STDOUT: %self.patt: %pattern_type.46b = at_binding_pattern self, %self.param_patt [concrete]
  624. // CHECK:STDOUT: } {
  625. // CHECK:STDOUT: %self.param: ref %X = ref_param call_param0
  626. // CHECK:STDOUT: %self: ref %X = ref_binding self, %self.param
  627. // CHECK:STDOUT: }
  628. // CHECK:STDOUT: }
  629. // CHECK:STDOUT:
  630. // CHECK:STDOUT: file {
  631. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  632. // CHECK:STDOUT: .Core = imports.%Core
  633. // CHECK:STDOUT: .Cpp = imports.%Cpp
  634. // CHECK:STDOUT: .Call = %Call.decl
  635. // CHECK:STDOUT: }
  636. // CHECK:STDOUT: %Core.import = import Core
  637. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  638. // CHECK:STDOUT: import Cpp "functions.h"
  639. // CHECK:STDOUT: }
  640. // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [concrete = constants.%Call] {} {}
  641. // CHECK:STDOUT: }
  642. // CHECK:STDOUT:
  643. // CHECK:STDOUT: class @X {
  644. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  645. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  646. // CHECK:STDOUT: complete_type_witness = %complete_type
  647. // CHECK:STDOUT:
  648. // CHECK:STDOUT: !members:
  649. // CHECK:STDOUT: .B = imports.%X.B.cpp_overload_set.value
  650. // CHECK:STDOUT: .C = imports.%X.C.cpp_overload_set.value
  651. // CHECK:STDOUT: .D = imports.%X.D.cpp_overload_set.value
  652. // CHECK:STDOUT: import Cpp//...
  653. // CHECK:STDOUT: }
  654. // CHECK:STDOUT:
  655. // CHECK:STDOUT: fn @Call() {
  656. // CHECK:STDOUT: !entry:
  657. // CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  658. // CHECK:STDOUT: %GlobalNoReturn.ref.loc8: %GlobalNoReturn.cpp_overload_set.type = name_ref GlobalNoReturn, imports.%GlobalNoReturn.cpp_overload_set.value [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
  659. // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  660. // CHECK:STDOUT: %int_2.loc8: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  661. // CHECK:STDOUT: %impl.elem0.loc8_22: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  662. // CHECK:STDOUT: %bound_method.loc8_22.1: <bound method> = bound_method %int_1.loc8, %impl.elem0.loc8_22 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215]
  663. // CHECK:STDOUT: %specific_fn.loc8_22: <specific function> = specific_function %impl.elem0.loc8_22, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  664. // CHECK:STDOUT: %bound_method.loc8_22.2: <bound method> = bound_method %int_1.loc8, %specific_fn.loc8_22 [concrete = constants.%bound_method.38b]
  665. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_22: init %i32 = call %bound_method.loc8_22.2(%int_1.loc8) [concrete = constants.%int_1.5d2]
  666. // CHECK:STDOUT: %.loc8_22.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_22 [concrete = constants.%int_1.5d2]
  667. // CHECK:STDOUT: %.loc8_22.2: %i32 = converted %int_1.loc8, %.loc8_22.1 [concrete = constants.%int_1.5d2]
  668. // CHECK:STDOUT: %impl.elem0.loc8_25: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  669. // CHECK:STDOUT: %bound_method.loc8_25.1: <bound method> = bound_method %int_2.loc8, %impl.elem0.loc8_25 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5]
  670. // CHECK:STDOUT: %specific_fn.loc8_25: <specific function> = specific_function %impl.elem0.loc8_25, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  671. // CHECK:STDOUT: %bound_method.loc8_25.2: <bound method> = bound_method %int_2.loc8, %specific_fn.loc8_25 [concrete = constants.%bound_method.646]
  672. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_25: init %i32 = call %bound_method.loc8_25.2(%int_2.loc8) [concrete = constants.%int_2.ef8]
  673. // CHECK:STDOUT: %.loc8_25.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_25 [concrete = constants.%int_2.ef8]
  674. // CHECK:STDOUT: %.loc8_25.2: %i32 = converted %int_2.loc8, %.loc8_25.1 [concrete = constants.%int_2.ef8]
  675. // CHECK:STDOUT: %GlobalNoReturn__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%GlobalNoReturn__carbon_thunk.decl.305fd1.1(%.loc8_22.2, %.loc8_25.2)
  676. // CHECK:STDOUT: name_binding_decl {
  677. // CHECK:STDOUT: %value.patt: %pattern_type.7ce = value_binding_pattern value [concrete]
  678. // CHECK:STDOUT: }
  679. // CHECK:STDOUT: %Cpp.ref.loc9: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  680. // CHECK:STDOUT: %GlobalReturnInt.ref: %GlobalReturnInt.cpp_overload_set.type = name_ref GlobalReturnInt, imports.%GlobalReturnInt.cpp_overload_set.value [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
  681. // CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  682. // CHECK:STDOUT: %int_2.loc9: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  683. // CHECK:STDOUT: %impl.elem0.loc9_47: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  684. // CHECK:STDOUT: %bound_method.loc9_47.1: <bound method> = bound_method %int_1.loc9, %impl.elem0.loc9_47 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215]
  685. // CHECK:STDOUT: %specific_fn.loc9_47: <specific function> = specific_function %impl.elem0.loc9_47, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  686. // CHECK:STDOUT: %bound_method.loc9_47.2: <bound method> = bound_method %int_1.loc9, %specific_fn.loc9_47 [concrete = constants.%bound_method.38b]
  687. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_47: init %i32 = call %bound_method.loc9_47.2(%int_1.loc9) [concrete = constants.%int_1.5d2]
  688. // CHECK:STDOUT: %.loc9_47.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_47 [concrete = constants.%int_1.5d2]
  689. // CHECK:STDOUT: %.loc9_47.2: %i32 = converted %int_1.loc9, %.loc9_47.1 [concrete = constants.%int_1.5d2]
  690. // CHECK:STDOUT: %impl.elem0.loc9_50: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  691. // CHECK:STDOUT: %bound_method.loc9_50.1: <bound method> = bound_method %int_2.loc9, %impl.elem0.loc9_50 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5]
  692. // CHECK:STDOUT: %specific_fn.loc9_50: <specific function> = specific_function %impl.elem0.loc9_50, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  693. // CHECK:STDOUT: %bound_method.loc9_50.2: <bound method> = bound_method %int_2.loc9, %specific_fn.loc9_50 [concrete = constants.%bound_method.646]
  694. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_50: init %i32 = call %bound_method.loc9_50.2(%int_2.loc9) [concrete = constants.%int_2.ef8]
  695. // CHECK:STDOUT: %.loc9_50.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_50 [concrete = constants.%int_2.ef8]
  696. // CHECK:STDOUT: %.loc9_50.2: %i32 = converted %int_2.loc9, %.loc9_50.1 [concrete = constants.%int_2.ef8]
  697. // CHECK:STDOUT: %GlobalReturnInt__carbon_thunk.call: init %i32 = call imports.%GlobalReturnInt__carbon_thunk.decl(%.loc9_47.2, %.loc9_50.2)
  698. // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
  699. // CHECK:STDOUT: %.loc9_51.1: %i32 = value_of_initializer %GlobalReturnInt__carbon_thunk.call
  700. // CHECK:STDOUT: %.loc9_51.2: %i32 = converted %GlobalReturnInt__carbon_thunk.call, %.loc9_51.1
  701. // CHECK:STDOUT: %value: %i32 = value_binding value, %.loc9_51.2
  702. // CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  703. // CHECK:STDOUT: %GlobalNoReturn.ref.loc10: %GlobalNoReturn.cpp_overload_set.type = name_ref GlobalNoReturn, imports.%GlobalNoReturn.cpp_overload_set.value [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
  704. // CHECK:STDOUT: %int_1.loc10: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  705. // CHECK:STDOUT: %int_2.loc10: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  706. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
  707. // CHECK:STDOUT: %impl.elem0.loc10_22: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  708. // CHECK:STDOUT: %bound_method.loc10_22.1: <bound method> = bound_method %int_1.loc10, %impl.elem0.loc10_22 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215]
  709. // CHECK:STDOUT: %specific_fn.loc10_22: <specific function> = specific_function %impl.elem0.loc10_22, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  710. // CHECK:STDOUT: %bound_method.loc10_22.2: <bound method> = bound_method %int_1.loc10, %specific_fn.loc10_22 [concrete = constants.%bound_method.38b]
  711. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_22: init %i32 = call %bound_method.loc10_22.2(%int_1.loc10) [concrete = constants.%int_1.5d2]
  712. // CHECK:STDOUT: %.loc10_22.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_22 [concrete = constants.%int_1.5d2]
  713. // CHECK:STDOUT: %.loc10_22.2: %i32 = converted %int_1.loc10, %.loc10_22.1 [concrete = constants.%int_1.5d2]
  714. // CHECK:STDOUT: %impl.elem0.loc10_25: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  715. // CHECK:STDOUT: %bound_method.loc10_25.1: <bound method> = bound_method %int_2.loc10, %impl.elem0.loc10_25 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5]
  716. // CHECK:STDOUT: %specific_fn.loc10_25: <specific function> = specific_function %impl.elem0.loc10_25, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  717. // CHECK:STDOUT: %bound_method.loc10_25.2: <bound method> = bound_method %int_2.loc10, %specific_fn.loc10_25 [concrete = constants.%bound_method.646]
  718. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_25: init %i32 = call %bound_method.loc10_25.2(%int_2.loc10) [concrete = constants.%int_2.ef8]
  719. // CHECK:STDOUT: %.loc10_25.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_25 [concrete = constants.%int_2.ef8]
  720. // CHECK:STDOUT: %.loc10_25.2: %i32 = converted %int_2.loc10, %.loc10_25.1 [concrete = constants.%int_2.ef8]
  721. // CHECK:STDOUT: %impl.elem0.loc10_28: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  722. // CHECK:STDOUT: %bound_method.loc10_28.1: <bound method> = bound_method %int_3, %impl.elem0.loc10_28 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061]
  723. // CHECK:STDOUT: %specific_fn.loc10_28: <specific function> = specific_function %impl.elem0.loc10_28, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  724. // CHECK:STDOUT: %bound_method.loc10_28.2: <bound method> = bound_method %int_3, %specific_fn.loc10_28 [concrete = constants.%bound_method.fa7]
  725. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_28: init %i32 = call %bound_method.loc10_28.2(%int_3) [concrete = constants.%int_3.822]
  726. // CHECK:STDOUT: %.loc10_28.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_28 [concrete = constants.%int_3.822]
  727. // CHECK:STDOUT: %.loc10_28.2: %i32 = converted %int_3, %.loc10_28.1 [concrete = constants.%int_3.822]
  728. // CHECK:STDOUT: %GlobalNoReturn__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%GlobalNoReturn__carbon_thunk.decl.305fd1.2(%.loc10_22.2, %.loc10_25.2, %.loc10_28.2)
  729. // CHECK:STDOUT: %.loc11_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  730. // CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  731. // CHECK:STDOUT: %X.ref.loc11: type = name_ref X, imports.%X.decl [concrete = constants.%X]
  732. // CHECK:STDOUT: %.loc11_5.2: ref %X = temporary_storage
  733. // CHECK:STDOUT: %.loc11_5.3: init %X to %.loc11_5.2 = class_init () [concrete = constants.%X.val]
  734. // CHECK:STDOUT: %.loc11_7.1: init %X = converted %.loc11_5.1, %.loc11_5.3 [concrete = constants.%X.val]
  735. // CHECK:STDOUT: %.loc11_7.2: ref %X = temporary %.loc11_5.2, %.loc11_7.1 [concrete = constants.%.3af]
  736. // CHECK:STDOUT: %B.ref: %X.B.cpp_overload_set.type = name_ref B, imports.%X.B.cpp_overload_set.value [concrete = constants.%X.B.cpp_overload_set.value]
  737. // CHECK:STDOUT: %bound_method.loc11_16: <bound method> = bound_method %.loc11_7.2, %B.ref [concrete = constants.%bound_method.a5d]
  738. // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  739. // CHECK:STDOUT: %impl.elem0.loc11: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  740. // CHECK:STDOUT: %bound_method.loc11_19.1: <bound method> = bound_method %int_1.loc11, %impl.elem0.loc11 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215]
  741. // CHECK:STDOUT: %specific_fn.loc11: <specific function> = specific_function %impl.elem0.loc11, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  742. // CHECK:STDOUT: %bound_method.loc11_19.2: <bound method> = bound_method %int_1.loc11, %specific_fn.loc11 [concrete = constants.%bound_method.38b]
  743. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc11: init %i32 = call %bound_method.loc11_19.2(%int_1.loc11) [concrete = constants.%int_1.5d2]
  744. // CHECK:STDOUT: %.loc11_19.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc11 [concrete = constants.%int_1.5d2]
  745. // CHECK:STDOUT: %.loc11_19.2: %i32 = converted %int_1.loc11, %.loc11_19.1 [concrete = constants.%int_1.5d2]
  746. // CHECK:STDOUT: %B__carbon_thunk.call: init %empty_tuple.type = call imports.%B__carbon_thunk.decl(%.loc11_7.2, %.loc11_19.2)
  747. // CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  748. // CHECK:STDOUT: %X.ref.loc12: type = name_ref X, imports.%X.decl [concrete = constants.%X]
  749. // CHECK:STDOUT: %C.ref: %X.C.cpp_overload_set.type = name_ref C, imports.%X.C.cpp_overload_set.value [concrete = constants.%X.C.cpp_overload_set.value]
  750. // CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  751. // CHECK:STDOUT: %impl.elem0.loc12: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  752. // CHECK:STDOUT: %bound_method.loc12_11.1: <bound method> = bound_method %int_1.loc12, %impl.elem0.loc12 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215]
  753. // CHECK:STDOUT: %specific_fn.loc12: <specific function> = specific_function %impl.elem0.loc12, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  754. // CHECK:STDOUT: %bound_method.loc12_11.2: <bound method> = bound_method %int_1.loc12, %specific_fn.loc12 [concrete = constants.%bound_method.38b]
  755. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc12: init %i32 = call %bound_method.loc12_11.2(%int_1.loc12) [concrete = constants.%int_1.5d2]
  756. // CHECK:STDOUT: %.loc12_11.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc12 [concrete = constants.%int_1.5d2]
  757. // CHECK:STDOUT: %.loc12_11.2: %i32 = converted %int_1.loc12, %.loc12_11.1 [concrete = constants.%int_1.5d2]
  758. // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc12_11.2)
  759. // CHECK:STDOUT: %.loc13_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  760. // CHECK:STDOUT: %Cpp.ref.loc13: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  761. // CHECK:STDOUT: %X.ref.loc13: type = name_ref X, imports.%X.decl [concrete = constants.%X]
  762. // CHECK:STDOUT: %.loc13_5.2: ref %X = temporary_storage
  763. // CHECK:STDOUT: %.loc13_5.3: init %X to %.loc13_5.2 = class_init () [concrete = constants.%X.val]
  764. // CHECK:STDOUT: %.loc13_7.1: init %X = converted %.loc13_5.1, %.loc13_5.3 [concrete = constants.%X.val]
  765. // CHECK:STDOUT: %.loc13_7.2: ref %X = temporary %.loc13_5.2, %.loc13_7.1 [concrete = constants.%.3af]
  766. // CHECK:STDOUT: %D.ref: %X.D.cpp_overload_set.type = name_ref D, imports.%X.D.cpp_overload_set.value [concrete = constants.%X.D.cpp_overload_set.value]
  767. // CHECK:STDOUT: %bound_method.loc13_16: <bound method> = bound_method %.loc13_7.2, %D.ref [concrete = constants.%bound_method.d5c]
  768. // CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  769. // CHECK:STDOUT: %.loc13_7.3: %X = acquire_value %.loc13_7.2
  770. // CHECK:STDOUT: %impl.elem0.loc13: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  771. // CHECK:STDOUT: %bound_method.loc13_19.1: <bound method> = bound_method %int_1.loc13, %impl.elem0.loc13 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215]
  772. // CHECK:STDOUT: %specific_fn.loc13: <specific function> = specific_function %impl.elem0.loc13, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  773. // CHECK:STDOUT: %bound_method.loc13_19.2: <bound method> = bound_method %int_1.loc13, %specific_fn.loc13 [concrete = constants.%bound_method.38b]
  774. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13: init %i32 = call %bound_method.loc13_19.2(%int_1.loc13) [concrete = constants.%int_1.5d2]
  775. // CHECK:STDOUT: %.loc13_19.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13 [concrete = constants.%int_1.5d2]
  776. // CHECK:STDOUT: %.loc13_19.2: %i32 = converted %int_1.loc13, %.loc13_19.1 [concrete = constants.%int_1.5d2]
  777. // CHECK:STDOUT: %.loc13_7.4: ref %X = value_as_ref %.loc13_7.3
  778. // CHECK:STDOUT: %addr: %ptr.1f9 = addr_of %.loc13_7.4
  779. // CHECK:STDOUT: %D__carbon_thunk.call: init %empty_tuple.type = call imports.%D__carbon_thunk.decl(%addr, %.loc13_19.2)
  780. // CHECK:STDOUT: %X.Op.decl: %X.Op.type = fn_decl @X.Op [concrete = constants.%X.Op] {
  781. // CHECK:STDOUT: %self.param_patt: %pattern_type.46b = ref_param_pattern [concrete]
  782. // CHECK:STDOUT: %self.patt: %pattern_type.46b = at_binding_pattern self, %self.param_patt [concrete]
  783. // CHECK:STDOUT: } {
  784. // CHECK:STDOUT: %self.param: ref %X = ref_param call_param0
  785. // CHECK:STDOUT: %self: ref %X = ref_binding self, %self.param
  786. // CHECK:STDOUT: }
  787. // CHECK:STDOUT: %Op.ref.loc13: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor]
  788. // CHECK:STDOUT: %Op.ref.loc11: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor]
  789. // CHECK:STDOUT: return
  790. // CHECK:STDOUT: }
  791. // CHECK:STDOUT:
  792. // CHECK:STDOUT: fn @GlobalNoReturn.1(%a.param: %i32, %b.param: %i32);
  793. // CHECK:STDOUT:
  794. // CHECK:STDOUT: fn @GlobalNoReturn__carbon_thunk.1(%a.param: %i32, %b.param: %i32);
  795. // CHECK:STDOUT:
  796. // CHECK:STDOUT: fn @GlobalReturnInt(%a.param: %i32, %b.param: %i32) -> out %return.param: %i32;
  797. // CHECK:STDOUT:
  798. // CHECK:STDOUT: fn @GlobalReturnInt__carbon_thunk(%a.param: %i32, %b.param: %i32) -> out %return.param: %i32;
  799. // CHECK:STDOUT:
  800. // CHECK:STDOUT: fn @GlobalNoReturn.2(%a.param: %i32, %b.param: %i32, %c.param: %i32);
  801. // CHECK:STDOUT:
  802. // CHECK:STDOUT: fn @GlobalNoReturn__carbon_thunk.2(%a.param: %i32, %b.param: %i32, %c.param: %i32);
  803. // CHECK:STDOUT:
  804. // CHECK:STDOUT: fn @X.B(%self.param: ref %X, %a.param: %i32);
  805. // CHECK:STDOUT:
  806. // CHECK:STDOUT: fn @B__carbon_thunk(%this.param: ref %X, %a.param: %i32);
  807. // CHECK:STDOUT:
  808. // CHECK:STDOUT: fn @X.C(%a.param: %i32);
  809. // CHECK:STDOUT:
  810. // CHECK:STDOUT: fn @C__carbon_thunk(%a.param: %i32);
  811. // CHECK:STDOUT:
  812. // CHECK:STDOUT: fn @X.D(%self.param: %X, %a.param: %i32);
  813. // CHECK:STDOUT:
  814. // CHECK:STDOUT: fn @D__carbon_thunk(%_.param: %ptr.1f9, %a.param: %i32);
  815. // CHECK:STDOUT:
  816. // CHECK:STDOUT: fn @X.cpp_destructor(%self.param: ref %X) = "no_op";
  817. // CHECK:STDOUT:
  818. // CHECK:STDOUT: fn @X.Op(%self.param: ref %X) [thunk imports.%X.cpp_destructor.decl] {
  819. // CHECK:STDOUT: !entry:
  820. // CHECK:STDOUT: %Op.ref: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor]
  821. // CHECK:STDOUT: %X.cpp_destructor.bound: <bound method> = bound_method %self.param, %Op.ref
  822. // CHECK:STDOUT: %X.cpp_destructor.call: init %empty_tuple.type = call %X.cpp_destructor.bound(%self.param)
  823. // CHECK:STDOUT: return
  824. // CHECK:STDOUT: }
  825. // CHECK:STDOUT:
  826. // CHECK:STDOUT: --- fail_call_too_few_args.carbon
  827. // CHECK:STDOUT:
  828. // CHECK:STDOUT: constants {
  829. // CHECK:STDOUT: %GlobalNoReturn.cpp_overload_set.type: type = cpp_overload_set_type @GlobalNoReturn.cpp_overload_set [concrete]
  830. // CHECK:STDOUT: %GlobalNoReturn.cpp_overload_set.value: %GlobalNoReturn.cpp_overload_set.type = cpp_overload_set_value @GlobalNoReturn.cpp_overload_set [concrete]
  831. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  832. // CHECK:STDOUT: %GlobalReturnInt.cpp_overload_set.type: type = cpp_overload_set_type @GlobalReturnInt.cpp_overload_set [concrete]
  833. // CHECK:STDOUT: %GlobalReturnInt.cpp_overload_set.value: %GlobalReturnInt.cpp_overload_set.type = cpp_overload_set_value @GlobalReturnInt.cpp_overload_set [concrete]
  834. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  835. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  836. // CHECK:STDOUT: %X: type = class_type @X [concrete]
  837. // CHECK:STDOUT: %X.val: %X = struct_value () [concrete]
  838. // CHECK:STDOUT: %.3af: ref %X = temporary invalid, %X.val [concrete]
  839. // CHECK:STDOUT: %X.B.cpp_overload_set.type: type = cpp_overload_set_type @X.B.cpp_overload_set [concrete]
  840. // CHECK:STDOUT: %X.B.cpp_overload_set.value: %X.B.cpp_overload_set.type = cpp_overload_set_value @X.B.cpp_overload_set [concrete]
  841. // CHECK:STDOUT: %bound_method.a5d: <bound method> = bound_method %.3af, %X.B.cpp_overload_set.value [concrete]
  842. // CHECK:STDOUT: %X.C.cpp_overload_set.type: type = cpp_overload_set_type @X.C.cpp_overload_set [concrete]
  843. // CHECK:STDOUT: %X.C.cpp_overload_set.value: %X.C.cpp_overload_set.type = cpp_overload_set_value @X.C.cpp_overload_set [concrete]
  844. // CHECK:STDOUT: %X.D.cpp_overload_set.type: type = cpp_overload_set_type @X.D.cpp_overload_set [concrete]
  845. // CHECK:STDOUT: %X.D.cpp_overload_set.value: %X.D.cpp_overload_set.type = cpp_overload_set_value @X.D.cpp_overload_set [concrete]
  846. // CHECK:STDOUT: %bound_method.d5c: <bound method> = bound_method %.3af, %X.D.cpp_overload_set.value [concrete]
  847. // CHECK:STDOUT: %pattern_type.46b: type = pattern_type %X [concrete]
  848. // CHECK:STDOUT: %X.cpp_destructor.type: type = fn_type @X.cpp_destructor [concrete]
  849. // CHECK:STDOUT: %X.cpp_destructor: %X.cpp_destructor.type = struct_value () [concrete]
  850. // CHECK:STDOUT: }
  851. // CHECK:STDOUT:
  852. // CHECK:STDOUT: imports {
  853. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  854. // CHECK:STDOUT: .GlobalNoReturn = %GlobalNoReturn.cpp_overload_set.value
  855. // CHECK:STDOUT: .GlobalReturnInt = %GlobalReturnInt.cpp_overload_set.value
  856. // CHECK:STDOUT: .X = %X.decl
  857. // CHECK:STDOUT: import Cpp//...
  858. // CHECK:STDOUT: }
  859. // CHECK:STDOUT: %GlobalNoReturn.cpp_overload_set.value: %GlobalNoReturn.cpp_overload_set.type = cpp_overload_set_value @GlobalNoReturn.cpp_overload_set [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
  860. // CHECK:STDOUT: %GlobalReturnInt.cpp_overload_set.value: %GlobalReturnInt.cpp_overload_set.type = cpp_overload_set_value @GlobalReturnInt.cpp_overload_set [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
  861. // CHECK:STDOUT: %X.decl: type = class_decl @X [concrete = constants.%X] {} {}
  862. // CHECK:STDOUT: %X.B.cpp_overload_set.value: %X.B.cpp_overload_set.type = cpp_overload_set_value @X.B.cpp_overload_set [concrete = constants.%X.B.cpp_overload_set.value]
  863. // CHECK:STDOUT: %X.C.cpp_overload_set.value: %X.C.cpp_overload_set.type = cpp_overload_set_value @X.C.cpp_overload_set [concrete = constants.%X.C.cpp_overload_set.value]
  864. // CHECK:STDOUT: %X.D.cpp_overload_set.value: %X.D.cpp_overload_set.type = cpp_overload_set_value @X.D.cpp_overload_set [concrete = constants.%X.D.cpp_overload_set.value]
  865. // CHECK:STDOUT: %X.cpp_destructor.decl: %X.cpp_destructor.type = fn_decl @X.cpp_destructor [concrete = constants.%X.cpp_destructor] {
  866. // CHECK:STDOUT: %self.param_patt: %pattern_type.46b = ref_param_pattern [concrete]
  867. // CHECK:STDOUT: %self.patt: %pattern_type.46b = at_binding_pattern self, %self.param_patt [concrete]
  868. // CHECK:STDOUT: } {
  869. // CHECK:STDOUT: %self.param: ref %X = ref_param call_param0
  870. // CHECK:STDOUT: %self: ref %X = ref_binding self, %self.param
  871. // CHECK:STDOUT: }
  872. // CHECK:STDOUT: }
  873. // CHECK:STDOUT:
  874. // CHECK:STDOUT: fn @Call() {
  875. // CHECK:STDOUT: !entry:
  876. // CHECK:STDOUT: %Cpp.ref.loc16: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  877. // CHECK:STDOUT: %GlobalNoReturn.ref.loc16: %GlobalNoReturn.cpp_overload_set.type = name_ref GlobalNoReturn, imports.%GlobalNoReturn.cpp_overload_set.value [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
  878. // CHECK:STDOUT: %int_1.loc16: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  879. // CHECK:STDOUT: %Cpp.ref.loc26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  880. // CHECK:STDOUT: %GlobalNoReturn.ref.loc26: %GlobalNoReturn.cpp_overload_set.type = name_ref GlobalNoReturn, imports.%GlobalNoReturn.cpp_overload_set.value [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
  881. // CHECK:STDOUT: %Cpp.ref.loc36: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  882. // CHECK:STDOUT: %GlobalReturnInt.ref.loc36: %GlobalReturnInt.cpp_overload_set.type = name_ref GlobalReturnInt, imports.%GlobalReturnInt.cpp_overload_set.value [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
  883. // CHECK:STDOUT: %int_1.loc36: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  884. // CHECK:STDOUT: %Cpp.ref.loc46: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  885. // CHECK:STDOUT: %GlobalReturnInt.ref.loc46: %GlobalReturnInt.cpp_overload_set.type = name_ref GlobalReturnInt, imports.%GlobalReturnInt.cpp_overload_set.value [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
  886. // CHECK:STDOUT: %.loc56_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  887. // CHECK:STDOUT: %Cpp.ref.loc56: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  888. // CHECK:STDOUT: %X.ref.loc56: type = name_ref X, imports.%X.decl [concrete = constants.%X]
  889. // CHECK:STDOUT: %.loc56_5.2: ref %X = temporary_storage
  890. // CHECK:STDOUT: %.loc56_5.3: init %X to %.loc56_5.2 = class_init () [concrete = constants.%X.val]
  891. // CHECK:STDOUT: %.loc56_7.1: init %X = converted %.loc56_5.1, %.loc56_5.3 [concrete = constants.%X.val]
  892. // CHECK:STDOUT: %.loc56_7.2: ref %X = temporary %.loc56_5.2, %.loc56_7.1 [concrete = constants.%.3af]
  893. // CHECK:STDOUT: %B.ref: %X.B.cpp_overload_set.type = name_ref B, imports.%X.B.cpp_overload_set.value [concrete = constants.%X.B.cpp_overload_set.value]
  894. // CHECK:STDOUT: %bound_method.loc56: <bound method> = bound_method %.loc56_7.2, %B.ref [concrete = constants.%bound_method.a5d]
  895. // CHECK:STDOUT: %Cpp.ref.loc66: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  896. // CHECK:STDOUT: %X.ref.loc66: type = name_ref X, imports.%X.decl [concrete = constants.%X]
  897. // CHECK:STDOUT: %C.ref: %X.C.cpp_overload_set.type = name_ref C, imports.%X.C.cpp_overload_set.value [concrete = constants.%X.C.cpp_overload_set.value]
  898. // CHECK:STDOUT: %.loc76_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  899. // CHECK:STDOUT: %Cpp.ref.loc76: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  900. // CHECK:STDOUT: %X.ref.loc76: type = name_ref X, imports.%X.decl [concrete = constants.%X]
  901. // CHECK:STDOUT: %.loc76_5.2: ref %X = temporary_storage
  902. // CHECK:STDOUT: %.loc76_5.3: init %X to %.loc76_5.2 = class_init () [concrete = constants.%X.val]
  903. // CHECK:STDOUT: %.loc76_7.1: init %X = converted %.loc76_5.1, %.loc76_5.3 [concrete = constants.%X.val]
  904. // CHECK:STDOUT: %.loc76_7.2: ref %X = temporary %.loc76_5.2, %.loc76_7.1 [concrete = constants.%.3af]
  905. // CHECK:STDOUT: %D.ref: %X.D.cpp_overload_set.type = name_ref D, imports.%X.D.cpp_overload_set.value [concrete = constants.%X.D.cpp_overload_set.value]
  906. // CHECK:STDOUT: %bound_method.loc76: <bound method> = bound_method %.loc76_7.2, %D.ref [concrete = constants.%bound_method.d5c]
  907. // CHECK:STDOUT: <elided>
  908. // CHECK:STDOUT: %Op.ref.loc76: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor]
  909. // CHECK:STDOUT: %Op.ref.loc56: %X.cpp_destructor.type = name_ref Op, imports.%X.cpp_destructor.decl [concrete = constants.%X.cpp_destructor]
  910. // CHECK:STDOUT: <elided>
  911. // CHECK:STDOUT: }
  912. // CHECK:STDOUT: