syntactic_merge_literal.carbon 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  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/syntactic_merge_literal.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/syntactic_merge_literal.carbon
  10. // --- int_match.carbon
  11. library "[[@TEST_NAME]]";
  12. class C(a:! i32) {}
  13. class D(b:! C(1_000));
  14. class D(b:! C(1_000)) {}
  15. // --- fail_int_mismatch.carbon
  16. library "[[@TEST_NAME]]";
  17. class C(a:! i32) {}
  18. class D(b:! C(1000));
  19. // CHECK:STDERR: fail_int_mismatch.carbon:[[@LINE+7]]:15: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers]
  20. // CHECK:STDERR: class D(b:! C(1_000)) {}
  21. // CHECK:STDERR: ^~~~~
  22. // CHECK:STDERR: fail_int_mismatch.carbon:[[@LINE-4]]:15: note: comparing with previous declaration here [RedeclParamSyntaxPrevious]
  23. // CHECK:STDERR: class D(b:! C(1000));
  24. // CHECK:STDERR: ^~~~
  25. // CHECK:STDERR:
  26. class D(b:! C(1_000)) {}
  27. // CHECK:STDOUT: --- int_match.carbon
  28. // CHECK:STDOUT:
  29. // CHECK:STDOUT: constants {
  30. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  31. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  32. // CHECK:STDOUT: %a: %i32 = bind_symbolic_name a, 0 [symbolic]
  33. // CHECK:STDOUT: %a.patt: %i32 = symbolic_binding_pattern a, 0 [symbolic]
  34. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  35. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  36. // CHECK:STDOUT: %C.506: type = class_type @C, @C(%a) [symbolic]
  37. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  38. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  39. // CHECK:STDOUT: %int_1000.ff9: Core.IntLiteral = int_value 1000 [template]
  40. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
  41. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
  42. // CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template]
  43. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template]
  44. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
  45. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template]
  46. // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template]
  47. // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_1000.ff9, %Convert.956 [template]
  48. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
  49. // CHECK:STDOUT: %int_1000.1b6: %i32 = int_value 1000 [template]
  50. // CHECK:STDOUT: %C.262: type = class_type @C, @C(%int_1000.1b6) [template]
  51. // CHECK:STDOUT: %b: %C.262 = bind_symbolic_name b, 0 [symbolic]
  52. // CHECK:STDOUT: %b.patt: %C.262 = symbolic_binding_pattern b, 0 [symbolic]
  53. // CHECK:STDOUT: %D.type: type = generic_class_type @D [template]
  54. // CHECK:STDOUT: %D.generic: %D.type = struct_value () [template]
  55. // CHECK:STDOUT: %D: type = class_type @D, @D(%b) [symbolic]
  56. // CHECK:STDOUT: }
  57. // CHECK:STDOUT:
  58. // CHECK:STDOUT: imports {
  59. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  60. // CHECK:STDOUT: .Int = %Core.Int
  61. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  62. // CHECK:STDOUT: import Core//prelude
  63. // CHECK:STDOUT: import Core//prelude/...
  64. // CHECK:STDOUT: }
  65. // CHECK:STDOUT: }
  66. // CHECK:STDOUT:
  67. // CHECK:STDOUT: file {
  68. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  69. // CHECK:STDOUT: .Core = imports.%Core
  70. // CHECK:STDOUT: .C = %C.decl
  71. // CHECK:STDOUT: .D = %D.decl.loc5
  72. // CHECK:STDOUT: }
  73. // CHECK:STDOUT: %Core.import = import Core
  74. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] {
  75. // CHECK:STDOUT: %a.patt.loc4_9.1: %i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc4_9.2 (constants.%a.patt)]
  76. // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt.loc4_9.1, runtime_param<none> [symbolic = %a.patt.loc4_9.2 (constants.%a.patt)]
  77. // CHECK:STDOUT: } {
  78. // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param<none>
  79. // CHECK:STDOUT: %.loc4: type = splice_block %i32 [template = constants.%i32] {
  80. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  81. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  82. // CHECK:STDOUT: }
  83. // CHECK:STDOUT: %a.loc4_9.1: %i32 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc4_9.2 (constants.%a)]
  84. // CHECK:STDOUT: }
  85. // CHECK:STDOUT: %D.decl.loc5: %D.type = class_decl @D [template = constants.%D.generic] {
  86. // CHECK:STDOUT: %b.patt.loc6: %C.262 = symbolic_binding_pattern b, 0 [symbolic = constants.%b.patt]
  87. // CHECK:STDOUT: %b.param_patt: %C.262 = value_param_pattern %b.patt.loc6, runtime_param<none> [symbolic = constants.%b.patt]
  88. // CHECK:STDOUT: } {
  89. // CHECK:STDOUT: %b.param.loc5: %C.262 = value_param runtime_param<none>
  90. // CHECK:STDOUT: %.loc5_20.1: type = splice_block %C.loc5 [template = constants.%C.262] {
  91. // CHECK:STDOUT: %C.ref.loc5: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic]
  92. // CHECK:STDOUT: %int_1000.loc5: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.ff9]
  93. // CHECK:STDOUT: %impl.elem0.loc5: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  94. // CHECK:STDOUT: %bound_method.loc5: <bound method> = bound_method %int_1000.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound]
  95. // CHECK:STDOUT: %specific_fn.loc5: <specific function> = specific_function %bound_method.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
  96. // CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %specific_fn.loc5(%int_1000.loc5) [template = constants.%int_1000.1b6]
  97. // CHECK:STDOUT: %.loc5_20.2: %i32 = value_of_initializer %int.convert_checked.loc5 [template = constants.%int_1000.1b6]
  98. // CHECK:STDOUT: %.loc5_20.3: %i32 = converted %int_1000.loc5, %.loc5_20.2 [template = constants.%int_1000.1b6]
  99. // CHECK:STDOUT: %C.loc5: type = class_type @C, @C(constants.%int_1000.1b6) [template = constants.%C.262]
  100. // CHECK:STDOUT: }
  101. // CHECK:STDOUT: %b.loc5_9.1: %C.262 = bind_symbolic_name b, 0, %b.param.loc5 [symbolic = %b.loc5_9.2 (constants.%b)]
  102. // CHECK:STDOUT: }
  103. // CHECK:STDOUT: %D.decl.loc6: %D.type = class_decl @D [template = constants.%D.generic] {
  104. // CHECK:STDOUT: %b.patt.loc6: %C.262 = symbolic_binding_pattern b, 0 [symbolic = constants.%b.patt]
  105. // CHECK:STDOUT: %b.param_patt: %C.262 = value_param_pattern %b.patt.loc6, runtime_param<none> [symbolic = constants.%b.patt]
  106. // CHECK:STDOUT: } {
  107. // CHECK:STDOUT: %b.param.loc6: %C.262 = value_param runtime_param<none>
  108. // CHECK:STDOUT: %.loc6_20.1: type = splice_block %C.loc6 [template = constants.%C.262] {
  109. // CHECK:STDOUT: %C.ref.loc6: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic]
  110. // CHECK:STDOUT: %int_1000.loc6: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.ff9]
  111. // CHECK:STDOUT: %impl.elem0.loc6: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  112. // CHECK:STDOUT: %bound_method.loc6: <bound method> = bound_method %int_1000.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound]
  113. // CHECK:STDOUT: %specific_fn.loc6: <specific function> = specific_function %bound_method.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
  114. // CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %specific_fn.loc6(%int_1000.loc6) [template = constants.%int_1000.1b6]
  115. // CHECK:STDOUT: %.loc6_20.2: %i32 = value_of_initializer %int.convert_checked.loc6 [template = constants.%int_1000.1b6]
  116. // CHECK:STDOUT: %.loc6_20.3: %i32 = converted %int_1000.loc6, %.loc6_20.2 [template = constants.%int_1000.1b6]
  117. // CHECK:STDOUT: %C.loc6: type = class_type @C, @C(constants.%int_1000.1b6) [template = constants.%C.262]
  118. // CHECK:STDOUT: }
  119. // CHECK:STDOUT: %b.loc6: %C.262 = bind_symbolic_name b, 0, %b.param.loc6 [symbolic = constants.%b]
  120. // CHECK:STDOUT: }
  121. // CHECK:STDOUT: }
  122. // CHECK:STDOUT:
  123. // CHECK:STDOUT: generic class @C(%a.loc4_9.1: %i32) {
  124. // CHECK:STDOUT: %a.loc4_9.2: %i32 = bind_symbolic_name a, 0 [symbolic = %a.loc4_9.2 (constants.%a)]
  125. // CHECK:STDOUT: %a.patt.loc4_9.2: %i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc4_9.2 (constants.%a.patt)]
  126. // CHECK:STDOUT:
  127. // CHECK:STDOUT: !definition:
  128. // CHECK:STDOUT:
  129. // CHECK:STDOUT: class {
  130. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  131. // CHECK:STDOUT: complete_type_witness = %complete_type
  132. // CHECK:STDOUT:
  133. // CHECK:STDOUT: !members:
  134. // CHECK:STDOUT: .Self = constants.%C.506
  135. // CHECK:STDOUT: }
  136. // CHECK:STDOUT: }
  137. // CHECK:STDOUT:
  138. // CHECK:STDOUT: generic class @D(%b.loc5_9.1: %C.262) {
  139. // CHECK:STDOUT: %b.loc5_9.2: %C.262 = bind_symbolic_name b, 0 [symbolic = %b.loc5_9.2 (constants.%b)]
  140. // CHECK:STDOUT: %b.patt.loc5: %C.262 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc5 (constants.%b.patt)]
  141. // CHECK:STDOUT:
  142. // CHECK:STDOUT: !definition:
  143. // CHECK:STDOUT:
  144. // CHECK:STDOUT: class {
  145. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  146. // CHECK:STDOUT: complete_type_witness = %complete_type
  147. // CHECK:STDOUT:
  148. // CHECK:STDOUT: !members:
  149. // CHECK:STDOUT: .Self = constants.%D
  150. // CHECK:STDOUT: }
  151. // CHECK:STDOUT: }
  152. // CHECK:STDOUT:
  153. // CHECK:STDOUT: specific @C(constants.%a) {
  154. // CHECK:STDOUT: %a.loc4_9.2 => constants.%a
  155. // CHECK:STDOUT: %a.patt.loc4_9.2 => constants.%a
  156. // CHECK:STDOUT: }
  157. // CHECK:STDOUT:
  158. // CHECK:STDOUT: specific @C(constants.%int_1000.1b6) {
  159. // CHECK:STDOUT: %a.loc4_9.2 => constants.%int_1000.1b6
  160. // CHECK:STDOUT: %a.patt.loc4_9.2 => constants.%int_1000.1b6
  161. // CHECK:STDOUT: }
  162. // CHECK:STDOUT:
  163. // CHECK:STDOUT: specific @D(constants.%b) {
  164. // CHECK:STDOUT: %b.loc5_9.2 => constants.%b
  165. // CHECK:STDOUT: %b.patt.loc5 => constants.%b
  166. // CHECK:STDOUT: }
  167. // CHECK:STDOUT:
  168. // CHECK:STDOUT: --- fail_int_mismatch.carbon
  169. // CHECK:STDOUT:
  170. // CHECK:STDOUT: constants {
  171. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  172. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  173. // CHECK:STDOUT: %a: %i32 = bind_symbolic_name a, 0 [symbolic]
  174. // CHECK:STDOUT: %a.patt: %i32 = symbolic_binding_pattern a, 0 [symbolic]
  175. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  176. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  177. // CHECK:STDOUT: %C.506: type = class_type @C, @C(%a) [symbolic]
  178. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  179. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  180. // CHECK:STDOUT: %int_1000.ff9: Core.IntLiteral = int_value 1000 [template]
  181. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
  182. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
  183. // CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template]
  184. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template]
  185. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
  186. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template]
  187. // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template]
  188. // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_1000.ff9, %Convert.956 [template]
  189. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
  190. // CHECK:STDOUT: %int_1000.1b6: %i32 = int_value 1000 [template]
  191. // CHECK:STDOUT: %C.262: type = class_type @C, @C(%int_1000.1b6) [template]
  192. // CHECK:STDOUT: %b: %C.262 = bind_symbolic_name b, 0 [symbolic]
  193. // CHECK:STDOUT: %b.patt: %C.262 = symbolic_binding_pattern b, 0 [symbolic]
  194. // CHECK:STDOUT: %D.type: type = generic_class_type @D [template]
  195. // CHECK:STDOUT: %D.generic: %D.type = struct_value () [template]
  196. // CHECK:STDOUT: %.type: type = generic_class_type @.1 [template]
  197. // CHECK:STDOUT: %.generic: %.type = struct_value () [template]
  198. // CHECK:STDOUT: %.3d2: type = class_type @.1, @.1(%b) [symbolic]
  199. // CHECK:STDOUT: }
  200. // CHECK:STDOUT:
  201. // CHECK:STDOUT: imports {
  202. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  203. // CHECK:STDOUT: .Int = %Core.Int
  204. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  205. // CHECK:STDOUT: import Core//prelude
  206. // CHECK:STDOUT: import Core//prelude/...
  207. // CHECK:STDOUT: }
  208. // CHECK:STDOUT: }
  209. // CHECK:STDOUT:
  210. // CHECK:STDOUT: file {
  211. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  212. // CHECK:STDOUT: .Core = imports.%Core
  213. // CHECK:STDOUT: .C = %C.decl
  214. // CHECK:STDOUT: .D = %D.decl
  215. // CHECK:STDOUT: }
  216. // CHECK:STDOUT: %Core.import = import Core
  217. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] {
  218. // CHECK:STDOUT: %a.patt.loc4_9.1: %i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc4_9.2 (constants.%a.patt)]
  219. // CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt.loc4_9.1, runtime_param<none> [symbolic = %a.patt.loc4_9.2 (constants.%a.patt)]
  220. // CHECK:STDOUT: } {
  221. // CHECK:STDOUT: %a.param: %i32 = value_param runtime_param<none>
  222. // CHECK:STDOUT: %.loc4: type = splice_block %i32 [template = constants.%i32] {
  223. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  224. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  225. // CHECK:STDOUT: }
  226. // CHECK:STDOUT: %a.loc4_9.1: %i32 = bind_symbolic_name a, 0, %a.param [symbolic = %a.loc4_9.2 (constants.%a)]
  227. // CHECK:STDOUT: }
  228. // CHECK:STDOUT: %D.decl: %D.type = class_decl @D [template = constants.%D.generic] {
  229. // CHECK:STDOUT: %b.patt.loc5_9.1: %C.262 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc5_9.2 (constants.%b.patt)]
  230. // CHECK:STDOUT: %b.param_patt: %C.262 = value_param_pattern %b.patt.loc5_9.1, runtime_param<none> [symbolic = %b.patt.loc5_9.2 (constants.%b.patt)]
  231. // CHECK:STDOUT: } {
  232. // CHECK:STDOUT: %b.param: %C.262 = value_param runtime_param<none>
  233. // CHECK:STDOUT: %.loc5_19.1: type = splice_block %C [template = constants.%C.262] {
  234. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic]
  235. // CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.ff9]
  236. // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  237. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1000, %impl.elem0 [template = constants.%Convert.bound]
  238. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
  239. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1000) [template = constants.%int_1000.1b6]
  240. // CHECK:STDOUT: %.loc5_19.2: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1000.1b6]
  241. // CHECK:STDOUT: %.loc5_19.3: %i32 = converted %int_1000, %.loc5_19.2 [template = constants.%int_1000.1b6]
  242. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_1000.1b6) [template = constants.%C.262]
  243. // CHECK:STDOUT: }
  244. // CHECK:STDOUT: %b.loc5_9.1: %C.262 = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc5_9.2 (constants.%b)]
  245. // CHECK:STDOUT: }
  246. // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.generic] {
  247. // CHECK:STDOUT: %b.patt.loc13_9.1: %C.262 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc13_9.2 (constants.%b.patt)]
  248. // CHECK:STDOUT: %b.param_patt: %C.262 = value_param_pattern %b.patt.loc13_9.1, runtime_param<none> [symbolic = %b.patt.loc13_9.2 (constants.%b.patt)]
  249. // CHECK:STDOUT: } {
  250. // CHECK:STDOUT: %b.param: %C.262 = value_param runtime_param<none>
  251. // CHECK:STDOUT: %.loc13_20.1: type = splice_block %C [template = constants.%C.262] {
  252. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic]
  253. // CHECK:STDOUT: %int_1000: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.ff9]
  254. // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  255. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1000, %impl.elem0 [template = constants.%Convert.bound]
  256. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
  257. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_1000) [template = constants.%int_1000.1b6]
  258. // CHECK:STDOUT: %.loc13_20.2: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1000.1b6]
  259. // CHECK:STDOUT: %.loc13_20.3: %i32 = converted %int_1000, %.loc13_20.2 [template = constants.%int_1000.1b6]
  260. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%int_1000.1b6) [template = constants.%C.262]
  261. // CHECK:STDOUT: }
  262. // CHECK:STDOUT: %b.loc13_9.1: %C.262 = bind_symbolic_name b, 0, %b.param [symbolic = %b.loc13_9.2 (constants.%b)]
  263. // CHECK:STDOUT: }
  264. // CHECK:STDOUT: }
  265. // CHECK:STDOUT:
  266. // CHECK:STDOUT: generic class @C(%a.loc4_9.1: %i32) {
  267. // CHECK:STDOUT: %a.loc4_9.2: %i32 = bind_symbolic_name a, 0 [symbolic = %a.loc4_9.2 (constants.%a)]
  268. // CHECK:STDOUT: %a.patt.loc4_9.2: %i32 = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc4_9.2 (constants.%a.patt)]
  269. // CHECK:STDOUT:
  270. // CHECK:STDOUT: !definition:
  271. // CHECK:STDOUT:
  272. // CHECK:STDOUT: class {
  273. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  274. // CHECK:STDOUT: complete_type_witness = %complete_type
  275. // CHECK:STDOUT:
  276. // CHECK:STDOUT: !members:
  277. // CHECK:STDOUT: .Self = constants.%C.506
  278. // CHECK:STDOUT: }
  279. // CHECK:STDOUT: }
  280. // CHECK:STDOUT:
  281. // CHECK:STDOUT: generic class @D(%b.loc5_9.1: %C.262) {
  282. // CHECK:STDOUT: %b.loc5_9.2: %C.262 = bind_symbolic_name b, 0 [symbolic = %b.loc5_9.2 (constants.%b)]
  283. // CHECK:STDOUT: %b.patt.loc5_9.2: %C.262 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc5_9.2 (constants.%b.patt)]
  284. // CHECK:STDOUT:
  285. // CHECK:STDOUT: class;
  286. // CHECK:STDOUT: }
  287. // CHECK:STDOUT:
  288. // CHECK:STDOUT: generic class @.1(%b.loc13_9.1: %C.262) {
  289. // CHECK:STDOUT: %b.loc13_9.2: %C.262 = bind_symbolic_name b, 0 [symbolic = %b.loc13_9.2 (constants.%b)]
  290. // CHECK:STDOUT: %b.patt.loc13_9.2: %C.262 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc13_9.2 (constants.%b.patt)]
  291. // CHECK:STDOUT:
  292. // CHECK:STDOUT: !definition:
  293. // CHECK:STDOUT:
  294. // CHECK:STDOUT: class {
  295. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  296. // CHECK:STDOUT: complete_type_witness = %complete_type
  297. // CHECK:STDOUT:
  298. // CHECK:STDOUT: !members:
  299. // CHECK:STDOUT: .Self = constants.%.3d2
  300. // CHECK:STDOUT: }
  301. // CHECK:STDOUT: }
  302. // CHECK:STDOUT:
  303. // CHECK:STDOUT: specific @C(constants.%a) {
  304. // CHECK:STDOUT: %a.loc4_9.2 => constants.%a
  305. // CHECK:STDOUT: %a.patt.loc4_9.2 => constants.%a
  306. // CHECK:STDOUT: }
  307. // CHECK:STDOUT:
  308. // CHECK:STDOUT: specific @C(constants.%int_1000.1b6) {
  309. // CHECK:STDOUT: %a.loc4_9.2 => constants.%int_1000.1b6
  310. // CHECK:STDOUT: %a.patt.loc4_9.2 => constants.%int_1000.1b6
  311. // CHECK:STDOUT: }
  312. // CHECK:STDOUT:
  313. // CHECK:STDOUT: specific @D(constants.%b) {
  314. // CHECK:STDOUT: %b.loc5_9.2 => constants.%b
  315. // CHECK:STDOUT: %b.patt.loc5_9.2 => constants.%b
  316. // CHECK:STDOUT: }
  317. // CHECK:STDOUT:
  318. // CHECK:STDOUT: specific @.1(constants.%b) {
  319. // CHECK:STDOUT: %b.loc13_9.2 => constants.%b
  320. // CHECK:STDOUT: %b.patt.loc13_9.2 => constants.%b
  321. // CHECK:STDOUT: }
  322. // CHECK:STDOUT: