call.carbon 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897
  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. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/generic/call.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/generic/call.carbon
  10. // --- call.carbon
  11. library "[[@TEST_NAME]]";
  12. class Class(T:! type, N:! i32) {}
  13. var a: Class(i32*, 5);
  14. // Requires an implicit conversion to type `type`.
  15. var b: Class((), 0);
  16. // --- fail_too_few.carbon
  17. library "[[@TEST_NAME]]";
  18. class Class(T:! type, N:! i32) {}
  19. // CHECK:STDERR: fail_too_few.carbon:[[@LINE+7]]:8: error: 1 argument(s) passed to generic class expecting 2 argument(s).
  20. // CHECK:STDERR: var a: Class(i32*);
  21. // CHECK:STDERR: ^~~~~~
  22. // CHECK:STDERR: fail_too_few.carbon:[[@LINE-5]]:1: note: calling generic class declared here
  23. // CHECK:STDERR: class Class(T:! type, N:! i32) {}
  24. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  25. // CHECK:STDERR:
  26. var a: Class(i32*);
  27. // --- fail_too_many.carbon
  28. library "[[@TEST_NAME]]";
  29. class Class(T:! type, N:! i32) {}
  30. // CHECK:STDERR: fail_too_many.carbon:[[@LINE+7]]:8: error: 3 argument(s) passed to generic class expecting 2 argument(s).
  31. // CHECK:STDERR: var a: Class(i32*, 1, 2);
  32. // CHECK:STDERR: ^~~~~~
  33. // CHECK:STDERR: fail_too_many.carbon:[[@LINE-5]]:1: note: calling generic class declared here
  34. // CHECK:STDERR: class Class(T:! type, N:! i32) {}
  35. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  36. // CHECK:STDERR:
  37. var a: Class(i32*, 1, 2);
  38. // --- fail_no_conversion.carbon
  39. library "[[@TEST_NAME]]";
  40. class Class(T:! type, N:! i32) {}
  41. // CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:8: error: cannot implicitly convert from `i32` to `type`
  42. // CHECK:STDERR: var a: Class(5, i32*);
  43. // CHECK:STDERR: ^~~~~~
  44. // CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+3]]:8: note: type `i32` does not implement interface `ImplicitAs`
  45. // CHECK:STDERR: var a: Class(5, i32*);
  46. // CHECK:STDERR: ^~~~~~
  47. var a: Class(5, i32*);
  48. // --- call_in_nested_return_type.carbon
  49. class Outer(T:! type) {
  50. class Inner(U:! type) {
  51. fn A() -> Outer(T) {
  52. return {};
  53. }
  54. fn B() -> Outer(U) {
  55. return {};
  56. }
  57. fn C() -> Inner(T) {
  58. return {};
  59. }
  60. fn D() -> Inner(U) {
  61. return {};
  62. }
  63. }
  64. }
  65. // CHECK:STDOUT: --- call.carbon
  66. // CHECK:STDOUT:
  67. // CHECK:STDOUT: constants {
  68. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  69. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  70. // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
  71. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  72. // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
  73. // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 1 [symbolic]
  74. // CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 1 [symbolic]
  75. // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template]
  76. // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template]
  77. // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T, %N) [symbolic]
  78. // CHECK:STDOUT: %.2: type = struct_type {} [template]
  79. // CHECK:STDOUT: %.3: <witness> = complete_type_witness %.2 [template]
  80. // CHECK:STDOUT: %.4: type = ptr_type i32 [template]
  81. // CHECK:STDOUT: %.5: i32 = int_literal 5 [template]
  82. // CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(%.4, %.5) [template]
  83. // CHECK:STDOUT: %.6: type = ptr_type %.2 [template]
  84. // CHECK:STDOUT: %.7: i32 = int_literal 0 [template]
  85. // CHECK:STDOUT: %Class.4: type = class_type @Class, @Class(%.1, %.7) [template]
  86. // CHECK:STDOUT: }
  87. // CHECK:STDOUT:
  88. // CHECK:STDOUT: imports {
  89. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  90. // CHECK:STDOUT: .Int32 = %import_ref
  91. // CHECK:STDOUT: import Core//prelude
  92. // CHECK:STDOUT: import Core//prelude/operators
  93. // CHECK:STDOUT: import Core//prelude/types
  94. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  95. // CHECK:STDOUT: import Core//prelude/operators/as
  96. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  97. // CHECK:STDOUT: import Core//prelude/operators/comparison
  98. // CHECK:STDOUT: import Core//prelude/types/bool
  99. // CHECK:STDOUT: }
  100. // CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+9, loaded [template = constants.%Int32]
  101. // CHECK:STDOUT: }
  102. // CHECK:STDOUT:
  103. // CHECK:STDOUT: file {
  104. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  105. // CHECK:STDOUT: .Core = imports.%Core
  106. // CHECK:STDOUT: .Class = %Class.decl
  107. // CHECK:STDOUT: .a = %a
  108. // CHECK:STDOUT: .b = %b
  109. // CHECK:STDOUT: }
  110. // CHECK:STDOUT: %Core.import = import Core
  111. // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] {
  112. // CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  113. // CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_13.1, runtime_param<invalid> [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  114. // CHECK:STDOUT: %N.patt.loc4_23.1: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)]
  115. // CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc4_23.1, runtime_param<invalid> [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)]
  116. // CHECK:STDOUT: } {
  117. // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  118. // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32 [template = i32]
  119. // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32, %.loc4_27.1 [template = i32]
  120. // CHECK:STDOUT: %param.loc4_13: type = param runtime_param<invalid>
  121. // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %param.loc4_13 [symbolic = %T.loc4_13.2 (constants.%T)]
  122. // CHECK:STDOUT: %param.loc4_23: i32 = param runtime_param<invalid>
  123. // CHECK:STDOUT: %N.loc4_23.1: i32 = bind_symbolic_name N, 1, %param.loc4_23 [symbolic = %N.loc4_23.2 (constants.%N)]
  124. // CHECK:STDOUT: }
  125. // CHECK:STDOUT: %Class.ref.loc6: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1]
  126. // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  127. // CHECK:STDOUT: %.loc6_17.1: type = value_of_initializer %int.make_type_32 [template = i32]
  128. // CHECK:STDOUT: %.loc6_17.2: type = converted %int.make_type_32, %.loc6_17.1 [template = i32]
  129. // CHECK:STDOUT: %.loc6_17.3: type = ptr_type i32 [template = constants.%.4]
  130. // CHECK:STDOUT: %.loc6_20: i32 = int_literal 5 [template = constants.%.5]
  131. // CHECK:STDOUT: %Class.loc6: type = class_type @Class, @Class(constants.%.4, constants.%.5) [template = constants.%Class.3]
  132. // CHECK:STDOUT: %a.var: ref %Class.3 = var a
  133. // CHECK:STDOUT: %a: ref %Class.3 = bind_name a, %a.var
  134. // CHECK:STDOUT: %Class.ref.loc9: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1]
  135. // CHECK:STDOUT: %.loc9_15: %.1 = tuple_literal ()
  136. // CHECK:STDOUT: %.loc9_18: i32 = int_literal 0 [template = constants.%.7]
  137. // CHECK:STDOUT: %.loc9_13: type = converted %.loc9_15, constants.%.1 [template = constants.%.1]
  138. // CHECK:STDOUT: %Class.loc9: type = class_type @Class, @Class(constants.%.1, constants.%.7) [template = constants.%Class.4]
  139. // CHECK:STDOUT: %b.var: ref %Class.4 = var b
  140. // CHECK:STDOUT: %b: ref %Class.4 = bind_name b, %b.var
  141. // CHECK:STDOUT: }
  142. // CHECK:STDOUT:
  143. // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: i32) {
  144. // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)]
  145. // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  146. // CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N)]
  147. // CHECK:STDOUT: %N.patt.loc4_23.2: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)]
  148. // CHECK:STDOUT:
  149. // CHECK:STDOUT: !definition:
  150. // CHECK:STDOUT:
  151. // CHECK:STDOUT: class {
  152. // CHECK:STDOUT: %.loc4_33: <witness> = complete_type_witness %.2 [template = constants.%.3]
  153. // CHECK:STDOUT:
  154. // CHECK:STDOUT: !members:
  155. // CHECK:STDOUT: .Self = constants.%Class.2
  156. // CHECK:STDOUT: }
  157. // CHECK:STDOUT: }
  158. // CHECK:STDOUT:
  159. // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
  160. // CHECK:STDOUT:
  161. // CHECK:STDOUT: specific @Class(constants.%T, constants.%N) {
  162. // CHECK:STDOUT: %T.loc4_13.2 => constants.%T
  163. // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T
  164. // CHECK:STDOUT: %N.loc4_23.2 => constants.%N
  165. // CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N
  166. // CHECK:STDOUT: }
  167. // CHECK:STDOUT:
  168. // CHECK:STDOUT: specific @Class(constants.%.4, constants.%.5) {
  169. // CHECK:STDOUT: %T.loc4_13.2 => constants.%.4
  170. // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%.4
  171. // CHECK:STDOUT: %N.loc4_23.2 => constants.%.5
  172. // CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%.5
  173. // CHECK:STDOUT:
  174. // CHECK:STDOUT: !definition:
  175. // CHECK:STDOUT: }
  176. // CHECK:STDOUT:
  177. // CHECK:STDOUT: specific @Class(constants.%.1, constants.%.7) {
  178. // CHECK:STDOUT: %T.loc4_13.2 => constants.%.1
  179. // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%.1
  180. // CHECK:STDOUT: %N.loc4_23.2 => constants.%.7
  181. // CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%.7
  182. // CHECK:STDOUT:
  183. // CHECK:STDOUT: !definition:
  184. // CHECK:STDOUT: }
  185. // CHECK:STDOUT:
  186. // CHECK:STDOUT: --- fail_too_few.carbon
  187. // CHECK:STDOUT:
  188. // CHECK:STDOUT: constants {
  189. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  190. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  191. // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
  192. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  193. // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
  194. // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 1 [symbolic]
  195. // CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 1 [symbolic]
  196. // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template]
  197. // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template]
  198. // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T, %N) [symbolic]
  199. // CHECK:STDOUT: %.2: type = struct_type {} [template]
  200. // CHECK:STDOUT: %.3: <witness> = complete_type_witness %.2 [template]
  201. // CHECK:STDOUT: %.4: type = ptr_type i32 [template]
  202. // CHECK:STDOUT: }
  203. // CHECK:STDOUT:
  204. // CHECK:STDOUT: imports {
  205. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  206. // CHECK:STDOUT: .Int32 = %import_ref
  207. // CHECK:STDOUT: import Core//prelude
  208. // CHECK:STDOUT: import Core//prelude/operators
  209. // CHECK:STDOUT: import Core//prelude/types
  210. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  211. // CHECK:STDOUT: import Core//prelude/operators/as
  212. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  213. // CHECK:STDOUT: import Core//prelude/operators/comparison
  214. // CHECK:STDOUT: import Core//prelude/types/bool
  215. // CHECK:STDOUT: }
  216. // CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+9, loaded [template = constants.%Int32]
  217. // CHECK:STDOUT: }
  218. // CHECK:STDOUT:
  219. // CHECK:STDOUT: file {
  220. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  221. // CHECK:STDOUT: .Core = imports.%Core
  222. // CHECK:STDOUT: .Class = %Class.decl
  223. // CHECK:STDOUT: .a = %a
  224. // CHECK:STDOUT: }
  225. // CHECK:STDOUT: %Core.import = import Core
  226. // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] {
  227. // CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  228. // CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_13.1, runtime_param<invalid> [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  229. // CHECK:STDOUT: %N.patt.loc4_23.1: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)]
  230. // CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc4_23.1, runtime_param<invalid> [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)]
  231. // CHECK:STDOUT: } {
  232. // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  233. // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32 [template = i32]
  234. // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32, %.loc4_27.1 [template = i32]
  235. // CHECK:STDOUT: %param.loc4_13: type = param runtime_param<invalid>
  236. // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %param.loc4_13 [symbolic = %T.loc4_13.2 (constants.%T)]
  237. // CHECK:STDOUT: %param.loc4_23: i32 = param runtime_param<invalid>
  238. // CHECK:STDOUT: %N.loc4_23.1: i32 = bind_symbolic_name N, 1, %param.loc4_23 [symbolic = %N.loc4_23.2 (constants.%N)]
  239. // CHECK:STDOUT: }
  240. // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1]
  241. // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  242. // CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_32 [template = i32]
  243. // CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_32, %.loc13_17.1 [template = i32]
  244. // CHECK:STDOUT: %.loc13_17.3: type = ptr_type i32 [template = constants.%.4]
  245. // CHECK:STDOUT: %a.var: ref <error> = var a
  246. // CHECK:STDOUT: %a: ref <error> = bind_name a, %a.var
  247. // CHECK:STDOUT: }
  248. // CHECK:STDOUT:
  249. // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: i32) {
  250. // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)]
  251. // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  252. // CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N)]
  253. // CHECK:STDOUT: %N.patt.loc4_23.2: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)]
  254. // CHECK:STDOUT:
  255. // CHECK:STDOUT: !definition:
  256. // CHECK:STDOUT:
  257. // CHECK:STDOUT: class {
  258. // CHECK:STDOUT: %.loc4_33: <witness> = complete_type_witness %.2 [template = constants.%.3]
  259. // CHECK:STDOUT:
  260. // CHECK:STDOUT: !members:
  261. // CHECK:STDOUT: .Self = constants.%Class.2
  262. // CHECK:STDOUT: }
  263. // CHECK:STDOUT: }
  264. // CHECK:STDOUT:
  265. // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
  266. // CHECK:STDOUT:
  267. // CHECK:STDOUT: specific @Class(constants.%T, constants.%N) {
  268. // CHECK:STDOUT: %T.loc4_13.2 => constants.%T
  269. // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T
  270. // CHECK:STDOUT: %N.loc4_23.2 => constants.%N
  271. // CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N
  272. // CHECK:STDOUT: }
  273. // CHECK:STDOUT:
  274. // CHECK:STDOUT: --- fail_too_many.carbon
  275. // CHECK:STDOUT:
  276. // CHECK:STDOUT: constants {
  277. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  278. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  279. // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
  280. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  281. // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
  282. // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 1 [symbolic]
  283. // CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 1 [symbolic]
  284. // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template]
  285. // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template]
  286. // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T, %N) [symbolic]
  287. // CHECK:STDOUT: %.2: type = struct_type {} [template]
  288. // CHECK:STDOUT: %.3: <witness> = complete_type_witness %.2 [template]
  289. // CHECK:STDOUT: %.4: type = ptr_type i32 [template]
  290. // CHECK:STDOUT: %.5: i32 = int_literal 1 [template]
  291. // CHECK:STDOUT: %.6: i32 = int_literal 2 [template]
  292. // CHECK:STDOUT: }
  293. // CHECK:STDOUT:
  294. // CHECK:STDOUT: imports {
  295. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  296. // CHECK:STDOUT: .Int32 = %import_ref
  297. // CHECK:STDOUT: import Core//prelude
  298. // CHECK:STDOUT: import Core//prelude/operators
  299. // CHECK:STDOUT: import Core//prelude/types
  300. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  301. // CHECK:STDOUT: import Core//prelude/operators/as
  302. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  303. // CHECK:STDOUT: import Core//prelude/operators/comparison
  304. // CHECK:STDOUT: import Core//prelude/types/bool
  305. // CHECK:STDOUT: }
  306. // CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+9, loaded [template = constants.%Int32]
  307. // CHECK:STDOUT: }
  308. // CHECK:STDOUT:
  309. // CHECK:STDOUT: file {
  310. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  311. // CHECK:STDOUT: .Core = imports.%Core
  312. // CHECK:STDOUT: .Class = %Class.decl
  313. // CHECK:STDOUT: .a = %a
  314. // CHECK:STDOUT: }
  315. // CHECK:STDOUT: %Core.import = import Core
  316. // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] {
  317. // CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  318. // CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_13.1, runtime_param<invalid> [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  319. // CHECK:STDOUT: %N.patt.loc4_23.1: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)]
  320. // CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc4_23.1, runtime_param<invalid> [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)]
  321. // CHECK:STDOUT: } {
  322. // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  323. // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32 [template = i32]
  324. // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32, %.loc4_27.1 [template = i32]
  325. // CHECK:STDOUT: %param.loc4_13: type = param runtime_param<invalid>
  326. // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %param.loc4_13 [symbolic = %T.loc4_13.2 (constants.%T)]
  327. // CHECK:STDOUT: %param.loc4_23: i32 = param runtime_param<invalid>
  328. // CHECK:STDOUT: %N.loc4_23.1: i32 = bind_symbolic_name N, 1, %param.loc4_23 [symbolic = %N.loc4_23.2 (constants.%N)]
  329. // CHECK:STDOUT: }
  330. // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1]
  331. // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  332. // CHECK:STDOUT: %.loc13_17.1: type = value_of_initializer %int.make_type_32 [template = i32]
  333. // CHECK:STDOUT: %.loc13_17.2: type = converted %int.make_type_32, %.loc13_17.1 [template = i32]
  334. // CHECK:STDOUT: %.loc13_17.3: type = ptr_type i32 [template = constants.%.4]
  335. // CHECK:STDOUT: %.loc13_20: i32 = int_literal 1 [template = constants.%.5]
  336. // CHECK:STDOUT: %.loc13_23: i32 = int_literal 2 [template = constants.%.6]
  337. // CHECK:STDOUT: %a.var: ref <error> = var a
  338. // CHECK:STDOUT: %a: ref <error> = bind_name a, %a.var
  339. // CHECK:STDOUT: }
  340. // CHECK:STDOUT:
  341. // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: i32) {
  342. // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)]
  343. // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  344. // CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N)]
  345. // CHECK:STDOUT: %N.patt.loc4_23.2: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)]
  346. // CHECK:STDOUT:
  347. // CHECK:STDOUT: !definition:
  348. // CHECK:STDOUT:
  349. // CHECK:STDOUT: class {
  350. // CHECK:STDOUT: %.loc4_33: <witness> = complete_type_witness %.2 [template = constants.%.3]
  351. // CHECK:STDOUT:
  352. // CHECK:STDOUT: !members:
  353. // CHECK:STDOUT: .Self = constants.%Class.2
  354. // CHECK:STDOUT: }
  355. // CHECK:STDOUT: }
  356. // CHECK:STDOUT:
  357. // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
  358. // CHECK:STDOUT:
  359. // CHECK:STDOUT: specific @Class(constants.%T, constants.%N) {
  360. // CHECK:STDOUT: %T.loc4_13.2 => constants.%T
  361. // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T
  362. // CHECK:STDOUT: %N.loc4_23.2 => constants.%N
  363. // CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N
  364. // CHECK:STDOUT: }
  365. // CHECK:STDOUT:
  366. // CHECK:STDOUT: --- fail_no_conversion.carbon
  367. // CHECK:STDOUT:
  368. // CHECK:STDOUT: constants {
  369. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  370. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  371. // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
  372. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  373. // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
  374. // CHECK:STDOUT: %N: i32 = bind_symbolic_name N, 1 [symbolic]
  375. // CHECK:STDOUT: %N.patt: i32 = symbolic_binding_pattern N, 1 [symbolic]
  376. // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template]
  377. // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template]
  378. // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T, %N) [symbolic]
  379. // CHECK:STDOUT: %.2: type = struct_type {} [template]
  380. // CHECK:STDOUT: %.3: <witness> = complete_type_witness %.2 [template]
  381. // CHECK:STDOUT: %.4: i32 = int_literal 5 [template]
  382. // CHECK:STDOUT: %.5: type = ptr_type i32 [template]
  383. // CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template]
  384. // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template]
  385. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
  386. // CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic]
  387. // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic]
  388. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic]
  389. // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic]
  390. // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic]
  391. // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic]
  392. // CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic]
  393. // CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [symbolic]
  394. // CHECK:STDOUT: %ImplicitAs.type.3: type = interface_type @ImplicitAs, @ImplicitAs(type) [template]
  395. // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(type) [template]
  396. // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template]
  397. // CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template]
  398. // CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.6 [template]
  399. // CHECK:STDOUT: %.10: %.6 = assoc_entity element0, imports.%import_ref.7 [symbolic]
  400. // CHECK:STDOUT: }
  401. // CHECK:STDOUT:
  402. // CHECK:STDOUT: imports {
  403. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  404. // CHECK:STDOUT: .Int32 = %import_ref.1
  405. // CHECK:STDOUT: .ImplicitAs = %import_ref.2
  406. // CHECK:STDOUT: import Core//prelude
  407. // CHECK:STDOUT: import Core//prelude/operators
  408. // CHECK:STDOUT: import Core//prelude/types
  409. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  410. // CHECK:STDOUT: import Core//prelude/operators/as
  411. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  412. // CHECK:STDOUT: import Core//prelude/operators/comparison
  413. // CHECK:STDOUT: import Core//prelude/types/bool
  414. // CHECK:STDOUT: }
  415. // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+9, loaded [template = constants.%Int32]
  416. // CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs]
  417. // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded
  418. // CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.6) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.10)]
  419. // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded
  420. // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded
  421. // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded
  422. // CHECK:STDOUT: }
  423. // CHECK:STDOUT:
  424. // CHECK:STDOUT: file {
  425. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  426. // CHECK:STDOUT: .Core = imports.%Core
  427. // CHECK:STDOUT: .Class = %Class.decl
  428. // CHECK:STDOUT: .a = %a
  429. // CHECK:STDOUT: }
  430. // CHECK:STDOUT: %Core.import = import Core
  431. // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] {
  432. // CHECK:STDOUT: %T.patt.loc4_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  433. // CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc4_13.1, runtime_param<invalid> [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  434. // CHECK:STDOUT: %N.patt.loc4_23.1: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)]
  435. // CHECK:STDOUT: %N.param_patt: i32 = param_pattern %N.patt.loc4_23.1, runtime_param<invalid> [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)]
  436. // CHECK:STDOUT: } {
  437. // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  438. // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %int.make_type_32 [template = i32]
  439. // CHECK:STDOUT: %.loc4_27.2: type = converted %int.make_type_32, %.loc4_27.1 [template = i32]
  440. // CHECK:STDOUT: %param.loc4_13: type = param runtime_param<invalid>
  441. // CHECK:STDOUT: %T.loc4_13.1: type = bind_symbolic_name T, 0, %param.loc4_13 [symbolic = %T.loc4_13.2 (constants.%T)]
  442. // CHECK:STDOUT: %param.loc4_23: i32 = param runtime_param<invalid>
  443. // CHECK:STDOUT: %N.loc4_23.1: i32 = bind_symbolic_name N, 1, %param.loc4_23 [symbolic = %N.loc4_23.2 (constants.%N)]
  444. // CHECK:STDOUT: }
  445. // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1]
  446. // CHECK:STDOUT: %.loc12_14: i32 = int_literal 5 [template = constants.%.4]
  447. // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  448. // CHECK:STDOUT: %.loc12_20.1: type = value_of_initializer %int.make_type_32 [template = i32]
  449. // CHECK:STDOUT: %.loc12_20.2: type = converted %int.make_type_32, %.loc12_20.1 [template = i32]
  450. // CHECK:STDOUT: %.loc12_20.3: type = ptr_type i32 [template = constants.%.5]
  451. // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(type) [template = constants.%ImplicitAs.type.3]
  452. // CHECK:STDOUT: %.loc12_13.1: %.8 = specific_constant imports.%import_ref.4, @ImplicitAs(type) [template = constants.%.9]
  453. // CHECK:STDOUT: %Convert.ref: %.8 = name_ref Convert, %.loc12_13.1 [template = constants.%.9]
  454. // CHECK:STDOUT: %.loc12_13.2: type = converted %.loc12_14, <error> [template = <error>]
  455. // CHECK:STDOUT: %a.var: ref <error> = var a
  456. // CHECK:STDOUT: %a: ref <error> = bind_name a, %a.var
  457. // CHECK:STDOUT: }
  458. // CHECK:STDOUT:
  459. // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) {
  460. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  461. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)]
  462. // CHECK:STDOUT:
  463. // CHECK:STDOUT: !definition:
  464. // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
  465. // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
  466. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)]
  467. // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)]
  468. // CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.6)]
  469. // CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.6) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.7)]
  470. // CHECK:STDOUT:
  471. // CHECK:STDOUT: interface {
  472. // CHECK:STDOUT: !members:
  473. // CHECK:STDOUT: .Self = imports.%import_ref.3
  474. // CHECK:STDOUT: .Convert = imports.%import_ref.4
  475. // CHECK:STDOUT: witness = (imports.%import_ref.5)
  476. // CHECK:STDOUT: }
  477. // CHECK:STDOUT: }
  478. // CHECK:STDOUT:
  479. // CHECK:STDOUT: generic class @Class(%T.loc4_13.1: type, %N.loc4_23.1: i32) {
  480. // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_13.2 (constants.%T)]
  481. // CHECK:STDOUT: %T.patt.loc4_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_13.2 (constants.%T.patt)]
  482. // CHECK:STDOUT: %N.loc4_23.2: i32 = bind_symbolic_name N, 1 [symbolic = %N.loc4_23.2 (constants.%N)]
  483. // CHECK:STDOUT: %N.patt.loc4_23.2: i32 = symbolic_binding_pattern N, 1 [symbolic = %N.patt.loc4_23.2 (constants.%N.patt)]
  484. // CHECK:STDOUT:
  485. // CHECK:STDOUT: !definition:
  486. // CHECK:STDOUT:
  487. // CHECK:STDOUT: class {
  488. // CHECK:STDOUT: %.loc4_33: <witness> = complete_type_witness %.2 [template = constants.%.3]
  489. // CHECK:STDOUT:
  490. // CHECK:STDOUT: !members:
  491. // CHECK:STDOUT: .Self = constants.%Class.2
  492. // CHECK:STDOUT: }
  493. // CHECK:STDOUT: }
  494. // CHECK:STDOUT:
  495. // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
  496. // CHECK:STDOUT:
  497. // CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) {
  498. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  499. // CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
  500. // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
  501. // CHECK:STDOUT:
  502. // CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest);
  503. // CHECK:STDOUT: }
  504. // CHECK:STDOUT:
  505. // CHECK:STDOUT: specific @Class(constants.%T, constants.%N) {
  506. // CHECK:STDOUT: %T.loc4_13.2 => constants.%T
  507. // CHECK:STDOUT: %T.patt.loc4_13.2 => constants.%T
  508. // CHECK:STDOUT: %N.loc4_23.2 => constants.%N
  509. // CHECK:STDOUT: %N.patt.loc4_23.2 => constants.%N
  510. // CHECK:STDOUT: }
  511. // CHECK:STDOUT:
  512. // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
  513. // CHECK:STDOUT: %Dest => constants.%Dest
  514. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  515. // CHECK:STDOUT: }
  516. // CHECK:STDOUT:
  517. // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) {
  518. // CHECK:STDOUT: %Dest => constants.%Dest
  519. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  520. // CHECK:STDOUT: }
  521. // CHECK:STDOUT:
  522. // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) {
  523. // CHECK:STDOUT: %Dest => constants.%Dest
  524. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  525. // CHECK:STDOUT: }
  526. // CHECK:STDOUT:
  527. // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) {
  528. // CHECK:STDOUT: %Dest => constants.%Dest
  529. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2
  530. // CHECK:STDOUT: %Self => constants.%Self.1
  531. // CHECK:STDOUT: }
  532. // CHECK:STDOUT:
  533. // CHECK:STDOUT: specific @ImplicitAs(type) {
  534. // CHECK:STDOUT: %Dest => type
  535. // CHECK:STDOUT: %Dest.patt => type
  536. // CHECK:STDOUT:
  537. // CHECK:STDOUT: !definition:
  538. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3
  539. // CHECK:STDOUT: %Self => constants.%Self.2
  540. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2
  541. // CHECK:STDOUT: %Convert => constants.%Convert.2
  542. // CHECK:STDOUT: %.1 => constants.%.8
  543. // CHECK:STDOUT: %.2 => constants.%.9
  544. // CHECK:STDOUT: }
  545. // CHECK:STDOUT:
  546. // CHECK:STDOUT: --- call_in_nested_return_type.carbon
  547. // CHECK:STDOUT:
  548. // CHECK:STDOUT: constants {
  549. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  550. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  551. // CHECK:STDOUT: %Outer.type: type = generic_class_type @Outer [template]
  552. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  553. // CHECK:STDOUT: %Outer.1: %Outer.type = struct_value () [template]
  554. // CHECK:STDOUT: %Outer.2: type = class_type @Outer, @Outer(%T) [symbolic]
  555. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic]
  556. // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 [symbolic]
  557. // CHECK:STDOUT: %Inner.type.1: type = generic_class_type @Inner, @Outer(%T) [symbolic]
  558. // CHECK:STDOUT: %Inner.1: %Inner.type.1 = struct_value () [symbolic]
  559. // CHECK:STDOUT: %Inner.2: type = class_type @Inner, @Inner(%T, %U) [symbolic]
  560. // CHECK:STDOUT: %A.type.1: type = fn_type @A, @Inner(%T, %U) [symbolic]
  561. // CHECK:STDOUT: %A.1: %A.type.1 = struct_value () [symbolic]
  562. // CHECK:STDOUT: %Outer.3: type = class_type @Outer, @Outer(%U) [symbolic]
  563. // CHECK:STDOUT: %B.type.1: type = fn_type @B, @Inner(%T, %U) [symbolic]
  564. // CHECK:STDOUT: %B.1: %B.type.1 = struct_value () [symbolic]
  565. // CHECK:STDOUT: %Inner.3: type = class_type @Inner, @Inner(%T, %T) [symbolic]
  566. // CHECK:STDOUT: %C.type.1: type = fn_type @C, @Inner(%T, %U) [symbolic]
  567. // CHECK:STDOUT: %C.1: %C.type.1 = struct_value () [symbolic]
  568. // CHECK:STDOUT: %D.type.1: type = fn_type @D, @Inner(%T, %U) [symbolic]
  569. // CHECK:STDOUT: %D.1: %D.type.1 = struct_value () [symbolic]
  570. // CHECK:STDOUT: %.2: type = struct_type {} [template]
  571. // CHECK:STDOUT: %.3: <witness> = complete_type_witness %.2 [template]
  572. // CHECK:STDOUT: %.4: type = ptr_type %.2 [template]
  573. // CHECK:STDOUT: %struct.1: %Outer.2 = struct_value () [symbolic]
  574. // CHECK:STDOUT: %Inner.type.2: type = generic_class_type @Inner, @Outer(%U) [symbolic]
  575. // CHECK:STDOUT: %Inner.4: %Inner.type.2 = struct_value () [symbolic]
  576. // CHECK:STDOUT: %struct.2: %Outer.3 = struct_value () [symbolic]
  577. // CHECK:STDOUT: %A.type.2: type = fn_type @A, @Inner(%T, %T) [symbolic]
  578. // CHECK:STDOUT: %A.2: %A.type.2 = struct_value () [symbolic]
  579. // CHECK:STDOUT: %B.type.2: type = fn_type @B, @Inner(%T, %T) [symbolic]
  580. // CHECK:STDOUT: %B.2: %B.type.2 = struct_value () [symbolic]
  581. // CHECK:STDOUT: %C.type.2: type = fn_type @C, @Inner(%T, %T) [symbolic]
  582. // CHECK:STDOUT: %C.2: %C.type.2 = struct_value () [symbolic]
  583. // CHECK:STDOUT: %D.type.2: type = fn_type @D, @Inner(%T, %T) [symbolic]
  584. // CHECK:STDOUT: %D.2: %D.type.2 = struct_value () [symbolic]
  585. // CHECK:STDOUT: %struct.3: %Inner.3 = struct_value () [symbolic]
  586. // CHECK:STDOUT: %struct.4: %Inner.2 = struct_value () [symbolic]
  587. // CHECK:STDOUT: }
  588. // CHECK:STDOUT:
  589. // CHECK:STDOUT: imports {
  590. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  591. // CHECK:STDOUT: import Core//prelude
  592. // CHECK:STDOUT: import Core//prelude/operators
  593. // CHECK:STDOUT: import Core//prelude/types
  594. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  595. // CHECK:STDOUT: import Core//prelude/operators/as
  596. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  597. // CHECK:STDOUT: import Core//prelude/operators/comparison
  598. // CHECK:STDOUT: import Core//prelude/types/bool
  599. // CHECK:STDOUT: }
  600. // CHECK:STDOUT: }
  601. // CHECK:STDOUT:
  602. // CHECK:STDOUT: file {
  603. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  604. // CHECK:STDOUT: .Core = imports.%Core
  605. // CHECK:STDOUT: .Outer = %Outer.decl
  606. // CHECK:STDOUT: }
  607. // CHECK:STDOUT: %Core.import = import Core
  608. // CHECK:STDOUT: %Outer.decl: %Outer.type = class_decl @Outer [template = constants.%Outer.1] {
  609. // CHECK:STDOUT: %T.patt.loc2_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc2_13.2 (constants.%T.patt)]
  610. // CHECK:STDOUT: %T.param_patt: type = param_pattern %T.patt.loc2_13.1, runtime_param<invalid> [symbolic = %T.patt.loc2_13.2 (constants.%T.patt)]
  611. // CHECK:STDOUT: } {
  612. // CHECK:STDOUT: %param: type = param runtime_param<invalid>
  613. // CHECK:STDOUT: %T.loc2_13.1: type = bind_symbolic_name T, 0, %param [symbolic = %T.loc2_13.2 (constants.%T)]
  614. // CHECK:STDOUT: }
  615. // CHECK:STDOUT: }
  616. // CHECK:STDOUT:
  617. // CHECK:STDOUT: generic class @Outer(%T.loc2_13.1: type) {
  618. // CHECK:STDOUT: %T.loc2_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc2_13.2 (constants.%T)]
  619. // CHECK:STDOUT: %T.patt.loc2_13.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc2_13.2 (constants.%T.patt)]
  620. // CHECK:STDOUT:
  621. // CHECK:STDOUT: !definition:
  622. // CHECK:STDOUT: %Inner.type: type = generic_class_type @Inner, @Outer(%T.loc2_13.2) [symbolic = %Inner.type (constants.%Inner.type.1)]
  623. // CHECK:STDOUT: %Inner: @Outer.%Inner.type (%Inner.type.1) = struct_value () [symbolic = %Inner (constants.%Inner.1)]
  624. // CHECK:STDOUT:
  625. // CHECK:STDOUT: class {
  626. // CHECK:STDOUT: %Inner.decl: @Outer.%Inner.type (%Inner.type.1) = class_decl @Inner [symbolic = @Outer.%Inner (constants.%Inner.1)] {
  627. // CHECK:STDOUT: %U.patt.loc3_15.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc3_15.2 (constants.%U.patt)]
  628. // CHECK:STDOUT: %U.param_patt: type = param_pattern %U.patt.loc3_15.1, runtime_param<invalid> [symbolic = %U.patt.loc3_15.2 (constants.%U.patt)]
  629. // CHECK:STDOUT: } {
  630. // CHECK:STDOUT: %param: type = param runtime_param<invalid>
  631. // CHECK:STDOUT: %U.loc3_15.1: type = bind_symbolic_name U, 1, %param [symbolic = %U.loc3_15.2 (constants.%U)]
  632. // CHECK:STDOUT: }
  633. // CHECK:STDOUT: %.loc17: <witness> = complete_type_witness %.2 [template = constants.%.3]
  634. // CHECK:STDOUT:
  635. // CHECK:STDOUT: !members:
  636. // CHECK:STDOUT: .Self = constants.%Outer.2
  637. // CHECK:STDOUT: .Inner = %Inner.decl
  638. // CHECK:STDOUT: }
  639. // CHECK:STDOUT: }
  640. // CHECK:STDOUT:
  641. // CHECK:STDOUT: generic class @Inner(@Outer.%T.loc2_13.1: type, %U.loc3_15.1: type) {
  642. // CHECK:STDOUT: %U.loc3_15.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc3_15.2 (constants.%U)]
  643. // CHECK:STDOUT: %U.patt.loc3_15.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc3_15.2 (constants.%U.patt)]
  644. // CHECK:STDOUT:
  645. // CHECK:STDOUT: !definition:
  646. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  647. // CHECK:STDOUT: %A.type: type = fn_type @A, @Inner(%T, %U.loc3_15.2) [symbolic = %A.type (constants.%A.type.1)]
  648. // CHECK:STDOUT: %A: @Inner.%A.type (%A.type.1) = struct_value () [symbolic = %A (constants.%A.1)]
  649. // CHECK:STDOUT: %B.type: type = fn_type @B, @Inner(%T, %U.loc3_15.2) [symbolic = %B.type (constants.%B.type.1)]
  650. // CHECK:STDOUT: %B: @Inner.%B.type (%B.type.1) = struct_value () [symbolic = %B (constants.%B.1)]
  651. // CHECK:STDOUT: %C.type: type = fn_type @C, @Inner(%T, %U.loc3_15.2) [symbolic = %C.type (constants.%C.type.1)]
  652. // CHECK:STDOUT: %C: @Inner.%C.type (%C.type.1) = struct_value () [symbolic = %C (constants.%C.1)]
  653. // CHECK:STDOUT: %D.type: type = fn_type @D, @Inner(%T, %U.loc3_15.2) [symbolic = %D.type (constants.%D.type.1)]
  654. // CHECK:STDOUT: %D: @Inner.%D.type (%D.type.1) = struct_value () [symbolic = %D (constants.%D.1)]
  655. // CHECK:STDOUT:
  656. // CHECK:STDOUT: class {
  657. // CHECK:STDOUT: %A.decl: @Inner.%A.type (%A.type.1) = fn_decl @A [symbolic = @Inner.%A (constants.%A.1)] {} {
  658. // CHECK:STDOUT: %Outer.ref: %Outer.type = name_ref Outer, file.%Outer.decl [template = constants.%Outer.1]
  659. // CHECK:STDOUT: %T.ref: type = name_ref T, @Outer.%T.loc2_13.1 [symbolic = %T (constants.%T)]
  660. // CHECK:STDOUT: %Outer.loc4_20.2: type = class_type @Outer, @Outer(constants.%T) [symbolic = %Outer.loc4_20.1 (constants.%Outer.2)]
  661. // CHECK:STDOUT: %return: ref @A.%Outer.loc4_20.1 (%Outer.2) = var <return slot>
  662. // CHECK:STDOUT: }
  663. // CHECK:STDOUT: %B.decl: @Inner.%B.type (%B.type.1) = fn_decl @B [symbolic = @Inner.%B (constants.%B.1)] {} {
  664. // CHECK:STDOUT: %Outer.ref: %Outer.type = name_ref Outer, file.%Outer.decl [template = constants.%Outer.1]
  665. // CHECK:STDOUT: %U.ref: type = name_ref U, @Inner.%U.loc3_15.1 [symbolic = %U (constants.%U)]
  666. // CHECK:STDOUT: %Outer.loc7_20.2: type = class_type @Outer, @Outer(constants.%U) [symbolic = %Outer.loc7_20.1 (constants.%Outer.3)]
  667. // CHECK:STDOUT: %return: ref @B.%Outer.loc7_20.1 (%Outer.3) = var <return slot>
  668. // CHECK:STDOUT: }
  669. // CHECK:STDOUT: %C.decl: @Inner.%C.type (%C.type.1) = fn_decl @C [symbolic = @Inner.%C (constants.%C.1)] {} {
  670. // CHECK:STDOUT: %.loc10: @C.%Inner.type (%Inner.type.1) = specific_constant @Outer.%Inner.decl, @Outer(constants.%T) [symbolic = %Inner.loc10_15 (constants.%Inner.1)]
  671. // CHECK:STDOUT: %Inner.ref: @C.%Inner.type (%Inner.type.1) = name_ref Inner, %.loc10 [symbolic = %Inner.loc10_15 (constants.%Inner.1)]
  672. // CHECK:STDOUT: %T.ref: type = name_ref T, @Outer.%T.loc2_13.1 [symbolic = %T (constants.%T)]
  673. // CHECK:STDOUT: %Inner.loc10_20.2: type = class_type @Inner, @Inner(constants.%T, constants.%T) [symbolic = %Inner.loc10_20.1 (constants.%Inner.3)]
  674. // CHECK:STDOUT: %return: ref @C.%Inner.loc10_20.1 (%Inner.3) = var <return slot>
  675. // CHECK:STDOUT: }
  676. // CHECK:STDOUT: %D.decl: @Inner.%D.type (%D.type.1) = fn_decl @D [symbolic = @Inner.%D (constants.%D.1)] {} {
  677. // CHECK:STDOUT: %.loc13: @D.%Inner.type (%Inner.type.1) = specific_constant @Outer.%Inner.decl, @Outer(constants.%T) [symbolic = %Inner.loc13_15 (constants.%Inner.1)]
  678. // CHECK:STDOUT: %Inner.ref: @D.%Inner.type (%Inner.type.1) = name_ref Inner, %.loc13 [symbolic = %Inner.loc13_15 (constants.%Inner.1)]
  679. // CHECK:STDOUT: %U.ref: type = name_ref U, @Inner.%U.loc3_15.1 [symbolic = %U (constants.%U)]
  680. // CHECK:STDOUT: %Inner.loc13_20.2: type = class_type @Inner, @Inner(constants.%T, constants.%U) [symbolic = %Inner.loc13_20.1 (constants.%Inner.2)]
  681. // CHECK:STDOUT: %return: ref @D.%Inner.loc13_20.1 (%Inner.2) = var <return slot>
  682. // CHECK:STDOUT: }
  683. // CHECK:STDOUT: %.loc16: <witness> = complete_type_witness %.2 [template = constants.%.3]
  684. // CHECK:STDOUT:
  685. // CHECK:STDOUT: !members:
  686. // CHECK:STDOUT: .Self = constants.%Inner.2
  687. // CHECK:STDOUT: .A = %A.decl
  688. // CHECK:STDOUT: .B = %B.decl
  689. // CHECK:STDOUT: .C = %C.decl
  690. // CHECK:STDOUT: .D = %D.decl
  691. // CHECK:STDOUT: }
  692. // CHECK:STDOUT: }
  693. // CHECK:STDOUT:
  694. // CHECK:STDOUT: generic fn @A(@Outer.%T.loc2_13.1: type, @Inner.%U.loc3_15.1: type) {
  695. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  696. // CHECK:STDOUT: %Outer.loc4_20.1: type = class_type @Outer, @Outer(%T) [symbolic = %Outer.loc4_20.1 (constants.%Outer.2)]
  697. // CHECK:STDOUT:
  698. // CHECK:STDOUT: !definition:
  699. // CHECK:STDOUT: %struct: @A.%Outer.loc4_20.1 (%Outer.2) = struct_value () [symbolic = %struct (constants.%struct.1)]
  700. // CHECK:STDOUT:
  701. // CHECK:STDOUT: fn() -> %return: @A.%Outer.loc4_20.1 (%Outer.2) {
  702. // CHECK:STDOUT: !entry:
  703. // CHECK:STDOUT: %.loc5_15.1: %.2 = struct_literal ()
  704. // CHECK:STDOUT: %.loc5_15.2: init @A.%Outer.loc4_20.1 (%Outer.2) = class_init (), %return [symbolic = %struct (constants.%struct.1)]
  705. // CHECK:STDOUT: %.loc5_16: init @A.%Outer.loc4_20.1 (%Outer.2) = converted %.loc5_15.1, %.loc5_15.2 [symbolic = %struct (constants.%struct.1)]
  706. // CHECK:STDOUT: return %.loc5_16 to %return
  707. // CHECK:STDOUT: }
  708. // CHECK:STDOUT: }
  709. // CHECK:STDOUT:
  710. // CHECK:STDOUT: generic fn @B(@Outer.%T.loc2_13.1: type, @Inner.%U.loc3_15.1: type) {
  711. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic = %U (constants.%U)]
  712. // CHECK:STDOUT: %Outer.loc7_20.1: type = class_type @Outer, @Outer(%U) [symbolic = %Outer.loc7_20.1 (constants.%Outer.3)]
  713. // CHECK:STDOUT:
  714. // CHECK:STDOUT: !definition:
  715. // CHECK:STDOUT: %struct: @B.%Outer.loc7_20.1 (%Outer.3) = struct_value () [symbolic = %struct (constants.%struct.2)]
  716. // CHECK:STDOUT:
  717. // CHECK:STDOUT: fn() -> %return: @B.%Outer.loc7_20.1 (%Outer.3) {
  718. // CHECK:STDOUT: !entry:
  719. // CHECK:STDOUT: %.loc8_15.1: %.2 = struct_literal ()
  720. // CHECK:STDOUT: %.loc8_15.2: init @B.%Outer.loc7_20.1 (%Outer.3) = class_init (), %return [symbolic = %struct (constants.%struct.2)]
  721. // CHECK:STDOUT: %.loc8_16: init @B.%Outer.loc7_20.1 (%Outer.3) = converted %.loc8_15.1, %.loc8_15.2 [symbolic = %struct (constants.%struct.2)]
  722. // CHECK:STDOUT: return %.loc8_16 to %return
  723. // CHECK:STDOUT: }
  724. // CHECK:STDOUT: }
  725. // CHECK:STDOUT:
  726. // CHECK:STDOUT: generic fn @C(@Outer.%T.loc2_13.1: type, @Inner.%U.loc3_15.1: type) {
  727. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  728. // CHECK:STDOUT: %Inner.type: type = generic_class_type @Inner, @Outer(%T) [symbolic = %Inner.type (constants.%Inner.type.1)]
  729. // CHECK:STDOUT: %Inner.loc10_15: @C.%Inner.type (%Inner.type.1) = struct_value () [symbolic = %Inner.loc10_15 (constants.%Inner.1)]
  730. // CHECK:STDOUT: %Inner.loc10_20.1: type = class_type @Inner, @Inner(%T, %T) [symbolic = %Inner.loc10_20.1 (constants.%Inner.3)]
  731. // CHECK:STDOUT:
  732. // CHECK:STDOUT: !definition:
  733. // CHECK:STDOUT: %struct: @C.%Inner.loc10_20.1 (%Inner.3) = struct_value () [symbolic = %struct (constants.%struct.3)]
  734. // CHECK:STDOUT:
  735. // CHECK:STDOUT: fn() -> %return: @C.%Inner.loc10_20.1 (%Inner.3) {
  736. // CHECK:STDOUT: !entry:
  737. // CHECK:STDOUT: %.loc11_15.1: %.2 = struct_literal ()
  738. // CHECK:STDOUT: %.loc11_15.2: init @C.%Inner.loc10_20.1 (%Inner.3) = class_init (), %return [symbolic = %struct (constants.%struct.3)]
  739. // CHECK:STDOUT: %.loc11_16: init @C.%Inner.loc10_20.1 (%Inner.3) = converted %.loc11_15.1, %.loc11_15.2 [symbolic = %struct (constants.%struct.3)]
  740. // CHECK:STDOUT: return %.loc11_16 to %return
  741. // CHECK:STDOUT: }
  742. // CHECK:STDOUT: }
  743. // CHECK:STDOUT:
  744. // CHECK:STDOUT: generic fn @D(@Outer.%T.loc2_13.1: type, @Inner.%U.loc3_15.1: type) {
  745. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  746. // CHECK:STDOUT: %Inner.type: type = generic_class_type @Inner, @Outer(%T) [symbolic = %Inner.type (constants.%Inner.type.1)]
  747. // CHECK:STDOUT: %Inner.loc13_15: @D.%Inner.type (%Inner.type.1) = struct_value () [symbolic = %Inner.loc13_15 (constants.%Inner.1)]
  748. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic = %U (constants.%U)]
  749. // CHECK:STDOUT: %Inner.loc13_20.1: type = class_type @Inner, @Inner(%T, %U) [symbolic = %Inner.loc13_20.1 (constants.%Inner.2)]
  750. // CHECK:STDOUT:
  751. // CHECK:STDOUT: !definition:
  752. // CHECK:STDOUT: %struct: @D.%Inner.loc13_20.1 (%Inner.2) = struct_value () [symbolic = %struct (constants.%struct.4)]
  753. // CHECK:STDOUT:
  754. // CHECK:STDOUT: fn() -> %return: @D.%Inner.loc13_20.1 (%Inner.2) {
  755. // CHECK:STDOUT: !entry:
  756. // CHECK:STDOUT: %.loc14_15.1: %.2 = struct_literal ()
  757. // CHECK:STDOUT: %.loc14_15.2: init @D.%Inner.loc13_20.1 (%Inner.2) = class_init (), %return [symbolic = %struct (constants.%struct.4)]
  758. // CHECK:STDOUT: %.loc14_16: init @D.%Inner.loc13_20.1 (%Inner.2) = converted %.loc14_15.1, %.loc14_15.2 [symbolic = %struct (constants.%struct.4)]
  759. // CHECK:STDOUT: return %.loc14_16 to %return
  760. // CHECK:STDOUT: }
  761. // CHECK:STDOUT: }
  762. // CHECK:STDOUT:
  763. // CHECK:STDOUT: specific @Outer(constants.%T) {
  764. // CHECK:STDOUT: %T.loc2_13.2 => constants.%T
  765. // CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T
  766. // CHECK:STDOUT:
  767. // CHECK:STDOUT: !definition:
  768. // CHECK:STDOUT: %Inner.type => constants.%Inner.type.1
  769. // CHECK:STDOUT: %Inner => constants.%Inner.1
  770. // CHECK:STDOUT: }
  771. // CHECK:STDOUT:
  772. // CHECK:STDOUT: specific @Inner(constants.%T, constants.%U) {
  773. // CHECK:STDOUT: %U.loc3_15.2 => constants.%U
  774. // CHECK:STDOUT: %U.patt.loc3_15.2 => constants.%U
  775. // CHECK:STDOUT:
  776. // CHECK:STDOUT: !definition:
  777. // CHECK:STDOUT: %T => constants.%T
  778. // CHECK:STDOUT: %A.type => constants.%A.type.1
  779. // CHECK:STDOUT: %A => constants.%A.1
  780. // CHECK:STDOUT: %B.type => constants.%B.type.1
  781. // CHECK:STDOUT: %B => constants.%B.1
  782. // CHECK:STDOUT: %C.type => constants.%C.type.1
  783. // CHECK:STDOUT: %C => constants.%C.1
  784. // CHECK:STDOUT: %D.type => constants.%D.type.1
  785. // CHECK:STDOUT: %D => constants.%D.1
  786. // CHECK:STDOUT: }
  787. // CHECK:STDOUT:
  788. // CHECK:STDOUT: specific @Outer(@A.%T) {
  789. // CHECK:STDOUT: %T.loc2_13.2 => constants.%T
  790. // CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T
  791. // CHECK:STDOUT: }
  792. // CHECK:STDOUT:
  793. // CHECK:STDOUT: specific @A(constants.%T, constants.%U) {
  794. // CHECK:STDOUT: %T => constants.%T
  795. // CHECK:STDOUT: %Outer.loc4_20.1 => constants.%Outer.2
  796. // CHECK:STDOUT: }
  797. // CHECK:STDOUT:
  798. // CHECK:STDOUT: specific @Outer(constants.%U) {
  799. // CHECK:STDOUT: %T.loc2_13.2 => constants.%U
  800. // CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%U
  801. // CHECK:STDOUT:
  802. // CHECK:STDOUT: !definition:
  803. // CHECK:STDOUT: %Inner.type => constants.%Inner.type.2
  804. // CHECK:STDOUT: %Inner => constants.%Inner.4
  805. // CHECK:STDOUT: }
  806. // CHECK:STDOUT:
  807. // CHECK:STDOUT: specific @Outer(@B.%U) {
  808. // CHECK:STDOUT: %T.loc2_13.2 => constants.%U
  809. // CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%U
  810. // CHECK:STDOUT: }
  811. // CHECK:STDOUT:
  812. // CHECK:STDOUT: specific @B(constants.%T, constants.%U) {
  813. // CHECK:STDOUT: %U => constants.%U
  814. // CHECK:STDOUT: %Outer.loc7_20.1 => constants.%Outer.3
  815. // CHECK:STDOUT: }
  816. // CHECK:STDOUT:
  817. // CHECK:STDOUT: specific @Inner(constants.%T, constants.%T) {
  818. // CHECK:STDOUT: %U.loc3_15.2 => constants.%T
  819. // CHECK:STDOUT: %U.patt.loc3_15.2 => constants.%T
  820. // CHECK:STDOUT:
  821. // CHECK:STDOUT: !definition:
  822. // CHECK:STDOUT: %T => constants.%T
  823. // CHECK:STDOUT: %A.type => constants.%A.type.2
  824. // CHECK:STDOUT: %A => constants.%A.2
  825. // CHECK:STDOUT: %B.type => constants.%B.type.2
  826. // CHECK:STDOUT: %B => constants.%B.2
  827. // CHECK:STDOUT: %C.type => constants.%C.type.2
  828. // CHECK:STDOUT: %C => constants.%C.2
  829. // CHECK:STDOUT: %D.type => constants.%D.type.2
  830. // CHECK:STDOUT: %D => constants.%D.2
  831. // CHECK:STDOUT: }
  832. // CHECK:STDOUT:
  833. // CHECK:STDOUT: specific @Outer(@C.%T) {
  834. // CHECK:STDOUT: %T.loc2_13.2 => constants.%T
  835. // CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T
  836. // CHECK:STDOUT: }
  837. // CHECK:STDOUT:
  838. // CHECK:STDOUT: specific @Inner(@C.%T, @C.%T) {
  839. // CHECK:STDOUT: %U.loc3_15.2 => constants.%T
  840. // CHECK:STDOUT: %U.patt.loc3_15.2 => constants.%T
  841. // CHECK:STDOUT: }
  842. // CHECK:STDOUT:
  843. // CHECK:STDOUT: specific @C(constants.%T, constants.%U) {
  844. // CHECK:STDOUT: %T => constants.%T
  845. // CHECK:STDOUT: %Inner.type => constants.%Inner.type.1
  846. // CHECK:STDOUT: %Inner.loc10_15 => constants.%Inner.1
  847. // CHECK:STDOUT: %Inner.loc10_20.1 => constants.%Inner.3
  848. // CHECK:STDOUT: }
  849. // CHECK:STDOUT:
  850. // CHECK:STDOUT: specific @Outer(@D.%T) {
  851. // CHECK:STDOUT: %T.loc2_13.2 => constants.%T
  852. // CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T
  853. // CHECK:STDOUT: }
  854. // CHECK:STDOUT:
  855. // CHECK:STDOUT: specific @Inner(@D.%T, @D.%U) {
  856. // CHECK:STDOUT: %U.loc3_15.2 => constants.%U
  857. // CHECK:STDOUT: %U.patt.loc3_15.2 => constants.%U
  858. // CHECK:STDOUT: }
  859. // CHECK:STDOUT:
  860. // CHECK:STDOUT: specific @D(constants.%T, constants.%U) {
  861. // CHECK:STDOUT: %T => constants.%T
  862. // CHECK:STDOUT: %Inner.type => constants.%Inner.type.1
  863. // CHECK:STDOUT: %Inner.loc13_15 => constants.%Inner.1
  864. // CHECK:STDOUT: %U => constants.%U
  865. // CHECK:STDOUT: %Inner.loc13_20.1 => constants.%Inner.2
  866. // CHECK:STDOUT: }
  867. // CHECK:STDOUT:
  868. // CHECK:STDOUT: specific @Inner(@Inner.%T, @Inner.%U.loc3_15.2) {
  869. // CHECK:STDOUT: %U.loc3_15.2 => constants.%U
  870. // CHECK:STDOUT: %U.patt.loc3_15.2 => constants.%U
  871. // CHECK:STDOUT: }
  872. // CHECK:STDOUT:
  873. // CHECK:STDOUT: specific @Outer(@Outer.%T.loc2_13.2) {
  874. // CHECK:STDOUT: %T.loc2_13.2 => constants.%T
  875. // CHECK:STDOUT: %T.patt.loc2_13.2 => constants.%T
  876. // CHECK:STDOUT: }
  877. // CHECK:STDOUT: