base_is_generic.carbon 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930
  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/base_is_generic.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/generic/base_is_generic.carbon
  10. // --- extend_generic_base.carbon
  11. library "[[@TEST_NAME]]";
  12. base class Base(T:! type) {
  13. var x: T;
  14. }
  15. class Param {
  16. var y: i32;
  17. }
  18. class Derived {
  19. extend base: Base(Param);
  20. }
  21. fn DoubleFieldAccess(d: Derived) -> i32 {
  22. return d.x.y;
  23. }
  24. // --- import.carbon
  25. library "[[@TEST_NAME]]";
  26. import library "extend_generic_base";
  27. fn ImportedDoubleFieldAccess(d: Derived) -> i32 {
  28. return d.x.y;
  29. }
  30. // --- fail_todo_extend_symbolic_base.carbon
  31. library "[[@TEST_NAME]]";
  32. class C(T:! type) {
  33. // CHECK:STDERR: fail_todo_extend_symbolic_base.carbon:[[@LINE+3]]:16: error: deriving from final type `T`; base type must be an `abstract` or `base` class [BaseIsFinal]
  34. // CHECK:STDERR: extend base: T;
  35. // CHECK:STDERR: ^
  36. extend base: T;
  37. }
  38. base class X {
  39. fn G() {}
  40. }
  41. fn F() {
  42. C(X).G();
  43. }
  44. // --- extend_generic_symbolic_base.carbon
  45. library "[[@TEST_NAME]]";
  46. base class X(U:! type) {
  47. fn G() -> U { return G(); }
  48. }
  49. class C(T:! type) {
  50. extend base: X(T);
  51. }
  52. fn F() {
  53. let i: i32 = C(i32).G();
  54. }
  55. // --- import_extend_generic_symbolic_base.carbon
  56. library "[[@TEST_NAME]]";
  57. import library "extend_generic_symbolic_base";
  58. fn H() {
  59. let j: i32 = C(i32).G();
  60. }
  61. // CHECK:STDOUT: --- extend_generic_base.carbon
  62. // CHECK:STDOUT:
  63. // CHECK:STDOUT: constants {
  64. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  65. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  66. // CHECK:STDOUT: %Base.type: type = generic_class_type @Base [template]
  67. // CHECK:STDOUT: %Base.generic: %Base.type = struct_value () [template]
  68. // CHECK:STDOUT: %Base.0cc: type = class_type @Base, @Base(%T) [symbolic]
  69. // CHECK:STDOUT: %require_complete.db1: <witness> = require_complete_type %T [symbolic]
  70. // CHECK:STDOUT: %Base.elem.bb6: type = unbound_element_type %Base.0cc, %T [symbolic]
  71. // CHECK:STDOUT: %struct_type.x.710: type = struct_type {.x: %T} [symbolic]
  72. // CHECK:STDOUT: %complete_type.60a: <witness> = complete_type_witness %struct_type.x.710 [symbolic]
  73. // CHECK:STDOUT: %Param: type = class_type @Param [template]
  74. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  75. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  76. // CHECK:STDOUT: %Param.elem: type = unbound_element_type %Param, %i32 [template]
  77. // CHECK:STDOUT: %struct_type.y: type = struct_type {.y: %i32} [template]
  78. // CHECK:STDOUT: %complete_type.5e2: <witness> = complete_type_witness %struct_type.y [template]
  79. // CHECK:STDOUT: %Derived: type = class_type @Derived [template]
  80. // CHECK:STDOUT: %Base.cc4: type = class_type @Base, @Base(%Param) [template]
  81. // CHECK:STDOUT: %Base.elem.8c2: type = unbound_element_type %Base.cc4, %Param [template]
  82. // CHECK:STDOUT: %struct_type.x.975: type = struct_type {.x: %Param} [template]
  83. // CHECK:STDOUT: %complete_type.db3: <witness> = complete_type_witness %struct_type.x.975 [template]
  84. // CHECK:STDOUT: %Derived.elem: type = unbound_element_type %Derived, %Base.cc4 [template]
  85. // CHECK:STDOUT: %struct_type.base.d47: type = struct_type {.base: %Base.cc4} [template]
  86. // CHECK:STDOUT: %complete_type.08e: <witness> = complete_type_witness %struct_type.base.d47 [template]
  87. // CHECK:STDOUT: %DoubleFieldAccess.type: type = fn_type @DoubleFieldAccess [template]
  88. // CHECK:STDOUT: %DoubleFieldAccess: %DoubleFieldAccess.type = struct_value () [template]
  89. // CHECK:STDOUT: }
  90. // CHECK:STDOUT:
  91. // CHECK:STDOUT: imports {
  92. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  93. // CHECK:STDOUT: .Int = %import_ref.187
  94. // CHECK:STDOUT: import Core//prelude
  95. // CHECK:STDOUT: import Core//prelude/...
  96. // CHECK:STDOUT: }
  97. // CHECK:STDOUT: }
  98. // CHECK:STDOUT:
  99. // CHECK:STDOUT: file {
  100. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  101. // CHECK:STDOUT: .Core = imports.%Core
  102. // CHECK:STDOUT: .Base = %Base.decl
  103. // CHECK:STDOUT: .Param = %Param.decl
  104. // CHECK:STDOUT: .Derived = %Derived.decl
  105. // CHECK:STDOUT: .DoubleFieldAccess = %DoubleFieldAccess.decl
  106. // CHECK:STDOUT: }
  107. // CHECK:STDOUT: %Core.import = import Core
  108. // CHECK:STDOUT: %Base.decl: %Base.type = class_decl @Base [template = constants.%Base.generic] {
  109. // CHECK:STDOUT: %T.patt.loc4_17.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_17.2 (constants.%T.patt)]
  110. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_17.1, runtime_param<invalid> [symbolic = %T.patt.loc4_17.2 (constants.%T.patt)]
  111. // CHECK:STDOUT: } {
  112. // CHECK:STDOUT: %T.param: type = value_param runtime_param<invalid>
  113. // CHECK:STDOUT: %T.loc4_17.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_17.2 (constants.%T)]
  114. // CHECK:STDOUT: }
  115. // CHECK:STDOUT: %Param.decl: type = class_decl @Param [template = constants.%Param] {} {}
  116. // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {}
  117. // CHECK:STDOUT: %DoubleFieldAccess.decl: %DoubleFieldAccess.type = fn_decl @DoubleFieldAccess [template = constants.%DoubleFieldAccess] {
  118. // CHECK:STDOUT: %d.patt: %Derived = binding_pattern d
  119. // CHECK:STDOUT: %d.param_patt: %Derived = value_param_pattern %d.patt, runtime_param0
  120. // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
  121. // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1
  122. // CHECK:STDOUT: } {
  123. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  124. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  125. // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0
  126. // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived]
  127. // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param
  128. // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
  129. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  130. // CHECK:STDOUT: }
  131. // CHECK:STDOUT: }
  132. // CHECK:STDOUT:
  133. // CHECK:STDOUT: generic class @Base(%T.loc4_17.1: type) {
  134. // CHECK:STDOUT: %T.loc4_17.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_17.2 (constants.%T)]
  135. // CHECK:STDOUT: %T.patt.loc4_17.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_17.2 (constants.%T.patt)]
  136. // CHECK:STDOUT:
  137. // CHECK:STDOUT: !definition:
  138. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Base.%T.loc4_17.2 (%T) [symbolic = %require_complete (constants.%require_complete.db1)]
  139. // CHECK:STDOUT: %Base: type = class_type @Base, @Base(%T.loc4_17.2) [symbolic = %Base (constants.%Base.0cc)]
  140. // CHECK:STDOUT: %Base.elem: type = unbound_element_type @Base.%Base (%Base.0cc), @Base.%T.loc4_17.2 (%T) [symbolic = %Base.elem (constants.%Base.elem.bb6)]
  141. // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @Base.%T.loc4_17.2 (%T)} [symbolic = %struct_type.x (constants.%struct_type.x.710)]
  142. // CHECK:STDOUT: %complete_type.loc6_1.2: <witness> = complete_type_witness @Base.%struct_type.x (%struct_type.x.710) [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.60a)]
  143. // CHECK:STDOUT:
  144. // CHECK:STDOUT: class {
  145. // CHECK:STDOUT: %.loc5: @Base.%Base.elem (%Base.elem.bb6) = field_decl x, element0 [template]
  146. // CHECK:STDOUT: %complete_type.loc6_1.1: <witness> = complete_type_witness %struct_type.x.710 [symbolic = %complete_type.loc6_1.2 (constants.%complete_type.60a)]
  147. // CHECK:STDOUT:
  148. // CHECK:STDOUT: !members:
  149. // CHECK:STDOUT: .Self = constants.%Base.0cc
  150. // CHECK:STDOUT: .x = %.loc5
  151. // CHECK:STDOUT: complete_type_witness = %complete_type.loc6_1.1
  152. // CHECK:STDOUT: }
  153. // CHECK:STDOUT: }
  154. // CHECK:STDOUT:
  155. // CHECK:STDOUT: class @Param {
  156. // CHECK:STDOUT: %.loc9: %Param.elem = field_decl y, element0 [template]
  157. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.y [template = constants.%complete_type.5e2]
  158. // CHECK:STDOUT:
  159. // CHECK:STDOUT: !members:
  160. // CHECK:STDOUT: .Self = constants.%Param
  161. // CHECK:STDOUT: .y = %.loc9
  162. // CHECK:STDOUT: complete_type_witness = %complete_type
  163. // CHECK:STDOUT: }
  164. // CHECK:STDOUT:
  165. // CHECK:STDOUT: class @Derived {
  166. // CHECK:STDOUT: %Base.ref: %Base.type = name_ref Base, file.%Base.decl [template = constants.%Base.generic]
  167. // CHECK:STDOUT: %Param.ref: type = name_ref Param, file.%Param.decl [template = constants.%Param]
  168. // CHECK:STDOUT: %Base: type = class_type @Base, @Base(constants.%Param) [template = constants.%Base.cc4]
  169. // CHECK:STDOUT: %.loc13: %Derived.elem = base_decl %Base, element0 [template]
  170. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.base.d47 [template = constants.%complete_type.08e]
  171. // CHECK:STDOUT:
  172. // CHECK:STDOUT: !members:
  173. // CHECK:STDOUT: .Self = constants.%Derived
  174. // CHECK:STDOUT: .base = %.loc13
  175. // CHECK:STDOUT: extend %Base
  176. // CHECK:STDOUT: complete_type_witness = %complete_type
  177. // CHECK:STDOUT: }
  178. // CHECK:STDOUT:
  179. // CHECK:STDOUT: fn @DoubleFieldAccess(%d.param_patt: %Derived) -> %i32 {
  180. // CHECK:STDOUT: !entry:
  181. // CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d
  182. // CHECK:STDOUT: %x.ref: %Base.elem.8c2 = name_ref x, @Base.%.loc5 [template = @Base.%.loc5]
  183. // CHECK:STDOUT: %.loc17_11.1: ref %Base.cc4 = class_element_access %d.ref, element0
  184. // CHECK:STDOUT: %.loc17_11.2: ref %Base.cc4 = converted %d.ref, %.loc17_11.1
  185. // CHECK:STDOUT: %.loc17_11.3: ref %Param = class_element_access %.loc17_11.2, element0
  186. // CHECK:STDOUT: %y.ref: %Param.elem = name_ref y, @Param.%.loc9 [template = @Param.%.loc9]
  187. // CHECK:STDOUT: %.loc17_13.1: ref %i32 = class_element_access %.loc17_11.3, element0
  188. // CHECK:STDOUT: %.loc17_13.2: %i32 = bind_value %.loc17_13.1
  189. // CHECK:STDOUT: return %.loc17_13.2
  190. // CHECK:STDOUT: }
  191. // CHECK:STDOUT:
  192. // CHECK:STDOUT: specific @Base(constants.%T) {
  193. // CHECK:STDOUT: %T.loc4_17.2 => constants.%T
  194. // CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%T
  195. // CHECK:STDOUT: }
  196. // CHECK:STDOUT:
  197. // CHECK:STDOUT: specific @Base(%T.loc4_17.2) {}
  198. // CHECK:STDOUT:
  199. // CHECK:STDOUT: specific @Base(constants.%Param) {
  200. // CHECK:STDOUT: %T.loc4_17.2 => constants.%Param
  201. // CHECK:STDOUT: %T.patt.loc4_17.2 => constants.%Param
  202. // CHECK:STDOUT:
  203. // CHECK:STDOUT: !definition:
  204. // CHECK:STDOUT: %require_complete => constants.%complete_type.5e2
  205. // CHECK:STDOUT: %Base => constants.%Base.cc4
  206. // CHECK:STDOUT: %Base.elem => constants.%Base.elem.8c2
  207. // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.975
  208. // CHECK:STDOUT: %complete_type.loc6_1.2 => constants.%complete_type.db3
  209. // CHECK:STDOUT: }
  210. // CHECK:STDOUT:
  211. // CHECK:STDOUT: --- import.carbon
  212. // CHECK:STDOUT:
  213. // CHECK:STDOUT: constants {
  214. // CHECK:STDOUT: %Derived: type = class_type @Derived [template]
  215. // CHECK:STDOUT: %Param: type = class_type @Param [template]
  216. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  217. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  218. // CHECK:STDOUT: %struct_type.y: type = struct_type {.y: %i32} [template]
  219. // CHECK:STDOUT: %complete_type.a2b: <witness> = complete_type_witness %struct_type.y [template]
  220. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  221. // CHECK:STDOUT: %struct_type.x.710: type = struct_type {.x: %T} [symbolic]
  222. // CHECK:STDOUT: %complete_type.60a: <witness> = complete_type_witness %struct_type.x.710 [symbolic]
  223. // CHECK:STDOUT: %Base.5e4: type = class_type @Base, @Base(%T) [symbolic]
  224. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  225. // CHECK:STDOUT: %Base.802: type = class_type @Base, @Base(%Param) [template]
  226. // CHECK:STDOUT: %struct_type.base.875: type = struct_type {.base: %Base.802} [template]
  227. // CHECK:STDOUT: %complete_type.868: <witness> = complete_type_witness %struct_type.base.875 [template]
  228. // CHECK:STDOUT: %require_complete.db1: <witness> = require_complete_type %T [symbolic]
  229. // CHECK:STDOUT: %Base.elem.ace: type = unbound_element_type %Base.5e4, %T [symbolic]
  230. // CHECK:STDOUT: %Base.elem.815: type = unbound_element_type %Base.802, %Param [template]
  231. // CHECK:STDOUT: %struct_type.x.975: type = struct_type {.x: %Param} [template]
  232. // CHECK:STDOUT: %complete_type.db3: <witness> = complete_type_witness %struct_type.x.975 [template]
  233. // CHECK:STDOUT: %ImportedDoubleFieldAccess.type: type = fn_type @ImportedDoubleFieldAccess [template]
  234. // CHECK:STDOUT: %ImportedDoubleFieldAccess: %ImportedDoubleFieldAccess.type = struct_value () [template]
  235. // CHECK:STDOUT: %Param.elem: type = unbound_element_type %Param, %i32 [template]
  236. // CHECK:STDOUT: }
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: imports {
  239. // CHECK:STDOUT: %import_ref.210 = import_ref Main//extend_generic_base, Base, unloaded
  240. // CHECK:STDOUT: %import_ref.877 = import_ref Main//extend_generic_base, Param, unloaded
  241. // CHECK:STDOUT: %import_ref.502: type = import_ref Main//extend_generic_base, Derived, loaded [template = constants.%Derived]
  242. // CHECK:STDOUT: %import_ref.ac8 = import_ref Main//extend_generic_base, DoubleFieldAccess, unloaded
  243. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  244. // CHECK:STDOUT: .Int = %import_ref.d69
  245. // CHECK:STDOUT: import Core//prelude
  246. // CHECK:STDOUT: import Core//prelude/...
  247. // CHECK:STDOUT: }
  248. // CHECK:STDOUT: %import_ref.f46: <witness> = import_ref Main//extend_generic_base, loc10_1, loaded [template = constants.%complete_type.a2b]
  249. // CHECK:STDOUT: %import_ref.446 = import_ref Main//extend_generic_base, inst42 [no loc], unloaded
  250. // CHECK:STDOUT: %import_ref.c4e: %Param.elem = import_ref Main//extend_generic_base, loc9_8, loaded [template = %.7d9]
  251. // CHECK:STDOUT: %import_ref.3ee: <witness> = import_ref Main//extend_generic_base, loc6_1, loaded [symbolic = @Base.%complete_type (constants.%complete_type.60a)]
  252. // CHECK:STDOUT: %import_ref.a6b = import_ref Main//extend_generic_base, inst27 [no loc], unloaded
  253. // CHECK:STDOUT: %import_ref.8be: @Base.%Base.elem (%Base.elem.ace) = import_ref Main//extend_generic_base, loc5_8, loaded [template = %.9ad]
  254. // CHECK:STDOUT: %import_ref.696: <witness> = import_ref Main//extend_generic_base, loc14_1, loaded [template = constants.%complete_type.868]
  255. // CHECK:STDOUT: %import_ref.f6c = import_ref Main//extend_generic_base, inst76 [no loc], unloaded
  256. // CHECK:STDOUT: %import_ref.626 = import_ref Main//extend_generic_base, loc13_27, unloaded
  257. // CHECK:STDOUT: %import_ref.6c6788.2: type = import_ref Main//extend_generic_base, loc13_26, loaded [template = constants.%Base.802]
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT:
  260. // CHECK:STDOUT: file {
  261. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  262. // CHECK:STDOUT: .Base = imports.%import_ref.210
  263. // CHECK:STDOUT: .Param = imports.%import_ref.877
  264. // CHECK:STDOUT: .Derived = imports.%import_ref.502
  265. // CHECK:STDOUT: .DoubleFieldAccess = imports.%import_ref.ac8
  266. // CHECK:STDOUT: .Core = imports.%Core
  267. // CHECK:STDOUT: .ImportedDoubleFieldAccess = %ImportedDoubleFieldAccess.decl
  268. // CHECK:STDOUT: }
  269. // CHECK:STDOUT: %Core.import = import Core
  270. // CHECK:STDOUT: %default.import = import <invalid>
  271. // CHECK:STDOUT: %ImportedDoubleFieldAccess.decl: %ImportedDoubleFieldAccess.type = fn_decl @ImportedDoubleFieldAccess [template = constants.%ImportedDoubleFieldAccess] {
  272. // CHECK:STDOUT: %d.patt: %Derived = binding_pattern d
  273. // CHECK:STDOUT: %d.param_patt: %Derived = value_param_pattern %d.patt, runtime_param0
  274. // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
  275. // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1
  276. // CHECK:STDOUT: } {
  277. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  278. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  279. // CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0
  280. // CHECK:STDOUT: %Derived.ref: type = name_ref Derived, imports.%import_ref.502 [template = constants.%Derived]
  281. // CHECK:STDOUT: %d: %Derived = bind_name d, %d.param
  282. // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
  283. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  284. // CHECK:STDOUT: }
  285. // CHECK:STDOUT: }
  286. // CHECK:STDOUT:
  287. // CHECK:STDOUT: class @Derived [from "extend_generic_base.carbon"] {
  288. // CHECK:STDOUT: !members:
  289. // CHECK:STDOUT: .Self = imports.%import_ref.f6c
  290. // CHECK:STDOUT: .base = imports.%import_ref.626
  291. // CHECK:STDOUT: extend imports.%import_ref.6c6788.2
  292. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.696
  293. // CHECK:STDOUT: }
  294. // CHECK:STDOUT:
  295. // CHECK:STDOUT: class @Param [from "extend_generic_base.carbon"] {
  296. // CHECK:STDOUT: !members:
  297. // CHECK:STDOUT: .Self = imports.%import_ref.446
  298. // CHECK:STDOUT: .y = imports.%import_ref.c4e
  299. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.f46
  300. // CHECK:STDOUT: }
  301. // CHECK:STDOUT:
  302. // CHECK:STDOUT: generic class @Base(constants.%T: type) [from "extend_generic_base.carbon"] {
  303. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  304. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
  305. // CHECK:STDOUT:
  306. // CHECK:STDOUT: !definition:
  307. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Base.%T (%T) [symbolic = %require_complete (constants.%require_complete.db1)]
  308. // CHECK:STDOUT: %Base: type = class_type @Base, @Base(%T) [symbolic = %Base (constants.%Base.5e4)]
  309. // CHECK:STDOUT: %Base.elem: type = unbound_element_type @Base.%Base (%Base.5e4), @Base.%T (%T) [symbolic = %Base.elem (constants.%Base.elem.ace)]
  310. // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: @Base.%T (%T)} [symbolic = %struct_type.x (constants.%struct_type.x.710)]
  311. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness @Base.%struct_type.x (%struct_type.x.710) [symbolic = %complete_type (constants.%complete_type.60a)]
  312. // CHECK:STDOUT:
  313. // CHECK:STDOUT: class {
  314. // CHECK:STDOUT: !members:
  315. // CHECK:STDOUT: .Self = imports.%import_ref.a6b
  316. // CHECK:STDOUT: .x = imports.%import_ref.8be
  317. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.3ee
  318. // CHECK:STDOUT: }
  319. // CHECK:STDOUT: }
  320. // CHECK:STDOUT:
  321. // CHECK:STDOUT: fn @ImportedDoubleFieldAccess(%d.param_patt: %Derived) -> %i32 {
  322. // CHECK:STDOUT: !entry:
  323. // CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d
  324. // CHECK:STDOUT: %x.ref: %Base.elem.815 = name_ref x, imports.%import_ref.8be [template = imports.%.9ad]
  325. // CHECK:STDOUT: %.loc7_11.1: ref %Base.802 = class_element_access %d.ref, element0
  326. // CHECK:STDOUT: %.loc7_11.2: ref %Base.802 = converted %d.ref, %.loc7_11.1
  327. // CHECK:STDOUT: %.loc7_11.3: ref %Param = class_element_access %.loc7_11.2, element0
  328. // CHECK:STDOUT: %y.ref: %Param.elem = name_ref y, imports.%import_ref.c4e [template = imports.%.7d9]
  329. // CHECK:STDOUT: %.loc7_13.1: ref %i32 = class_element_access %.loc7_11.3, element0
  330. // CHECK:STDOUT: %.loc7_13.2: %i32 = bind_value %.loc7_13.1
  331. // CHECK:STDOUT: return %.loc7_13.2
  332. // CHECK:STDOUT: }
  333. // CHECK:STDOUT:
  334. // CHECK:STDOUT: specific @Base(constants.%T) {
  335. // CHECK:STDOUT: %T => constants.%T
  336. // CHECK:STDOUT: %T.patt => constants.%T
  337. // CHECK:STDOUT: }
  338. // CHECK:STDOUT:
  339. // CHECK:STDOUT: specific @Base(constants.%Param) {
  340. // CHECK:STDOUT: %T => constants.%Param
  341. // CHECK:STDOUT: %T.patt => constants.%Param
  342. // CHECK:STDOUT:
  343. // CHECK:STDOUT: !definition:
  344. // CHECK:STDOUT: %require_complete => constants.%complete_type.a2b
  345. // CHECK:STDOUT: %Base => constants.%Base.802
  346. // CHECK:STDOUT: %Base.elem => constants.%Base.elem.815
  347. // CHECK:STDOUT: %struct_type.x => constants.%struct_type.x.975
  348. // CHECK:STDOUT: %complete_type => constants.%complete_type.db3
  349. // CHECK:STDOUT: }
  350. // CHECK:STDOUT:
  351. // CHECK:STDOUT: specific @Base(%T) {}
  352. // CHECK:STDOUT:
  353. // CHECK:STDOUT: --- fail_todo_extend_symbolic_base.carbon
  354. // CHECK:STDOUT:
  355. // CHECK:STDOUT: constants {
  356. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  357. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  358. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  359. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  360. // CHECK:STDOUT: %C.37e: type = class_type @C, @C(%T) [symbolic]
  361. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T [symbolic]
  362. // CHECK:STDOUT: %X: type = class_type @X [template]
  363. // CHECK:STDOUT: %G.type: type = fn_type @G [template]
  364. // CHECK:STDOUT: %G: %G.type = struct_value () [template]
  365. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  366. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  367. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  368. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  369. // CHECK:STDOUT: %C.f9e: type = class_type @C, @C(%X) [template]
  370. // CHECK:STDOUT: }
  371. // CHECK:STDOUT:
  372. // CHECK:STDOUT: imports {
  373. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  374. // CHECK:STDOUT: import Core//prelude
  375. // CHECK:STDOUT: import Core//prelude/...
  376. // CHECK:STDOUT: }
  377. // CHECK:STDOUT: }
  378. // CHECK:STDOUT:
  379. // CHECK:STDOUT: file {
  380. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  381. // CHECK:STDOUT: .Core = imports.%Core
  382. // CHECK:STDOUT: .C = %C.decl
  383. // CHECK:STDOUT: .X = %X.decl
  384. // CHECK:STDOUT: .F = %F.decl
  385. // CHECK:STDOUT: }
  386. // CHECK:STDOUT: %Core.import = import Core
  387. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] {
  388. // CHECK:STDOUT: %T.patt.loc4_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt)]
  389. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_9.1, runtime_param<invalid> [symbolic = %T.patt.loc4_9.2 (constants.%T.patt)]
  390. // CHECK:STDOUT: } {
  391. // CHECK:STDOUT: %T.param: type = value_param runtime_param<invalid>
  392. // CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_9.2 (constants.%T)]
  393. // CHECK:STDOUT: }
  394. // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {}
  395. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {}
  396. // CHECK:STDOUT: }
  397. // CHECK:STDOUT:
  398. // CHECK:STDOUT: generic class @C(%T.loc4_9.1: type) {
  399. // CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T)]
  400. // CHECK:STDOUT: %T.patt.loc4_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt)]
  401. // CHECK:STDOUT:
  402. // CHECK:STDOUT: !definition:
  403. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @C.%T.loc4_9.2 (%T) [symbolic = %require_complete (constants.%require_complete)]
  404. // CHECK:STDOUT:
  405. // CHECK:STDOUT: class {
  406. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_9.1 [symbolic = %T.loc4_9.2 (constants.%T)]
  407. // CHECK:STDOUT: %.loc8: <error> = base_decl <error>, element0 [template]
  408. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness <error> [template = <error>]
  409. // CHECK:STDOUT:
  410. // CHECK:STDOUT: !members:
  411. // CHECK:STDOUT: .Self = constants.%C.37e
  412. // CHECK:STDOUT: .base = %.loc8
  413. // CHECK:STDOUT: has_error
  414. // CHECK:STDOUT: complete_type_witness = %complete_type
  415. // CHECK:STDOUT: }
  416. // CHECK:STDOUT: }
  417. // CHECK:STDOUT:
  418. // CHECK:STDOUT: class @X {
  419. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} {}
  420. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  421. // CHECK:STDOUT:
  422. // CHECK:STDOUT: !members:
  423. // CHECK:STDOUT: .Self = constants.%X
  424. // CHECK:STDOUT: .G = %G.decl
  425. // CHECK:STDOUT: complete_type_witness = %complete_type
  426. // CHECK:STDOUT: }
  427. // CHECK:STDOUT:
  428. // CHECK:STDOUT: fn @G() {
  429. // CHECK:STDOUT: !entry:
  430. // CHECK:STDOUT: return
  431. // CHECK:STDOUT: }
  432. // CHECK:STDOUT:
  433. // CHECK:STDOUT: fn @F() {
  434. // CHECK:STDOUT: !entry:
  435. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic]
  436. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [template = constants.%X]
  437. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%X) [template = constants.%C.f9e]
  438. // CHECK:STDOUT: %G.ref: <error> = name_ref G, <error> [template = <error>]
  439. // CHECK:STDOUT: return
  440. // CHECK:STDOUT: }
  441. // CHECK:STDOUT:
  442. // CHECK:STDOUT: specific @C(constants.%T) {
  443. // CHECK:STDOUT: %T.loc4_9.2 => constants.%T
  444. // CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T
  445. // CHECK:STDOUT: }
  446. // CHECK:STDOUT:
  447. // CHECK:STDOUT: specific @C(constants.%X) {
  448. // CHECK:STDOUT: %T.loc4_9.2 => constants.%X
  449. // CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%X
  450. // CHECK:STDOUT:
  451. // CHECK:STDOUT: !definition:
  452. // CHECK:STDOUT: %require_complete => constants.%complete_type
  453. // CHECK:STDOUT: }
  454. // CHECK:STDOUT:
  455. // CHECK:STDOUT: --- extend_generic_symbolic_base.carbon
  456. // CHECK:STDOUT:
  457. // CHECK:STDOUT: constants {
  458. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  459. // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic]
  460. // CHECK:STDOUT: %X.type: type = generic_class_type @X [template]
  461. // CHECK:STDOUT: %X.generic: %X.type = struct_value () [template]
  462. // CHECK:STDOUT: %X.847: type = class_type @X, @X(%U) [symbolic]
  463. // CHECK:STDOUT: %G.type.9e7: type = fn_type @G, @X(%U) [symbolic]
  464. // CHECK:STDOUT: %G.ca3: %G.type.9e7 = struct_value () [symbolic]
  465. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  466. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  467. // CHECK:STDOUT: %require_complete.427: <witness> = require_complete_type %U [symbolic]
  468. // CHECK:STDOUT: %G.specific_fn.a95: <specific function> = specific_function %G.ca3, @G(%U) [symbolic]
  469. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  470. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  471. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  472. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  473. // CHECK:STDOUT: %C.37e: type = class_type @C, @C(%T) [symbolic]
  474. // CHECK:STDOUT: %X.643: type = class_type @X, @X(%T) [symbolic]
  475. // CHECK:STDOUT: %G.type.709: type = fn_type @G, @X(%T) [symbolic]
  476. // CHECK:STDOUT: %G.0f4: %G.type.709 = struct_value () [symbolic]
  477. // CHECK:STDOUT: %require_complete.c56: <witness> = require_complete_type %X.643 [symbolic]
  478. // CHECK:STDOUT: %C.elem.513: type = unbound_element_type %C.37e, %X.643 [symbolic]
  479. // CHECK:STDOUT: %struct_type.base.8ef: type = struct_type {.base: %X.643} [symbolic]
  480. // CHECK:STDOUT: %complete_type.bbc: <witness> = complete_type_witness %struct_type.base.8ef [symbolic]
  481. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  482. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  483. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  484. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  485. // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template]
  486. // CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [template]
  487. // CHECK:STDOUT: %C.268: type = class_type @C, @C(%i32) [template]
  488. // CHECK:STDOUT: %X.05f: type = class_type @X, @X(%i32) [template]
  489. // CHECK:STDOUT: %G.type.d5e: type = fn_type @G, @X(%i32) [template]
  490. // CHECK:STDOUT: %G.842: %G.type.d5e = struct_value () [template]
  491. // CHECK:STDOUT: %C.elem.610: type = unbound_element_type %C.268, %X.05f [template]
  492. // CHECK:STDOUT: %struct_type.base.00d: type = struct_type {.base: %X.05f} [template]
  493. // CHECK:STDOUT: %complete_type.b69: <witness> = complete_type_witness %struct_type.base.00d [template]
  494. // CHECK:STDOUT: %G.specific_fn.af5: <specific function> = specific_function %G.842, @G(%i32) [template]
  495. // CHECK:STDOUT: }
  496. // CHECK:STDOUT:
  497. // CHECK:STDOUT: imports {
  498. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  499. // CHECK:STDOUT: .Int = %import_ref.187
  500. // CHECK:STDOUT: import Core//prelude
  501. // CHECK:STDOUT: import Core//prelude/...
  502. // CHECK:STDOUT: }
  503. // CHECK:STDOUT: }
  504. // CHECK:STDOUT:
  505. // CHECK:STDOUT: file {
  506. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  507. // CHECK:STDOUT: .Core = imports.%Core
  508. // CHECK:STDOUT: .X = %X.decl
  509. // CHECK:STDOUT: .C = %C.decl
  510. // CHECK:STDOUT: .F = %F.decl
  511. // CHECK:STDOUT: }
  512. // CHECK:STDOUT: %Core.import = import Core
  513. // CHECK:STDOUT: %X.decl: %X.type = class_decl @X [template = constants.%X.generic] {
  514. // CHECK:STDOUT: %U.patt.loc4_14.1: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc4_14.2 (constants.%U.patt)]
  515. // CHECK:STDOUT: %U.param_patt: type = value_param_pattern %U.patt.loc4_14.1, runtime_param<invalid> [symbolic = %U.patt.loc4_14.2 (constants.%U.patt)]
  516. // CHECK:STDOUT: } {
  517. // CHECK:STDOUT: %U.param: type = value_param runtime_param<invalid>
  518. // CHECK:STDOUT: %U.loc4_14.1: type = bind_symbolic_name U, 0, %U.param [symbolic = %U.loc4_14.2 (constants.%U)]
  519. // CHECK:STDOUT: }
  520. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] {
  521. // CHECK:STDOUT: %T.patt.loc8_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_9.2 (constants.%T.patt)]
  522. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc8_9.1, runtime_param<invalid> [symbolic = %T.patt.loc8_9.2 (constants.%T.patt)]
  523. // CHECK:STDOUT: } {
  524. // CHECK:STDOUT: %T.param: type = value_param runtime_param<invalid>
  525. // CHECK:STDOUT: %T.loc8_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc8_9.2 (constants.%T)]
  526. // CHECK:STDOUT: }
  527. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {}
  528. // CHECK:STDOUT: }
  529. // CHECK:STDOUT:
  530. // CHECK:STDOUT: generic class @X(%U.loc4_14.1: type) {
  531. // CHECK:STDOUT: %U.loc4_14.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc4_14.2 (constants.%U)]
  532. // CHECK:STDOUT: %U.patt.loc4_14.2: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc4_14.2 (constants.%U.patt)]
  533. // CHECK:STDOUT:
  534. // CHECK:STDOUT: !definition:
  535. // CHECK:STDOUT: %G.type: type = fn_type @G, @X(%U.loc4_14.2) [symbolic = %G.type (constants.%G.type.9e7)]
  536. // CHECK:STDOUT: %G: @X.%G.type (%G.type.9e7) = struct_value () [symbolic = %G (constants.%G.ca3)]
  537. // CHECK:STDOUT:
  538. // CHECK:STDOUT: class {
  539. // CHECK:STDOUT: %G.decl: @X.%G.type (%G.type.9e7) = fn_decl @G [symbolic = @X.%G (constants.%G.ca3)] {
  540. // CHECK:STDOUT: %return.patt: @G.%U (%U) = return_slot_pattern
  541. // CHECK:STDOUT: %return.param_patt: @G.%U (%U) = out_param_pattern %return.patt, runtime_param0
  542. // CHECK:STDOUT: } {
  543. // CHECK:STDOUT: %U.ref: type = name_ref U, @X.%U.loc4_14.1 [symbolic = %U (constants.%U)]
  544. // CHECK:STDOUT: %return.param: ref @G.%U (%U) = out_param runtime_param0
  545. // CHECK:STDOUT: %return: ref @G.%U (%U) = return_slot %return.param
  546. // CHECK:STDOUT: }
  547. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  548. // CHECK:STDOUT:
  549. // CHECK:STDOUT: !members:
  550. // CHECK:STDOUT: .Self = constants.%X.847
  551. // CHECK:STDOUT: .G = %G.decl
  552. // CHECK:STDOUT: complete_type_witness = %complete_type
  553. // CHECK:STDOUT: }
  554. // CHECK:STDOUT: }
  555. // CHECK:STDOUT:
  556. // CHECK:STDOUT: generic class @C(%T.loc8_9.1: type) {
  557. // CHECK:STDOUT: %T.loc8_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc8_9.2 (constants.%T)]
  558. // CHECK:STDOUT: %T.patt.loc8_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc8_9.2 (constants.%T.patt)]
  559. // CHECK:STDOUT:
  560. // CHECK:STDOUT: !definition:
  561. // CHECK:STDOUT: %X.loc9_19.2: type = class_type @X, @X(%T.loc8_9.2) [symbolic = %X.loc9_19.2 (constants.%X.643)]
  562. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @C.%X.loc9_19.2 (%X.643) [symbolic = %require_complete (constants.%require_complete.c56)]
  563. // CHECK:STDOUT: %C: type = class_type @C, @C(%T.loc8_9.2) [symbolic = %C (constants.%C.37e)]
  564. // CHECK:STDOUT: %C.elem: type = unbound_element_type @C.%C (%C.37e), @C.%X.loc9_19.2 (%X.643) [symbolic = %C.elem (constants.%C.elem.513)]
  565. // CHECK:STDOUT: %struct_type.base: type = struct_type {.base: @C.%X.loc9_19.2 (%X.643)} [symbolic = %struct_type.base (constants.%struct_type.base.8ef)]
  566. // CHECK:STDOUT: %complete_type.loc10_1.2: <witness> = complete_type_witness @C.%struct_type.base (%struct_type.base.8ef) [symbolic = %complete_type.loc10_1.2 (constants.%complete_type.bbc)]
  567. // CHECK:STDOUT:
  568. // CHECK:STDOUT: class {
  569. // CHECK:STDOUT: %X.ref: %X.type = name_ref X, file.%X.decl [template = constants.%X.generic]
  570. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8_9.1 [symbolic = %T.loc8_9.2 (constants.%T)]
  571. // CHECK:STDOUT: %X.loc9_19.1: type = class_type @X, @X(constants.%T) [symbolic = %X.loc9_19.2 (constants.%X.643)]
  572. // CHECK:STDOUT: %.loc9: @C.%C.elem (%C.elem.513) = base_decl %X.loc9_19.1, element0 [template]
  573. // CHECK:STDOUT: %complete_type.loc10_1.1: <witness> = complete_type_witness %struct_type.base.8ef [symbolic = %complete_type.loc10_1.2 (constants.%complete_type.bbc)]
  574. // CHECK:STDOUT:
  575. // CHECK:STDOUT: !members:
  576. // CHECK:STDOUT: .Self = constants.%C.37e
  577. // CHECK:STDOUT: .base = %.loc9
  578. // CHECK:STDOUT: extend %X.loc9_19.1
  579. // CHECK:STDOUT: complete_type_witness = %complete_type.loc10_1.1
  580. // CHECK:STDOUT: }
  581. // CHECK:STDOUT: }
  582. // CHECK:STDOUT:
  583. // CHECK:STDOUT: generic fn @G(@X.%U.loc4_14.1: type) {
  584. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  585. // CHECK:STDOUT:
  586. // CHECK:STDOUT: !definition:
  587. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @G.%U (%U) [symbolic = %require_complete (constants.%require_complete.427)]
  588. // CHECK:STDOUT: %G.type: type = fn_type @G, @X(%U) [symbolic = %G.type (constants.%G.type.9e7)]
  589. // CHECK:STDOUT: %G: @G.%G.type (%G.type.9e7) = struct_value () [symbolic = %G (constants.%G.ca3)]
  590. // CHECK:STDOUT: %G.specific_fn.loc5_24.2: <specific function> = specific_function %G, @G(%U) [symbolic = %G.specific_fn.loc5_24.2 (constants.%G.specific_fn.a95)]
  591. // CHECK:STDOUT:
  592. // CHECK:STDOUT: fn() -> @G.%U (%U) {
  593. // CHECK:STDOUT: !entry:
  594. // CHECK:STDOUT: %.loc5_24: @G.%G.type (%G.type.9e7) = specific_constant @X.%G.decl, @X(constants.%U) [symbolic = %G (constants.%G.ca3)]
  595. // CHECK:STDOUT: %G.ref: @G.%G.type (%G.type.9e7) = name_ref G, %.loc5_24 [symbolic = %G (constants.%G.ca3)]
  596. // CHECK:STDOUT: %G.specific_fn.loc5_24.1: <specific function> = specific_function %G.ref, @G(constants.%U) [symbolic = %G.specific_fn.loc5_24.2 (constants.%G.specific_fn.a95)]
  597. // CHECK:STDOUT: %G.call: init @G.%U (%U) = call %G.specific_fn.loc5_24.1()
  598. // CHECK:STDOUT: %.loc5_27.1: @G.%U (%U) = value_of_initializer %G.call
  599. // CHECK:STDOUT: %.loc5_27.2: @G.%U (%U) = converted %G.call, %.loc5_27.1
  600. // CHECK:STDOUT: return %.loc5_27.2
  601. // CHECK:STDOUT: }
  602. // CHECK:STDOUT: }
  603. // CHECK:STDOUT:
  604. // CHECK:STDOUT: fn @F() {
  605. // CHECK:STDOUT: !entry:
  606. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic]
  607. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  608. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  609. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [template = constants.%C.268]
  610. // CHECK:STDOUT: %.loc13_22: %G.type.d5e = specific_constant @X.%G.decl, @X(constants.%i32) [template = constants.%G.842]
  611. // CHECK:STDOUT: %G.ref: %G.type.d5e = name_ref G, %.loc13_22 [template = constants.%G.842]
  612. // CHECK:STDOUT: %G.specific_fn: <specific function> = specific_function %G.ref, @G(constants.%i32) [template = constants.%G.specific_fn.af5]
  613. // CHECK:STDOUT: %G.call: init %i32 = call %G.specific_fn()
  614. // CHECK:STDOUT: %.loc13_26.1: %i32 = value_of_initializer %G.call
  615. // CHECK:STDOUT: %.loc13_26.2: %i32 = converted %G.call, %.loc13_26.1
  616. // CHECK:STDOUT: %i: %i32 = bind_name i, %.loc13_26.2
  617. // CHECK:STDOUT: return
  618. // CHECK:STDOUT: }
  619. // CHECK:STDOUT:
  620. // CHECK:STDOUT: specific @X(constants.%U) {
  621. // CHECK:STDOUT: %U.loc4_14.2 => constants.%U
  622. // CHECK:STDOUT: %U.patt.loc4_14.2 => constants.%U
  623. // CHECK:STDOUT:
  624. // CHECK:STDOUT: !definition:
  625. // CHECK:STDOUT: %G.type => constants.%G.type.9e7
  626. // CHECK:STDOUT: %G => constants.%G.ca3
  627. // CHECK:STDOUT: }
  628. // CHECK:STDOUT:
  629. // CHECK:STDOUT: specific @G(constants.%U) {
  630. // CHECK:STDOUT: %U => constants.%U
  631. // CHECK:STDOUT:
  632. // CHECK:STDOUT: !definition:
  633. // CHECK:STDOUT: %require_complete => constants.%require_complete.427
  634. // CHECK:STDOUT: %G.type => constants.%G.type.9e7
  635. // CHECK:STDOUT: %G => constants.%G.ca3
  636. // CHECK:STDOUT: %G.specific_fn.loc5_24.2 => constants.%G.specific_fn.a95
  637. // CHECK:STDOUT: }
  638. // CHECK:STDOUT:
  639. // CHECK:STDOUT: specific @X(%U.loc4_14.2) {}
  640. // CHECK:STDOUT:
  641. // CHECK:STDOUT: specific @X(@G.%U) {}
  642. // CHECK:STDOUT:
  643. // CHECK:STDOUT: specific @G(%U) {}
  644. // CHECK:STDOUT:
  645. // CHECK:STDOUT: specific @C(constants.%T) {
  646. // CHECK:STDOUT: %T.loc8_9.2 => constants.%T
  647. // CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%T
  648. // CHECK:STDOUT: }
  649. // CHECK:STDOUT:
  650. // CHECK:STDOUT: specific @X(constants.%T) {
  651. // CHECK:STDOUT: %U.loc4_14.2 => constants.%T
  652. // CHECK:STDOUT: %U.patt.loc4_14.2 => constants.%T
  653. // CHECK:STDOUT:
  654. // CHECK:STDOUT: !definition:
  655. // CHECK:STDOUT: %G.type => constants.%G.type.709
  656. // CHECK:STDOUT: %G => constants.%G.0f4
  657. // CHECK:STDOUT: }
  658. // CHECK:STDOUT:
  659. // CHECK:STDOUT: specific @X(@C.%T.loc8_9.2) {}
  660. // CHECK:STDOUT:
  661. // CHECK:STDOUT: specific @C(%T.loc8_9.2) {}
  662. // CHECK:STDOUT:
  663. // CHECK:STDOUT: specific @C(constants.%i32) {
  664. // CHECK:STDOUT: %T.loc8_9.2 => constants.%i32
  665. // CHECK:STDOUT: %T.patt.loc8_9.2 => constants.%i32
  666. // CHECK:STDOUT:
  667. // CHECK:STDOUT: !definition:
  668. // CHECK:STDOUT: %X.loc9_19.2 => constants.%X.05f
  669. // CHECK:STDOUT: %require_complete => constants.%complete_type.357
  670. // CHECK:STDOUT: %C => constants.%C.268
  671. // CHECK:STDOUT: %C.elem => constants.%C.elem.610
  672. // CHECK:STDOUT: %struct_type.base => constants.%struct_type.base.00d
  673. // CHECK:STDOUT: %complete_type.loc10_1.2 => constants.%complete_type.b69
  674. // CHECK:STDOUT: }
  675. // CHECK:STDOUT:
  676. // CHECK:STDOUT: specific @X(constants.%i32) {
  677. // CHECK:STDOUT: %U.loc4_14.2 => constants.%i32
  678. // CHECK:STDOUT: %U.patt.loc4_14.2 => constants.%i32
  679. // CHECK:STDOUT:
  680. // CHECK:STDOUT: !definition:
  681. // CHECK:STDOUT: %G.type => constants.%G.type.d5e
  682. // CHECK:STDOUT: %G => constants.%G.842
  683. // CHECK:STDOUT: }
  684. // CHECK:STDOUT:
  685. // CHECK:STDOUT: specific @G(constants.%i32) {
  686. // CHECK:STDOUT: %U => constants.%i32
  687. // CHECK:STDOUT:
  688. // CHECK:STDOUT: !definition:
  689. // CHECK:STDOUT: %require_complete => constants.%complete_type.f8a
  690. // CHECK:STDOUT: %G.type => constants.%G.type.d5e
  691. // CHECK:STDOUT: %G => constants.%G.842
  692. // CHECK:STDOUT: %G.specific_fn.loc5_24.2 => constants.%G.specific_fn.af5
  693. // CHECK:STDOUT: }
  694. // CHECK:STDOUT:
  695. // CHECK:STDOUT: --- import_extend_generic_symbolic_base.carbon
  696. // CHECK:STDOUT:
  697. // CHECK:STDOUT: constants {
  698. // CHECK:STDOUT: %H.type: type = fn_type @H [template]
  699. // CHECK:STDOUT: %H: %H.type = struct_value () [template]
  700. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  701. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  702. // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template]
  703. // CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [template]
  704. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  705. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  706. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  707. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  708. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  709. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  710. // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic]
  711. // CHECK:STDOUT: %X.ab1: type = class_type @X, @X(%T) [symbolic]
  712. // CHECK:STDOUT: %C.df4: type = class_type @C, @C(%T) [symbolic]
  713. // CHECK:STDOUT: %C.elem.b01: type = unbound_element_type %C.df4, %X.ab1 [symbolic]
  714. // CHECK:STDOUT: %struct_type.base.404: type = struct_type {.base: %X.ab1} [symbolic]
  715. // CHECK:STDOUT: %complete_type.fe7: <witness> = complete_type_witness %struct_type.base.404 [symbolic]
  716. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  717. // CHECK:STDOUT: %G.type.804: type = fn_type @G, @X(%U) [symbolic]
  718. // CHECK:STDOUT: %G.ed3: %G.type.804 = struct_value () [symbolic]
  719. // CHECK:STDOUT: %require_complete.8e8: <witness> = require_complete_type %X.ab1 [symbolic]
  720. // CHECK:STDOUT: %require_complete.427: <witness> = require_complete_type %U [symbolic]
  721. // CHECK:STDOUT: %G.specific_fn.3dd: <specific function> = specific_function %G.ed3, @G(%U) [symbolic]
  722. // CHECK:STDOUT: %G.type.aaf: type = fn_type @G, @X(%T) [symbolic]
  723. // CHECK:STDOUT: %G.ec7: %G.type.aaf = struct_value () [symbolic]
  724. // CHECK:STDOUT: %C.733: type = class_type @C, @C(%i32) [template]
  725. // CHECK:STDOUT: %X.3bf: type = class_type @X, @X(%i32) [template]
  726. // CHECK:STDOUT: %G.type.aac: type = fn_type @G, @X(%i32) [template]
  727. // CHECK:STDOUT: %G.08f: %G.type.aac = struct_value () [template]
  728. // CHECK:STDOUT: %C.elem.123: type = unbound_element_type %C.733, %X.3bf [template]
  729. // CHECK:STDOUT: %struct_type.base.1d9: type = struct_type {.base: %X.3bf} [template]
  730. // CHECK:STDOUT: %complete_type.82b: <witness> = complete_type_witness %struct_type.base.1d9 [template]
  731. // CHECK:STDOUT: %G.specific_fn.e4a: <specific function> = specific_function %G.08f, @G(%i32) [template]
  732. // CHECK:STDOUT: }
  733. // CHECK:STDOUT:
  734. // CHECK:STDOUT: imports {
  735. // CHECK:STDOUT: %import_ref.4de = import_ref Main//extend_generic_symbolic_base, X, unloaded
  736. // CHECK:STDOUT: %import_ref.26e: %C.type = import_ref Main//extend_generic_symbolic_base, C, loaded [template = constants.%C.generic]
  737. // CHECK:STDOUT: %import_ref.b07 = import_ref Main//extend_generic_symbolic_base, F, unloaded
  738. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  739. // CHECK:STDOUT: .Int = %import_ref.187
  740. // CHECK:STDOUT: import Core//prelude
  741. // CHECK:STDOUT: import Core//prelude/...
  742. // CHECK:STDOUT: }
  743. // CHECK:STDOUT: %import_ref.8f2: <witness> = import_ref Main//extend_generic_symbolic_base, loc6_1, loaded [template = constants.%complete_type.357]
  744. // CHECK:STDOUT: %import_ref.839 = import_ref Main//extend_generic_symbolic_base, inst27 [no loc], unloaded
  745. // CHECK:STDOUT: %import_ref.ba8: @X.%G.type (%G.type.804) = import_ref Main//extend_generic_symbolic_base, loc5_15, loaded [symbolic = @X.%G (constants.%G.ed3)]
  746. // CHECK:STDOUT: %import_ref.bb2: <witness> = import_ref Main//extend_generic_symbolic_base, loc10_1, loaded [symbolic = @C.%complete_type (constants.%complete_type.fe7)]
  747. // CHECK:STDOUT: %import_ref.495 = import_ref Main//extend_generic_symbolic_base, inst68 [no loc], unloaded
  748. // CHECK:STDOUT: %import_ref.004 = import_ref Main//extend_generic_symbolic_base, loc9_20, unloaded
  749. // CHECK:STDOUT: %import_ref.b59216.2: type = import_ref Main//extend_generic_symbolic_base, loc9_19, loaded [symbolic = @C.%X (constants.%X.ab1)]
  750. // CHECK:STDOUT: }
  751. // CHECK:STDOUT:
  752. // CHECK:STDOUT: file {
  753. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  754. // CHECK:STDOUT: .X = imports.%import_ref.4de
  755. // CHECK:STDOUT: .C = imports.%import_ref.26e
  756. // CHECK:STDOUT: .F = imports.%import_ref.b07
  757. // CHECK:STDOUT: .Core = imports.%Core
  758. // CHECK:STDOUT: .H = %H.decl
  759. // CHECK:STDOUT: }
  760. // CHECK:STDOUT: %Core.import = import Core
  761. // CHECK:STDOUT: %default.import = import <invalid>
  762. // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} {}
  763. // CHECK:STDOUT: }
  764. // CHECK:STDOUT:
  765. // CHECK:STDOUT: generic class @C(constants.%T: type) [from "extend_generic_symbolic_base.carbon"] {
  766. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  767. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
  768. // CHECK:STDOUT:
  769. // CHECK:STDOUT: !definition:
  770. // CHECK:STDOUT: %X: type = class_type @X, @X(%T) [symbolic = %X (constants.%X.ab1)]
  771. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @C.%X (%X.ab1) [symbolic = %require_complete (constants.%require_complete.8e8)]
  772. // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.df4)]
  773. // CHECK:STDOUT: %C.elem: type = unbound_element_type @C.%C (%C.df4), @C.%X (%X.ab1) [symbolic = %C.elem (constants.%C.elem.b01)]
  774. // CHECK:STDOUT: %struct_type.base: type = struct_type {.base: @C.%X (%X.ab1)} [symbolic = %struct_type.base (constants.%struct_type.base.404)]
  775. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness @C.%struct_type.base (%struct_type.base.404) [symbolic = %complete_type (constants.%complete_type.fe7)]
  776. // CHECK:STDOUT:
  777. // CHECK:STDOUT: class {
  778. // CHECK:STDOUT: !members:
  779. // CHECK:STDOUT: .Self = imports.%import_ref.495
  780. // CHECK:STDOUT: .base = imports.%import_ref.004
  781. // CHECK:STDOUT: extend imports.%import_ref.b59216.2
  782. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.bb2
  783. // CHECK:STDOUT: }
  784. // CHECK:STDOUT: }
  785. // CHECK:STDOUT:
  786. // CHECK:STDOUT: generic class @X(constants.%U: type) [from "extend_generic_symbolic_base.carbon"] {
  787. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  788. // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 0 [symbolic = %U.patt (constants.%U.patt)]
  789. // CHECK:STDOUT:
  790. // CHECK:STDOUT: !definition:
  791. // CHECK:STDOUT: %G.type: type = fn_type @G, @X(%U) [symbolic = %G.type (constants.%G.type.804)]
  792. // CHECK:STDOUT: %G: @X.%G.type (%G.type.804) = struct_value () [symbolic = %G (constants.%G.ed3)]
  793. // CHECK:STDOUT:
  794. // CHECK:STDOUT: class {
  795. // CHECK:STDOUT: !members:
  796. // CHECK:STDOUT: .Self = imports.%import_ref.839
  797. // CHECK:STDOUT: .G = imports.%import_ref.ba8
  798. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.8f2
  799. // CHECK:STDOUT: }
  800. // CHECK:STDOUT: }
  801. // CHECK:STDOUT:
  802. // CHECK:STDOUT: fn @H() {
  803. // CHECK:STDOUT: !entry:
  804. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.26e [template = constants.%C.generic]
  805. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  806. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  807. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%i32) [template = constants.%C.733]
  808. // CHECK:STDOUT: %.loc7_22: %G.type.aac = specific_constant imports.%import_ref.ba8, @X(constants.%i32) [template = constants.%G.08f]
  809. // CHECK:STDOUT: %G.ref: %G.type.aac = name_ref G, %.loc7_22 [template = constants.%G.08f]
  810. // CHECK:STDOUT: %G.specific_fn: <specific function> = specific_function %G.ref, @G(constants.%i32) [template = constants.%G.specific_fn.e4a]
  811. // CHECK:STDOUT: %G.call: init %i32 = call %G.specific_fn()
  812. // CHECK:STDOUT: %.loc7_26.1: %i32 = value_of_initializer %G.call
  813. // CHECK:STDOUT: %.loc7_26.2: %i32 = converted %G.call, %.loc7_26.1
  814. // CHECK:STDOUT: %j: %i32 = bind_name j, %.loc7_26.2
  815. // CHECK:STDOUT: return
  816. // CHECK:STDOUT: }
  817. // CHECK:STDOUT:
  818. // CHECK:STDOUT: generic fn @G(constants.%U: type) [from "extend_generic_symbolic_base.carbon"] {
  819. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  820. // CHECK:STDOUT:
  821. // CHECK:STDOUT: !definition:
  822. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @G.%U (%U) [symbolic = %require_complete (constants.%require_complete.427)]
  823. // CHECK:STDOUT: %G.type: type = fn_type @G, @X(%U) [symbolic = %G.type (constants.%G.type.804)]
  824. // CHECK:STDOUT: %G: @G.%G.type (%G.type.804) = struct_value () [symbolic = %G (constants.%G.ed3)]
  825. // CHECK:STDOUT: %G.specific_fn: <specific function> = specific_function %G, @G(%U) [symbolic = %G.specific_fn (constants.%G.specific_fn.3dd)]
  826. // CHECK:STDOUT:
  827. // CHECK:STDOUT: fn() -> @G.%U (%U);
  828. // CHECK:STDOUT: }
  829. // CHECK:STDOUT:
  830. // CHECK:STDOUT: specific @X(constants.%U) {
  831. // CHECK:STDOUT: %U => constants.%U
  832. // CHECK:STDOUT: %U.patt => constants.%U
  833. // CHECK:STDOUT:
  834. // CHECK:STDOUT: !definition:
  835. // CHECK:STDOUT: %G.type => constants.%G.type.804
  836. // CHECK:STDOUT: %G => constants.%G.ed3
  837. // CHECK:STDOUT: }
  838. // CHECK:STDOUT:
  839. // CHECK:STDOUT: specific @X(constants.%T) {
  840. // CHECK:STDOUT: %U => constants.%T
  841. // CHECK:STDOUT: %U.patt => constants.%T
  842. // CHECK:STDOUT:
  843. // CHECK:STDOUT: !definition:
  844. // CHECK:STDOUT: %G.type => constants.%G.type.aaf
  845. // CHECK:STDOUT: %G => constants.%G.ec7
  846. // CHECK:STDOUT: }
  847. // CHECK:STDOUT:
  848. // CHECK:STDOUT: specific @C(constants.%T) {
  849. // CHECK:STDOUT: %T => constants.%T
  850. // CHECK:STDOUT: %T.patt => constants.%T
  851. // CHECK:STDOUT: }
  852. // CHECK:STDOUT:
  853. // CHECK:STDOUT: specific @X(%U) {}
  854. // CHECK:STDOUT:
  855. // CHECK:STDOUT: specific @X(@C.%T) {}
  856. // CHECK:STDOUT:
  857. // CHECK:STDOUT: specific @C(%T) {}
  858. // CHECK:STDOUT:
  859. // CHECK:STDOUT: specific @G(constants.%U) {
  860. // CHECK:STDOUT: %U => constants.%U
  861. // CHECK:STDOUT:
  862. // CHECK:STDOUT: !definition:
  863. // CHECK:STDOUT: %require_complete => constants.%require_complete.427
  864. // CHECK:STDOUT: %G.type => constants.%G.type.804
  865. // CHECK:STDOUT: %G => constants.%G.ed3
  866. // CHECK:STDOUT: %G.specific_fn => constants.%G.specific_fn.3dd
  867. // CHECK:STDOUT: }
  868. // CHECK:STDOUT:
  869. // CHECK:STDOUT: specific @X(@G.%U) {}
  870. // CHECK:STDOUT:
  871. // CHECK:STDOUT: specific @G(%U) {}
  872. // CHECK:STDOUT:
  873. // CHECK:STDOUT: specific @C(constants.%i32) {
  874. // CHECK:STDOUT: %T => constants.%i32
  875. // CHECK:STDOUT: %T.patt => constants.%i32
  876. // CHECK:STDOUT:
  877. // CHECK:STDOUT: !definition:
  878. // CHECK:STDOUT: %X => constants.%X.3bf
  879. // CHECK:STDOUT: %require_complete => constants.%complete_type.357
  880. // CHECK:STDOUT: %C => constants.%C.733
  881. // CHECK:STDOUT: %C.elem => constants.%C.elem.123
  882. // CHECK:STDOUT: %struct_type.base => constants.%struct_type.base.1d9
  883. // CHECK:STDOUT: %complete_type => constants.%complete_type.82b
  884. // CHECK:STDOUT: }
  885. // CHECK:STDOUT:
  886. // CHECK:STDOUT: specific @X(constants.%i32) {
  887. // CHECK:STDOUT: %U => constants.%i32
  888. // CHECK:STDOUT: %U.patt => constants.%i32
  889. // CHECK:STDOUT:
  890. // CHECK:STDOUT: !definition:
  891. // CHECK:STDOUT: %G.type => constants.%G.type.aac
  892. // CHECK:STDOUT: %G => constants.%G.08f
  893. // CHECK:STDOUT: }
  894. // CHECK:STDOUT:
  895. // CHECK:STDOUT: specific @G(constants.%i32) {
  896. // CHECK:STDOUT: %U => constants.%i32
  897. // CHECK:STDOUT:
  898. // CHECK:STDOUT: !definition:
  899. // CHECK:STDOUT: %require_complete => constants.%complete_type.f8a
  900. // CHECK:STDOUT: %G.type => constants.%G.type.aac
  901. // CHECK:STDOUT: %G => constants.%G.08f
  902. // CHECK:STDOUT: %G.specific_fn => constants.%G.specific_fn.e4a
  903. // CHECK:STDOUT: }
  904. // CHECK:STDOUT: