eq.carbon 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  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/operators/overloaded/eq.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/overloaded/eq.carbon
  10. // --- user.carbon
  11. package User;
  12. class C {};
  13. impl C as Core.Eq {
  14. fn Equal[self: C](other: C) -> bool;
  15. fn NotEqual[self: C](other: C) -> bool;
  16. }
  17. fn TestEqual(a: C, b: C) -> bool {
  18. return a == b;
  19. }
  20. fn TestNotEqual(a: C, b: C) -> bool {
  21. return a != b;
  22. }
  23. // --- fail_no_impl.carbon
  24. package FailNoImpl;
  25. class D {};
  26. fn TestEqual(a: D, b: D) -> bool {
  27. // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: ERROR: Cannot access member of interface Eq in type D that does not implement that interface.
  28. // CHECK:STDERR: return a == b;
  29. // CHECK:STDERR: ^~~~~~
  30. // CHECK:STDERR:
  31. return a == b;
  32. }
  33. fn TestNotEqual(a: D, b: D) -> bool {
  34. // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: ERROR: Cannot access member of interface Eq in type D that does not implement that interface.
  35. // CHECK:STDERR: return a != b;
  36. // CHECK:STDERR: ^~~~~~
  37. // CHECK:STDERR:
  38. return a != b;
  39. }
  40. // --- fail_no_impl_for_args.carbon
  41. package FailNoImplForArgs;
  42. class C {};
  43. class D {};
  44. impl C as Core.Eq {
  45. fn Equal[self: C](other: C) -> bool;
  46. fn NotEqual[self: C](other: C) -> bool;
  47. }
  48. fn TestRhsBad(a: C, b: D) -> bool {
  49. // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+7]]:10: ERROR: Cannot implicitly convert from `D` to `C`.
  50. // CHECK:STDERR: return a == b;
  51. // CHECK:STDERR: ^~~~~~
  52. // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE-8]]:3: Initializing parameter 1 of function declared here.
  53. // CHECK:STDERR: fn Equal[self: C](other: C) -> bool;
  54. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  55. // CHECK:STDERR:
  56. return a == b;
  57. }
  58. fn TestLhsBad(a: D, b: C) -> bool {
  59. // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+3]]:10: ERROR: Cannot access member of interface Eq in type D that does not implement that interface.
  60. // CHECK:STDERR: return a != b;
  61. // CHECK:STDERR: ^~~~~~
  62. return a != b;
  63. }
  64. // CHECK:STDOUT: --- user.carbon
  65. // CHECK:STDOUT:
  66. // CHECK:STDOUT: constants {
  67. // CHECK:STDOUT: %C: type = class_type @C [template]
  68. // CHECK:STDOUT: %.1: type = struct_type {} [template]
  69. // CHECK:STDOUT: %.2: type = interface_type @Eq [template]
  70. // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic]
  71. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template]
  72. // CHECK:STDOUT: %.3: type = tuple_type () [template]
  73. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template]
  74. // CHECK:STDOUT: %Equal.type.1: type = fn_type @Equal.1 [template]
  75. // CHECK:STDOUT: %Equal.1: %Equal.type.1 = struct_value () [template]
  76. // CHECK:STDOUT: %NotEqual.type.1: type = fn_type @NotEqual.1 [template]
  77. // CHECK:STDOUT: %NotEqual.1: %NotEqual.type.1 = struct_value () [template]
  78. // CHECK:STDOUT: %Equal.type.2: type = fn_type @Equal.2 [template]
  79. // CHECK:STDOUT: %Equal.2: %Equal.type.2 = struct_value () [template]
  80. // CHECK:STDOUT: %NotEqual.type.2: type = fn_type @NotEqual.2 [template]
  81. // CHECK:STDOUT: %NotEqual.2: %NotEqual.type.2 = struct_value () [template]
  82. // CHECK:STDOUT: %.4: <witness> = interface_witness (%Equal.1, %NotEqual.1) [template]
  83. // CHECK:STDOUT: %TestEqual.type: type = fn_type @TestEqual [template]
  84. // CHECK:STDOUT: %TestEqual: %TestEqual.type = struct_value () [template]
  85. // CHECK:STDOUT: %.5: type = ptr_type %.1 [template]
  86. // CHECK:STDOUT: %.6: type = assoc_entity_type %.2, %Equal.type.2 [template]
  87. // CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.8 [template]
  88. // CHECK:STDOUT: %TestNotEqual.type: type = fn_type @TestNotEqual [template]
  89. // CHECK:STDOUT: %TestNotEqual: %TestNotEqual.type = struct_value () [template]
  90. // CHECK:STDOUT: %.8: type = assoc_entity_type %.2, %NotEqual.type.2 [template]
  91. // CHECK:STDOUT: %.9: %.8 = assoc_entity element1, imports.%import_ref.9 [template]
  92. // CHECK:STDOUT: }
  93. // CHECK:STDOUT:
  94. // CHECK:STDOUT: imports {
  95. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  96. // CHECK:STDOUT: .Eq = %import_ref.1
  97. // CHECK:STDOUT: .Bool = %import_ref.7
  98. // CHECK:STDOUT: import Core//prelude
  99. // CHECK:STDOUT: import Core//prelude/operators
  100. // CHECK:STDOUT: import Core//prelude/types
  101. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  102. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  103. // CHECK:STDOUT: import Core//prelude/operators/comparison
  104. // CHECK:STDOUT: import Core//prelude/types/bool
  105. // CHECK:STDOUT: }
  106. // CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.2]
  107. // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/comparison, inst+5, unloaded
  108. // CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/comparison, inst+31, loaded [template = constants.%.7]
  109. // CHECK:STDOUT: %import_ref.4: %.8 = import_ref Core//prelude/operators/comparison, inst+52, loaded [template = constants.%.9]
  110. // CHECK:STDOUT: %import_ref.5: %Equal.type.2 = import_ref Core//prelude/operators/comparison, inst+26, loaded [template = constants.%Equal.2]
  111. // CHECK:STDOUT: %import_ref.6: %NotEqual.type.2 = import_ref Core//prelude/operators/comparison, inst+47, loaded [template = constants.%NotEqual.2]
  112. // CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool]
  113. // CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+26, unloaded
  114. // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/comparison, inst+47, unloaded
  115. // CHECK:STDOUT: }
  116. // CHECK:STDOUT:
  117. // CHECK:STDOUT: file {
  118. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  119. // CHECK:STDOUT: .Core = imports.%Core
  120. // CHECK:STDOUT: .C = %C.decl
  121. // CHECK:STDOUT: .TestEqual = %TestEqual.decl
  122. // CHECK:STDOUT: .TestNotEqual = %TestNotEqual.decl
  123. // CHECK:STDOUT: }
  124. // CHECK:STDOUT: %Core.import = import Core
  125. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
  126. // CHECK:STDOUT: impl_decl @impl {
  127. // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C]
  128. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
  129. // CHECK:STDOUT: %Eq.ref: type = name_ref Eq, imports.%import_ref.1 [template = constants.%.2]
  130. // CHECK:STDOUT: }
  131. // CHECK:STDOUT: %TestEqual.decl: %TestEqual.type = fn_decl @TestEqual [template = constants.%TestEqual] {
  132. // CHECK:STDOUT: %C.ref.loc11_17: type = name_ref C, %C.decl [template = constants.%C]
  133. // CHECK:STDOUT: %a.loc11_14.1: %C = param a
  134. // CHECK:STDOUT: @TestEqual.%a: %C = bind_name a, %a.loc11_14.1
  135. // CHECK:STDOUT: %C.ref.loc11_23: type = name_ref C, %C.decl [template = constants.%C]
  136. // CHECK:STDOUT: %b.loc11_20.1: %C = param b
  137. // CHECK:STDOUT: @TestEqual.%b: %C = bind_name b, %b.loc11_20.1
  138. // CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [template = bool]
  139. // CHECK:STDOUT: %.loc11_29.1: type = value_of_initializer %bool.make_type.loc11 [template = bool]
  140. // CHECK:STDOUT: %.loc11_29.2: type = converted %bool.make_type.loc11, %.loc11_29.1 [template = bool]
  141. // CHECK:STDOUT: @TestEqual.%return: ref bool = var <return slot>
  142. // CHECK:STDOUT: }
  143. // CHECK:STDOUT: %TestNotEqual.decl: %TestNotEqual.type = fn_decl @TestNotEqual [template = constants.%TestNotEqual] {
  144. // CHECK:STDOUT: %C.ref.loc15_20: type = name_ref C, %C.decl [template = constants.%C]
  145. // CHECK:STDOUT: %a.loc15_17.1: %C = param a
  146. // CHECK:STDOUT: @TestNotEqual.%a: %C = bind_name a, %a.loc15_17.1
  147. // CHECK:STDOUT: %C.ref.loc15_26: type = name_ref C, %C.decl [template = constants.%C]
  148. // CHECK:STDOUT: %b.loc15_23.1: %C = param b
  149. // CHECK:STDOUT: @TestNotEqual.%b: %C = bind_name b, %b.loc15_23.1
  150. // CHECK:STDOUT: %bool.make_type.loc15: init type = call constants.%Bool() [template = bool]
  151. // CHECK:STDOUT: %.loc15_32.1: type = value_of_initializer %bool.make_type.loc15 [template = bool]
  152. // CHECK:STDOUT: %.loc15_32.2: type = converted %bool.make_type.loc15, %.loc15_32.1 [template = bool]
  153. // CHECK:STDOUT: @TestNotEqual.%return: ref bool = var <return slot>
  154. // CHECK:STDOUT: }
  155. // CHECK:STDOUT: }
  156. // CHECK:STDOUT:
  157. // CHECK:STDOUT: interface @Eq {
  158. // CHECK:STDOUT: !members:
  159. // CHECK:STDOUT: .Self = imports.%import_ref.2
  160. // CHECK:STDOUT: .Equal = imports.%import_ref.3
  161. // CHECK:STDOUT: .NotEqual = imports.%import_ref.4
  162. // CHECK:STDOUT: witness = (imports.%import_ref.5, imports.%import_ref.6)
  163. // CHECK:STDOUT: }
  164. // CHECK:STDOUT:
  165. // CHECK:STDOUT: impl @impl: %C as %.2 {
  166. // CHECK:STDOUT: %Equal.decl: %Equal.type.1 = fn_decl @Equal.1 [template = constants.%Equal.1] {
  167. // CHECK:STDOUT: %C.ref.loc7_18: type = name_ref C, file.%C.decl [template = constants.%C]
  168. // CHECK:STDOUT: %self.loc7_12.1: %C = param self
  169. // CHECK:STDOUT: %self.loc7_12.2: %C = bind_name self, %self.loc7_12.1
  170. // CHECK:STDOUT: %C.ref.loc7_28: type = name_ref C, file.%C.decl [template = constants.%C]
  171. // CHECK:STDOUT: %other.loc7_21.1: %C = param other
  172. // CHECK:STDOUT: %other.loc7_21.2: %C = bind_name other, %other.loc7_21.1
  173. // CHECK:STDOUT: %bool.make_type.loc7: init type = call constants.%Bool() [template = bool]
  174. // CHECK:STDOUT: %.loc7_34.1: type = value_of_initializer %bool.make_type.loc7 [template = bool]
  175. // CHECK:STDOUT: %.loc7_34.2: type = converted %bool.make_type.loc7, %.loc7_34.1 [template = bool]
  176. // CHECK:STDOUT: %return.var.loc7: ref bool = var <return slot>
  177. // CHECK:STDOUT: }
  178. // CHECK:STDOUT: %NotEqual.decl: %NotEqual.type.1 = fn_decl @NotEqual.1 [template = constants.%NotEqual.1] {
  179. // CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, file.%C.decl [template = constants.%C]
  180. // CHECK:STDOUT: %self.loc8_15.1: %C = param self
  181. // CHECK:STDOUT: %self.loc8_15.2: %C = bind_name self, %self.loc8_15.1
  182. // CHECK:STDOUT: %C.ref.loc8_31: type = name_ref C, file.%C.decl [template = constants.%C]
  183. // CHECK:STDOUT: %other.loc8_24.1: %C = param other
  184. // CHECK:STDOUT: %other.loc8_24.2: %C = bind_name other, %other.loc8_24.1
  185. // CHECK:STDOUT: %bool.make_type.loc8: init type = call constants.%Bool() [template = bool]
  186. // CHECK:STDOUT: %.loc8_37.1: type = value_of_initializer %bool.make_type.loc8 [template = bool]
  187. // CHECK:STDOUT: %.loc8_37.2: type = converted %bool.make_type.loc8, %.loc8_37.1 [template = bool]
  188. // CHECK:STDOUT: %return.var.loc8: ref bool = var <return slot>
  189. // CHECK:STDOUT: }
  190. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Equal.decl, %NotEqual.decl) [template = constants.%.4]
  191. // CHECK:STDOUT:
  192. // CHECK:STDOUT: !members:
  193. // CHECK:STDOUT: .Equal = %Equal.decl
  194. // CHECK:STDOUT: .NotEqual = %NotEqual.decl
  195. // CHECK:STDOUT: witness = %.1
  196. // CHECK:STDOUT: }
  197. // CHECK:STDOUT:
  198. // CHECK:STDOUT: class @C {
  199. // CHECK:STDOUT: !members:
  200. // CHECK:STDOUT: .Self = constants.%C
  201. // CHECK:STDOUT: }
  202. // CHECK:STDOUT:
  203. // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type";
  204. // CHECK:STDOUT:
  205. // CHECK:STDOUT: fn @Equal.1[@impl.%self.loc7_12.2: %C](@impl.%other.loc7_21.2: %C) -> bool;
  206. // CHECK:STDOUT:
  207. // CHECK:STDOUT: fn @NotEqual.1[@impl.%self.loc8_15.2: %C](@impl.%other.loc8_24.2: %C) -> bool;
  208. // CHECK:STDOUT:
  209. // CHECK:STDOUT: generic fn @Equal.2(constants.%Self: %.2) {
  210. // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)]
  211. // CHECK:STDOUT:
  212. // CHECK:STDOUT: fn[%self: @Equal.2.%Self (%Self)](%other: @Equal.2.%Self (%Self)) -> bool;
  213. // CHECK:STDOUT: }
  214. // CHECK:STDOUT:
  215. // CHECK:STDOUT: generic fn @NotEqual.2(constants.%Self: %.2) {
  216. // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)]
  217. // CHECK:STDOUT:
  218. // CHECK:STDOUT: fn[%self: @NotEqual.2.%Self (%Self)](%other: @NotEqual.2.%Self (%Self)) -> bool;
  219. // CHECK:STDOUT: }
  220. // CHECK:STDOUT:
  221. // CHECK:STDOUT: fn @TestEqual(%a: %C, %b: %C) -> bool {
  222. // CHECK:STDOUT: !entry:
  223. // CHECK:STDOUT: %a.ref: %C = name_ref a, %a
  224. // CHECK:STDOUT: %b.ref: %C = name_ref b, %b
  225. // CHECK:STDOUT: %.1: %Equal.type.2 = interface_witness_access @impl.%.1, element0 [template = constants.%Equal.1]
  226. // CHECK:STDOUT: %.loc12_12: <bound method> = bound_method %a.ref, %.1
  227. // CHECK:STDOUT: %Equal.call: init bool = call %.loc12_12(%a.ref, %b.ref)
  228. // CHECK:STDOUT: %.loc12_16.1: bool = value_of_initializer %Equal.call
  229. // CHECK:STDOUT: %.loc12_16.2: bool = converted %Equal.call, %.loc12_16.1
  230. // CHECK:STDOUT: return %.loc12_16.2
  231. // CHECK:STDOUT: }
  232. // CHECK:STDOUT:
  233. // CHECK:STDOUT: fn @TestNotEqual(%a: %C, %b: %C) -> bool {
  234. // CHECK:STDOUT: !entry:
  235. // CHECK:STDOUT: %a.ref: %C = name_ref a, %a
  236. // CHECK:STDOUT: %b.ref: %C = name_ref b, %b
  237. // CHECK:STDOUT: %.1: %NotEqual.type.2 = interface_witness_access @impl.%.1, element1 [template = constants.%NotEqual.1]
  238. // CHECK:STDOUT: %.loc16_12: <bound method> = bound_method %a.ref, %.1
  239. // CHECK:STDOUT: %NotEqual.call: init bool = call %.loc16_12(%a.ref, %b.ref)
  240. // CHECK:STDOUT: %.loc16_16.1: bool = value_of_initializer %NotEqual.call
  241. // CHECK:STDOUT: %.loc16_16.2: bool = converted %NotEqual.call, %.loc16_16.1
  242. // CHECK:STDOUT: return %.loc16_16.2
  243. // CHECK:STDOUT: }
  244. // CHECK:STDOUT:
  245. // CHECK:STDOUT: specific @Equal.2(constants.%Self) {
  246. // CHECK:STDOUT: %Self => constants.%Self
  247. // CHECK:STDOUT: }
  248. // CHECK:STDOUT:
  249. // CHECK:STDOUT: specific @Equal.2(constants.%C) {
  250. // CHECK:STDOUT: %Self => constants.%C
  251. // CHECK:STDOUT: }
  252. // CHECK:STDOUT:
  253. // CHECK:STDOUT: specific @NotEqual.2(constants.%Self) {
  254. // CHECK:STDOUT: %Self => constants.%Self
  255. // CHECK:STDOUT: }
  256. // CHECK:STDOUT:
  257. // CHECK:STDOUT: specific @NotEqual.2(constants.%C) {
  258. // CHECK:STDOUT: %Self => constants.%C
  259. // CHECK:STDOUT: }
  260. // CHECK:STDOUT:
  261. // CHECK:STDOUT: --- fail_no_impl.carbon
  262. // CHECK:STDOUT:
  263. // CHECK:STDOUT: constants {
  264. // CHECK:STDOUT: %D: type = class_type @D [template]
  265. // CHECK:STDOUT: %.1: type = struct_type {} [template]
  266. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template]
  267. // CHECK:STDOUT: %.2: type = tuple_type () [template]
  268. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template]
  269. // CHECK:STDOUT: %TestEqual.type: type = fn_type @TestEqual [template]
  270. // CHECK:STDOUT: %TestEqual: %TestEqual.type = struct_value () [template]
  271. // CHECK:STDOUT: %.3: type = ptr_type %.1 [template]
  272. // CHECK:STDOUT: %.4: type = interface_type @Eq [template]
  273. // CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 0 [symbolic]
  274. // CHECK:STDOUT: %Equal.type: type = fn_type @Equal [template]
  275. // CHECK:STDOUT: %Equal: %Equal.type = struct_value () [template]
  276. // CHECK:STDOUT: %.5: type = assoc_entity_type %.4, %Equal.type [template]
  277. // CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.8 [template]
  278. // CHECK:STDOUT: %TestNotEqual.type: type = fn_type @TestNotEqual [template]
  279. // CHECK:STDOUT: %TestNotEqual: %TestNotEqual.type = struct_value () [template]
  280. // CHECK:STDOUT: %NotEqual.type: type = fn_type @NotEqual [template]
  281. // CHECK:STDOUT: %NotEqual: %NotEqual.type = struct_value () [template]
  282. // CHECK:STDOUT: %.7: type = assoc_entity_type %.4, %NotEqual.type [template]
  283. // CHECK:STDOUT: %.8: %.7 = assoc_entity element1, imports.%import_ref.9 [template]
  284. // CHECK:STDOUT: }
  285. // CHECK:STDOUT:
  286. // CHECK:STDOUT: imports {
  287. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  288. // CHECK:STDOUT: .Bool = %import_ref.1
  289. // CHECK:STDOUT: .Eq = %import_ref.2
  290. // CHECK:STDOUT: import Core//prelude
  291. // CHECK:STDOUT: import Core//prelude/operators
  292. // CHECK:STDOUT: import Core//prelude/types
  293. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  294. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  295. // CHECK:STDOUT: import Core//prelude/operators/comparison
  296. // CHECK:STDOUT: import Core//prelude/types/bool
  297. // CHECK:STDOUT: }
  298. // CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool]
  299. // CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.4]
  300. // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/comparison, inst+5, unloaded
  301. // CHECK:STDOUT: %import_ref.4: %.5 = import_ref Core//prelude/operators/comparison, inst+31, loaded [template = constants.%.6]
  302. // CHECK:STDOUT: %import_ref.5: %.7 = import_ref Core//prelude/operators/comparison, inst+52, loaded [template = constants.%.8]
  303. // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/comparison, inst+26, unloaded
  304. // CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/comparison, inst+47, unloaded
  305. // CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+26, unloaded
  306. // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/comparison, inst+47, unloaded
  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: .D = %D.decl
  313. // CHECK:STDOUT: .TestEqual = %TestEqual.decl
  314. // CHECK:STDOUT: .TestNotEqual = %TestNotEqual.decl
  315. // CHECK:STDOUT: }
  316. // CHECK:STDOUT: %Core.import = import Core
  317. // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {}
  318. // CHECK:STDOUT: %TestEqual.decl: %TestEqual.type = fn_decl @TestEqual [template = constants.%TestEqual] {
  319. // CHECK:STDOUT: %D.ref.loc6_17: type = name_ref D, %D.decl [template = constants.%D]
  320. // CHECK:STDOUT: %a.loc6_14.1: %D = param a
  321. // CHECK:STDOUT: @TestEqual.%a: %D = bind_name a, %a.loc6_14.1
  322. // CHECK:STDOUT: %D.ref.loc6_23: type = name_ref D, %D.decl [template = constants.%D]
  323. // CHECK:STDOUT: %b.loc6_20.1: %D = param b
  324. // CHECK:STDOUT: @TestEqual.%b: %D = bind_name b, %b.loc6_20.1
  325. // CHECK:STDOUT: %bool.make_type.loc6: init type = call constants.%Bool() [template = bool]
  326. // CHECK:STDOUT: %.loc6_29.1: type = value_of_initializer %bool.make_type.loc6 [template = bool]
  327. // CHECK:STDOUT: %.loc6_29.2: type = converted %bool.make_type.loc6, %.loc6_29.1 [template = bool]
  328. // CHECK:STDOUT: @TestEqual.%return: ref bool = var <return slot>
  329. // CHECK:STDOUT: }
  330. // CHECK:STDOUT: %TestNotEqual.decl: %TestNotEqual.type = fn_decl @TestNotEqual [template = constants.%TestNotEqual] {
  331. // CHECK:STDOUT: %D.ref.loc14_20: type = name_ref D, %D.decl [template = constants.%D]
  332. // CHECK:STDOUT: %a.loc14_17.1: %D = param a
  333. // CHECK:STDOUT: @TestNotEqual.%a: %D = bind_name a, %a.loc14_17.1
  334. // CHECK:STDOUT: %D.ref.loc14_26: type = name_ref D, %D.decl [template = constants.%D]
  335. // CHECK:STDOUT: %b.loc14_23.1: %D = param b
  336. // CHECK:STDOUT: @TestNotEqual.%b: %D = bind_name b, %b.loc14_23.1
  337. // CHECK:STDOUT: %bool.make_type.loc14: init type = call constants.%Bool() [template = bool]
  338. // CHECK:STDOUT: %.loc14_32.1: type = value_of_initializer %bool.make_type.loc14 [template = bool]
  339. // CHECK:STDOUT: %.loc14_32.2: type = converted %bool.make_type.loc14, %.loc14_32.1 [template = bool]
  340. // CHECK:STDOUT: @TestNotEqual.%return: ref bool = var <return slot>
  341. // CHECK:STDOUT: }
  342. // CHECK:STDOUT: }
  343. // CHECK:STDOUT:
  344. // CHECK:STDOUT: interface @Eq {
  345. // CHECK:STDOUT: !members:
  346. // CHECK:STDOUT: .Self = imports.%import_ref.3
  347. // CHECK:STDOUT: .Equal = imports.%import_ref.4
  348. // CHECK:STDOUT: .NotEqual = imports.%import_ref.5
  349. // CHECK:STDOUT: witness = (imports.%import_ref.6, imports.%import_ref.7)
  350. // CHECK:STDOUT: }
  351. // CHECK:STDOUT:
  352. // CHECK:STDOUT: class @D {
  353. // CHECK:STDOUT: !members:
  354. // CHECK:STDOUT: .Self = constants.%D
  355. // CHECK:STDOUT: }
  356. // CHECK:STDOUT:
  357. // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type";
  358. // CHECK:STDOUT:
  359. // CHECK:STDOUT: fn @TestEqual(%a: %D, %b: %D) -> bool {
  360. // CHECK:STDOUT: !entry:
  361. // CHECK:STDOUT: %a.ref: %D = name_ref a, %a
  362. // CHECK:STDOUT: %b.ref: %D = name_ref b, %b
  363. // CHECK:STDOUT: return <error>
  364. // CHECK:STDOUT: }
  365. // CHECK:STDOUT:
  366. // CHECK:STDOUT: generic fn @Equal(constants.%Self: %.4) {
  367. // CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)]
  368. // CHECK:STDOUT:
  369. // CHECK:STDOUT: fn[%self: @Equal.%Self (%Self)](%other: @Equal.%Self (%Self)) -> bool;
  370. // CHECK:STDOUT: }
  371. // CHECK:STDOUT:
  372. // CHECK:STDOUT: fn @TestNotEqual(%a: %D, %b: %D) -> bool {
  373. // CHECK:STDOUT: !entry:
  374. // CHECK:STDOUT: %a.ref: %D = name_ref a, %a
  375. // CHECK:STDOUT: %b.ref: %D = name_ref b, %b
  376. // CHECK:STDOUT: return <error>
  377. // CHECK:STDOUT: }
  378. // CHECK:STDOUT:
  379. // CHECK:STDOUT: generic fn @NotEqual(constants.%Self: %.4) {
  380. // CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)]
  381. // CHECK:STDOUT:
  382. // CHECK:STDOUT: fn[%self: @NotEqual.%Self (%Self)](%other: @NotEqual.%Self (%Self)) -> bool;
  383. // CHECK:STDOUT: }
  384. // CHECK:STDOUT:
  385. // CHECK:STDOUT: specific @Equal(constants.%Self) {
  386. // CHECK:STDOUT: %Self => constants.%Self
  387. // CHECK:STDOUT: }
  388. // CHECK:STDOUT:
  389. // CHECK:STDOUT: specific @NotEqual(constants.%Self) {
  390. // CHECK:STDOUT: %Self => constants.%Self
  391. // CHECK:STDOUT: }
  392. // CHECK:STDOUT:
  393. // CHECK:STDOUT: --- fail_no_impl_for_args.carbon
  394. // CHECK:STDOUT:
  395. // CHECK:STDOUT: constants {
  396. // CHECK:STDOUT: %C: type = class_type @C [template]
  397. // CHECK:STDOUT: %.1: type = struct_type {} [template]
  398. // CHECK:STDOUT: %D: type = class_type @D [template]
  399. // CHECK:STDOUT: %.2: type = interface_type @Eq [template]
  400. // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic]
  401. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template]
  402. // CHECK:STDOUT: %.3: type = tuple_type () [template]
  403. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template]
  404. // CHECK:STDOUT: %Equal.type.1: type = fn_type @Equal.1 [template]
  405. // CHECK:STDOUT: %Equal.1: %Equal.type.1 = struct_value () [template]
  406. // CHECK:STDOUT: %NotEqual.type.1: type = fn_type @NotEqual.1 [template]
  407. // CHECK:STDOUT: %NotEqual.1: %NotEqual.type.1 = struct_value () [template]
  408. // CHECK:STDOUT: %Equal.type.2: type = fn_type @Equal.2 [template]
  409. // CHECK:STDOUT: %Equal.2: %Equal.type.2 = struct_value () [template]
  410. // CHECK:STDOUT: %NotEqual.type.2: type = fn_type @NotEqual.2 [template]
  411. // CHECK:STDOUT: %NotEqual.2: %NotEqual.type.2 = struct_value () [template]
  412. // CHECK:STDOUT: %.4: <witness> = interface_witness (%Equal.1, %NotEqual.1) [template]
  413. // CHECK:STDOUT: %TestRhsBad.type: type = fn_type @TestRhsBad [template]
  414. // CHECK:STDOUT: %TestRhsBad: %TestRhsBad.type = struct_value () [template]
  415. // CHECK:STDOUT: %.5: type = ptr_type %.1 [template]
  416. // CHECK:STDOUT: %.6: type = assoc_entity_type %.2, %Equal.type.2 [template]
  417. // CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.8 [template]
  418. // CHECK:STDOUT: %TestLhsBad.type: type = fn_type @TestLhsBad [template]
  419. // CHECK:STDOUT: %TestLhsBad: %TestLhsBad.type = struct_value () [template]
  420. // CHECK:STDOUT: %.8: type = assoc_entity_type %.2, %NotEqual.type.2 [template]
  421. // CHECK:STDOUT: %.9: %.8 = assoc_entity element1, imports.%import_ref.9 [template]
  422. // CHECK:STDOUT: }
  423. // CHECK:STDOUT:
  424. // CHECK:STDOUT: imports {
  425. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  426. // CHECK:STDOUT: .Eq = %import_ref.1
  427. // CHECK:STDOUT: .Bool = %import_ref.7
  428. // CHECK:STDOUT: import Core//prelude
  429. // CHECK:STDOUT: import Core//prelude/operators
  430. // CHECK:STDOUT: import Core//prelude/types
  431. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  432. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  433. // CHECK:STDOUT: import Core//prelude/operators/comparison
  434. // CHECK:STDOUT: import Core//prelude/types/bool
  435. // CHECK:STDOUT: }
  436. // CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.2]
  437. // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/comparison, inst+5, unloaded
  438. // CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/comparison, inst+31, loaded [template = constants.%.7]
  439. // CHECK:STDOUT: %import_ref.4: %.8 = import_ref Core//prelude/operators/comparison, inst+52, loaded [template = constants.%.9]
  440. // CHECK:STDOUT: %import_ref.5: %Equal.type.2 = import_ref Core//prelude/operators/comparison, inst+26, loaded [template = constants.%Equal.2]
  441. // CHECK:STDOUT: %import_ref.6: %NotEqual.type.2 = import_ref Core//prelude/operators/comparison, inst+47, loaded [template = constants.%NotEqual.2]
  442. // CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool]
  443. // CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+26, unloaded
  444. // CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/comparison, inst+47, unloaded
  445. // CHECK:STDOUT: }
  446. // CHECK:STDOUT:
  447. // CHECK:STDOUT: file {
  448. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  449. // CHECK:STDOUT: .Core = imports.%Core
  450. // CHECK:STDOUT: .C = %C.decl
  451. // CHECK:STDOUT: .D = %D.decl
  452. // CHECK:STDOUT: .TestRhsBad = %TestRhsBad.decl
  453. // CHECK:STDOUT: .TestLhsBad = %TestLhsBad.decl
  454. // CHECK:STDOUT: }
  455. // CHECK:STDOUT: %Core.import = import Core
  456. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
  457. // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {}
  458. // CHECK:STDOUT: impl_decl @impl {
  459. // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C]
  460. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
  461. // CHECK:STDOUT: %Eq.ref: type = name_ref Eq, imports.%import_ref.1 [template = constants.%.2]
  462. // CHECK:STDOUT: }
  463. // CHECK:STDOUT: %TestRhsBad.decl: %TestRhsBad.type = fn_decl @TestRhsBad [template = constants.%TestRhsBad] {
  464. // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, %C.decl [template = constants.%C]
  465. // CHECK:STDOUT: %a.loc12_15.1: %C = param a
  466. // CHECK:STDOUT: @TestRhsBad.%a: %C = bind_name a, %a.loc12_15.1
  467. // CHECK:STDOUT: %D.ref.loc12: type = name_ref D, %D.decl [template = constants.%D]
  468. // CHECK:STDOUT: %b.loc12_21.1: %D = param b
  469. // CHECK:STDOUT: @TestRhsBad.%b: %D = bind_name b, %b.loc12_21.1
  470. // CHECK:STDOUT: %bool.make_type.loc12: init type = call constants.%Bool() [template = bool]
  471. // CHECK:STDOUT: %.loc12_30.1: type = value_of_initializer %bool.make_type.loc12 [template = bool]
  472. // CHECK:STDOUT: %.loc12_30.2: type = converted %bool.make_type.loc12, %.loc12_30.1 [template = bool]
  473. // CHECK:STDOUT: @TestRhsBad.%return: ref bool = var <return slot>
  474. // CHECK:STDOUT: }
  475. // CHECK:STDOUT: %TestLhsBad.decl: %TestLhsBad.type = fn_decl @TestLhsBad [template = constants.%TestLhsBad] {
  476. // CHECK:STDOUT: %D.ref.loc23: type = name_ref D, %D.decl [template = constants.%D]
  477. // CHECK:STDOUT: %a.loc23_15.1: %D = param a
  478. // CHECK:STDOUT: @TestLhsBad.%a: %D = bind_name a, %a.loc23_15.1
  479. // CHECK:STDOUT: %C.ref.loc23: type = name_ref C, %C.decl [template = constants.%C]
  480. // CHECK:STDOUT: %b.loc23_21.1: %C = param b
  481. // CHECK:STDOUT: @TestLhsBad.%b: %C = bind_name b, %b.loc23_21.1
  482. // CHECK:STDOUT: %bool.make_type.loc23: init type = call constants.%Bool() [template = bool]
  483. // CHECK:STDOUT: %.loc23_30.1: type = value_of_initializer %bool.make_type.loc23 [template = bool]
  484. // CHECK:STDOUT: %.loc23_30.2: type = converted %bool.make_type.loc23, %.loc23_30.1 [template = bool]
  485. // CHECK:STDOUT: @TestLhsBad.%return: ref bool = var <return slot>
  486. // CHECK:STDOUT: }
  487. // CHECK:STDOUT: }
  488. // CHECK:STDOUT:
  489. // CHECK:STDOUT: interface @Eq {
  490. // CHECK:STDOUT: !members:
  491. // CHECK:STDOUT: .Self = imports.%import_ref.2
  492. // CHECK:STDOUT: .Equal = imports.%import_ref.3
  493. // CHECK:STDOUT: .NotEqual = imports.%import_ref.4
  494. // CHECK:STDOUT: witness = (imports.%import_ref.5, imports.%import_ref.6)
  495. // CHECK:STDOUT: }
  496. // CHECK:STDOUT:
  497. // CHECK:STDOUT: impl @impl: %C as %.2 {
  498. // CHECK:STDOUT: %Equal.decl: %Equal.type.1 = fn_decl @Equal.1 [template = constants.%Equal.1] {
  499. // CHECK:STDOUT: %C.ref.loc8_18: type = name_ref C, file.%C.decl [template = constants.%C]
  500. // CHECK:STDOUT: %self.loc8_12.1: %C = param self
  501. // CHECK:STDOUT: %self.loc8_12.2: %C = bind_name self, %self.loc8_12.1
  502. // CHECK:STDOUT: %C.ref.loc8_28: type = name_ref C, file.%C.decl [template = constants.%C]
  503. // CHECK:STDOUT: %other.loc8_21.1: %C = param other
  504. // CHECK:STDOUT: %other.loc8_21.2: %C = bind_name other, %other.loc8_21.1
  505. // CHECK:STDOUT: %bool.make_type.loc8: init type = call constants.%Bool() [template = bool]
  506. // CHECK:STDOUT: %.loc8_34.1: type = value_of_initializer %bool.make_type.loc8 [template = bool]
  507. // CHECK:STDOUT: %.loc8_34.2: type = converted %bool.make_type.loc8, %.loc8_34.1 [template = bool]
  508. // CHECK:STDOUT: %return.var.loc8: ref bool = var <return slot>
  509. // CHECK:STDOUT: }
  510. // CHECK:STDOUT: %NotEqual.decl: %NotEqual.type.1 = fn_decl @NotEqual.1 [template = constants.%NotEqual.1] {
  511. // CHECK:STDOUT: %C.ref.loc9_21: type = name_ref C, file.%C.decl [template = constants.%C]
  512. // CHECK:STDOUT: %self.loc9_15.1: %C = param self
  513. // CHECK:STDOUT: %self.loc9_15.2: %C = bind_name self, %self.loc9_15.1
  514. // CHECK:STDOUT: %C.ref.loc9_31: type = name_ref C, file.%C.decl [template = constants.%C]
  515. // CHECK:STDOUT: %other.loc9_24.1: %C = param other
  516. // CHECK:STDOUT: %other.loc9_24.2: %C = bind_name other, %other.loc9_24.1
  517. // CHECK:STDOUT: %bool.make_type.loc9: init type = call constants.%Bool() [template = bool]
  518. // CHECK:STDOUT: %.loc9_37.1: type = value_of_initializer %bool.make_type.loc9 [template = bool]
  519. // CHECK:STDOUT: %.loc9_37.2: type = converted %bool.make_type.loc9, %.loc9_37.1 [template = bool]
  520. // CHECK:STDOUT: %return.var.loc9: ref bool = var <return slot>
  521. // CHECK:STDOUT: }
  522. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Equal.decl, %NotEqual.decl) [template = constants.%.4]
  523. // CHECK:STDOUT:
  524. // CHECK:STDOUT: !members:
  525. // CHECK:STDOUT: .Equal = %Equal.decl
  526. // CHECK:STDOUT: .NotEqual = %NotEqual.decl
  527. // CHECK:STDOUT: witness = %.1
  528. // CHECK:STDOUT: }
  529. // CHECK:STDOUT:
  530. // CHECK:STDOUT: class @C {
  531. // CHECK:STDOUT: !members:
  532. // CHECK:STDOUT: .Self = constants.%C
  533. // CHECK:STDOUT: }
  534. // CHECK:STDOUT:
  535. // CHECK:STDOUT: class @D {
  536. // CHECK:STDOUT: !members:
  537. // CHECK:STDOUT: .Self = constants.%D
  538. // CHECK:STDOUT: }
  539. // CHECK:STDOUT:
  540. // CHECK:STDOUT: fn @Bool() -> type = "bool.make_type";
  541. // CHECK:STDOUT:
  542. // CHECK:STDOUT: fn @Equal.1[@impl.%self.loc8_12.2: %C](@impl.%other.loc8_21.2: %C) -> bool;
  543. // CHECK:STDOUT:
  544. // CHECK:STDOUT: fn @NotEqual.1[@impl.%self.loc9_15.2: %C](@impl.%other.loc9_24.2: %C) -> bool;
  545. // CHECK:STDOUT:
  546. // CHECK:STDOUT: generic fn @Equal.2(constants.%Self: %.2) {
  547. // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)]
  548. // CHECK:STDOUT:
  549. // CHECK:STDOUT: fn[%self: @Equal.2.%Self (%Self)](%other: @Equal.2.%Self (%Self)) -> bool;
  550. // CHECK:STDOUT: }
  551. // CHECK:STDOUT:
  552. // CHECK:STDOUT: generic fn @NotEqual.2(constants.%Self: %.2) {
  553. // CHECK:STDOUT: %Self: %.2 = bind_symbolic_name Self 0 [symbolic = %Self (constants.%Self)]
  554. // CHECK:STDOUT:
  555. // CHECK:STDOUT: fn[%self: @NotEqual.2.%Self (%Self)](%other: @NotEqual.2.%Self (%Self)) -> bool;
  556. // CHECK:STDOUT: }
  557. // CHECK:STDOUT:
  558. // CHECK:STDOUT: fn @TestRhsBad(%a: %C, %b: %D) -> bool {
  559. // CHECK:STDOUT: !entry:
  560. // CHECK:STDOUT: %a.ref: %C = name_ref a, %a
  561. // CHECK:STDOUT: %b.ref: %D = name_ref b, %b
  562. // CHECK:STDOUT: %.1: %Equal.type.2 = interface_witness_access @impl.%.1, element0 [template = constants.%Equal.1]
  563. // CHECK:STDOUT: %.loc20_12: <bound method> = bound_method %a.ref, %.1
  564. // CHECK:STDOUT: %Equal.call: init bool = call %.loc20_12(<invalid>) [template = <error>]
  565. // CHECK:STDOUT: %.loc20_16.1: bool = value_of_initializer %Equal.call [template = <error>]
  566. // CHECK:STDOUT: %.loc20_16.2: bool = converted %Equal.call, %.loc20_16.1 [template = <error>]
  567. // CHECK:STDOUT: return %.loc20_16.2
  568. // CHECK:STDOUT: }
  569. // CHECK:STDOUT:
  570. // CHECK:STDOUT: fn @TestLhsBad(%a: %D, %b: %C) -> bool {
  571. // CHECK:STDOUT: !entry:
  572. // CHECK:STDOUT: %a.ref: %D = name_ref a, %a
  573. // CHECK:STDOUT: %b.ref: %C = name_ref b, %b
  574. // CHECK:STDOUT: return <error>
  575. // CHECK:STDOUT: }
  576. // CHECK:STDOUT:
  577. // CHECK:STDOUT: specific @Equal.2(constants.%Self) {
  578. // CHECK:STDOUT: %Self => constants.%Self
  579. // CHECK:STDOUT: }
  580. // CHECK:STDOUT:
  581. // CHECK:STDOUT: specific @Equal.2(constants.%C) {
  582. // CHECK:STDOUT: %Self => constants.%C
  583. // CHECK:STDOUT: }
  584. // CHECK:STDOUT:
  585. // CHECK:STDOUT: specific @NotEqual.2(constants.%Self) {
  586. // CHECK:STDOUT: %Self => constants.%Self
  587. // CHECK:STDOUT: }
  588. // CHECK:STDOUT:
  589. // CHECK:STDOUT: specific @NotEqual.2(constants.%C) {
  590. // CHECK:STDOUT: %Self => constants.%C
  591. // CHECK:STDOUT: }
  592. // CHECK:STDOUT: