eq.carbon 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon
  6. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  7. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  8. //
  9. // AUTOUPDATE
  10. // TIP: To test this file alone, run:
  11. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/operators/overloaded/eq.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/overloaded/eq.carbon
  14. // --- user.carbon
  15. package User;
  16. class C {};
  17. impl C as Core.EqWith(C) {
  18. fn Equal[self: C](other: C) -> bool;
  19. fn NotEqual[self: C](other: C) -> bool;
  20. }
  21. fn TestEqual(a: C, b: C) -> bool {
  22. return a == b;
  23. }
  24. fn TestNotEqual(a: C, b: C) -> bool {
  25. return a != b;
  26. }
  27. // --- fail_no_impl.carbon
  28. package FailNoImpl;
  29. class D {};
  30. fn TestEqual(a: D, b: D) -> bool {
  31. // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.EqWith(D)` in type `D` that does not implement that interface [MissingImplInMemberAccess]
  32. // CHECK:STDERR: return a == b;
  33. // CHECK:STDERR: ^~~~~~
  34. // CHECK:STDERR:
  35. return a == b;
  36. }
  37. fn TestNotEqual(a: D, b: D) -> bool {
  38. // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.EqWith(D)` in type `D` that does not implement that interface [MissingImplInMemberAccess]
  39. // CHECK:STDERR: return a != b;
  40. // CHECK:STDERR: ^~~~~~
  41. // CHECK:STDERR:
  42. return a != b;
  43. }
  44. // --- fail_no_impl_for_args.carbon
  45. package FailNoImplForArgs;
  46. class C {};
  47. class D {};
  48. impl C as Core.EqWith(C) {
  49. fn Equal[self: C](other: C) -> bool;
  50. fn NotEqual[self: C](other: C) -> bool;
  51. }
  52. fn TestRhsBad(a: C, b: D) -> bool {
  53. // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.EqWith(D)` in type `C` that does not implement that interface [MissingImplInMemberAccess]
  54. // CHECK:STDERR: return a == b;
  55. // CHECK:STDERR: ^~~~~~
  56. // CHECK:STDERR:
  57. return a == b;
  58. }
  59. fn TestLhsBad(a: D, b: C) -> bool {
  60. // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.EqWith(C)` in type `D` that does not implement that interface [MissingImplInMemberAccess]
  61. // CHECK:STDERR: return a != b;
  62. // CHECK:STDERR: ^~~~~~
  63. // CHECK:STDERR:
  64. return a != b;
  65. }
  66. // CHECK:STDOUT: --- user.carbon
  67. // CHECK:STDOUT:
  68. // CHECK:STDOUT: constants {
  69. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  70. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  71. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  72. // CHECK:STDOUT: %EqWith.type.c2e: type = generic_interface_type @EqWith [concrete]
  73. // CHECK:STDOUT: %EqWith.generic: %EqWith.type.c2e = struct_value () [concrete]
  74. // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete]
  75. // CHECK:STDOUT: %.650: form = init_form bool, call_param2 [concrete]
  76. // CHECK:STDOUT: %EqWith.type.ae7: type = facet_type <@EqWith, @EqWith(%C)> [concrete]
  77. // CHECK:STDOUT: %EqWith.impl_witness: <witness> = impl_witness @C.as.EqWith.impl.%EqWith.impl_witness_table [concrete]
  78. // CHECK:STDOUT: %EqWith.Equal.type.ab8: type = fn_type @EqWith.Equal, @EqWith(%C) [concrete]
  79. // CHECK:STDOUT: %EqWith.NotEqual.type.d5e: type = fn_type @EqWith.NotEqual, @EqWith(%C) [concrete]
  80. // CHECK:STDOUT: %pattern_type.476: type = pattern_type %C [concrete]
  81. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
  82. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
  83. // CHECK:STDOUT: %C.as.EqWith.impl.Equal.type: type = fn_type @C.as.EqWith.impl.Equal [concrete]
  84. // CHECK:STDOUT: %C.as.EqWith.impl.Equal: %C.as.EqWith.impl.Equal.type = struct_value () [concrete]
  85. // CHECK:STDOUT: %C.as.EqWith.impl.NotEqual.type: type = fn_type @C.as.EqWith.impl.NotEqual [concrete]
  86. // CHECK:STDOUT: %C.as.EqWith.impl.NotEqual: %C.as.EqWith.impl.NotEqual.type = struct_value () [concrete]
  87. // CHECK:STDOUT: %EqWith.facet: %EqWith.type.ae7 = facet_value %C, (%EqWith.impl_witness) [concrete]
  88. // CHECK:STDOUT: %TestEqual.type: type = fn_type @TestEqual [concrete]
  89. // CHECK:STDOUT: %TestEqual: %TestEqual.type = struct_value () [concrete]
  90. // CHECK:STDOUT: %.5c2: type = fn_type_with_self_type %EqWith.Equal.type.ab8, %EqWith.facet [concrete]
  91. // CHECK:STDOUT: %TestNotEqual.type: type = fn_type @TestNotEqual [concrete]
  92. // CHECK:STDOUT: %TestNotEqual: %TestNotEqual.type = struct_value () [concrete]
  93. // CHECK:STDOUT: %.371: type = fn_type_with_self_type %EqWith.NotEqual.type.d5e, %EqWith.facet [concrete]
  94. // CHECK:STDOUT: }
  95. // CHECK:STDOUT:
  96. // CHECK:STDOUT: imports {
  97. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  98. // CHECK:STDOUT: .EqWith = %Core.EqWith
  99. // CHECK:STDOUT: .Bool = %Core.Bool
  100. // CHECK:STDOUT: import Core//prelude
  101. // CHECK:STDOUT: import Core//prelude/...
  102. // CHECK:STDOUT: }
  103. // CHECK:STDOUT: %Core.EqWith: %EqWith.type.c2e = import_ref Core//prelude/operators/comparison, EqWith, loaded [concrete = constants.%EqWith.generic]
  104. // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
  105. // CHECK:STDOUT: }
  106. // CHECK:STDOUT:
  107. // CHECK:STDOUT: file {
  108. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  109. // CHECK:STDOUT: .Core = imports.%Core
  110. // CHECK:STDOUT: .C = %C.decl
  111. // CHECK:STDOUT: .TestEqual = %TestEqual.decl
  112. // CHECK:STDOUT: .TestNotEqual = %TestNotEqual.decl
  113. // CHECK:STDOUT: }
  114. // CHECK:STDOUT: %Core.import = import Core
  115. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  116. // CHECK:STDOUT: impl_decl @C.as.EqWith.impl [concrete] {} {
  117. // CHECK:STDOUT: %C.ref.loc6_6: type = name_ref C, file.%C.decl [concrete = constants.%C]
  118. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  119. // CHECK:STDOUT: %EqWith.ref: %EqWith.type.c2e = name_ref EqWith, imports.%Core.EqWith [concrete = constants.%EqWith.generic]
  120. // CHECK:STDOUT: %C.ref.loc6_23: type = name_ref C, file.%C.decl [concrete = constants.%C]
  121. // CHECK:STDOUT: %EqWith.type: type = facet_type <@EqWith, @EqWith(constants.%C)> [concrete = constants.%EqWith.type.ae7]
  122. // CHECK:STDOUT: }
  123. // CHECK:STDOUT: %TestEqual.decl: %TestEqual.type = fn_decl @TestEqual [concrete = constants.%TestEqual] {
  124. // CHECK:STDOUT: %a.patt: %pattern_type.476 = value_binding_pattern a [concrete]
  125. // CHECK:STDOUT: %a.param_patt: %pattern_type.476 = value_param_pattern %a.patt, call_param0 [concrete]
  126. // CHECK:STDOUT: %b.patt: %pattern_type.476 = value_binding_pattern b [concrete]
  127. // CHECK:STDOUT: %b.param_patt: %pattern_type.476 = value_param_pattern %b.patt, call_param1 [concrete]
  128. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  129. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  130. // CHECK:STDOUT: } {
  131. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  132. // CHECK:STDOUT: %.loc11_29.1: type = value_of_initializer %Bool.call [concrete = bool]
  133. // CHECK:STDOUT: %.loc11_29.2: type = converted %Bool.call, %.loc11_29.1 [concrete = bool]
  134. // CHECK:STDOUT: %.loc11_29.3: form = init_form %.loc11_29.2, call_param2 [concrete = constants.%.650]
  135. // CHECK:STDOUT: %a.param: %C = value_param call_param0
  136. // CHECK:STDOUT: %C.ref.loc11_17: type = name_ref C, file.%C.decl [concrete = constants.%C]
  137. // CHECK:STDOUT: %a: %C = value_binding a, %a.param
  138. // CHECK:STDOUT: %b.param: %C = value_param call_param1
  139. // CHECK:STDOUT: %C.ref.loc11_23: type = name_ref C, file.%C.decl [concrete = constants.%C]
  140. // CHECK:STDOUT: %b: %C = value_binding b, %b.param
  141. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  142. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  143. // CHECK:STDOUT: }
  144. // CHECK:STDOUT: %TestNotEqual.decl: %TestNotEqual.type = fn_decl @TestNotEqual [concrete = constants.%TestNotEqual] {
  145. // CHECK:STDOUT: %a.patt: %pattern_type.476 = value_binding_pattern a [concrete]
  146. // CHECK:STDOUT: %a.param_patt: %pattern_type.476 = value_param_pattern %a.patt, call_param0 [concrete]
  147. // CHECK:STDOUT: %b.patt: %pattern_type.476 = value_binding_pattern b [concrete]
  148. // CHECK:STDOUT: %b.param_patt: %pattern_type.476 = value_param_pattern %b.patt, call_param1 [concrete]
  149. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  150. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  151. // CHECK:STDOUT: } {
  152. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  153. // CHECK:STDOUT: %.loc15_32.1: type = value_of_initializer %Bool.call [concrete = bool]
  154. // CHECK:STDOUT: %.loc15_32.2: type = converted %Bool.call, %.loc15_32.1 [concrete = bool]
  155. // CHECK:STDOUT: %.loc15_32.3: form = init_form %.loc15_32.2, call_param2 [concrete = constants.%.650]
  156. // CHECK:STDOUT: %a.param: %C = value_param call_param0
  157. // CHECK:STDOUT: %C.ref.loc15_20: type = name_ref C, file.%C.decl [concrete = constants.%C]
  158. // CHECK:STDOUT: %a: %C = value_binding a, %a.param
  159. // CHECK:STDOUT: %b.param: %C = value_param call_param1
  160. // CHECK:STDOUT: %C.ref.loc15_26: type = name_ref C, file.%C.decl [concrete = constants.%C]
  161. // CHECK:STDOUT: %b: %C = value_binding b, %b.param
  162. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  163. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  164. // CHECK:STDOUT: }
  165. // CHECK:STDOUT: }
  166. // CHECK:STDOUT:
  167. // CHECK:STDOUT: impl @C.as.EqWith.impl: %C.ref.loc6_6 as %EqWith.type {
  168. // CHECK:STDOUT: %C.as.EqWith.impl.Equal.decl: %C.as.EqWith.impl.Equal.type = fn_decl @C.as.EqWith.impl.Equal [concrete = constants.%C.as.EqWith.impl.Equal] {
  169. // CHECK:STDOUT: %self.patt: %pattern_type.476 = value_binding_pattern self [concrete]
  170. // CHECK:STDOUT: %self.param_patt: %pattern_type.476 = value_param_pattern %self.patt, call_param0 [concrete]
  171. // CHECK:STDOUT: %other.patt: %pattern_type.476 = value_binding_pattern other [concrete]
  172. // CHECK:STDOUT: %other.param_patt: %pattern_type.476 = value_param_pattern %other.patt, call_param1 [concrete]
  173. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  174. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  175. // CHECK:STDOUT: } {
  176. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  177. // CHECK:STDOUT: %.loc7_34.1: type = value_of_initializer %Bool.call [concrete = bool]
  178. // CHECK:STDOUT: %.loc7_34.2: type = converted %Bool.call, %.loc7_34.1 [concrete = bool]
  179. // CHECK:STDOUT: %.loc7_34.3: form = init_form %.loc7_34.2, call_param2 [concrete = constants.%.650]
  180. // CHECK:STDOUT: %self.param: %C = value_param call_param0
  181. // CHECK:STDOUT: %C.ref.loc7_18: type = name_ref C, file.%C.decl [concrete = constants.%C]
  182. // CHECK:STDOUT: %self: %C = value_binding self, %self.param
  183. // CHECK:STDOUT: %other.param: %C = value_param call_param1
  184. // CHECK:STDOUT: %C.ref.loc7_28: type = name_ref C, file.%C.decl [concrete = constants.%C]
  185. // CHECK:STDOUT: %other: %C = value_binding other, %other.param
  186. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  187. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  188. // CHECK:STDOUT: }
  189. // CHECK:STDOUT: %C.as.EqWith.impl.NotEqual.decl: %C.as.EqWith.impl.NotEqual.type = fn_decl @C.as.EqWith.impl.NotEqual [concrete = constants.%C.as.EqWith.impl.NotEqual] {
  190. // CHECK:STDOUT: %self.patt: %pattern_type.476 = value_binding_pattern self [concrete]
  191. // CHECK:STDOUT: %self.param_patt: %pattern_type.476 = value_param_pattern %self.patt, call_param0 [concrete]
  192. // CHECK:STDOUT: %other.patt: %pattern_type.476 = value_binding_pattern other [concrete]
  193. // CHECK:STDOUT: %other.param_patt: %pattern_type.476 = value_param_pattern %other.patt, call_param1 [concrete]
  194. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  195. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  196. // CHECK:STDOUT: } {
  197. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  198. // CHECK:STDOUT: %.loc8_37.1: type = value_of_initializer %Bool.call [concrete = bool]
  199. // CHECK:STDOUT: %.loc8_37.2: type = converted %Bool.call, %.loc8_37.1 [concrete = bool]
  200. // CHECK:STDOUT: %.loc8_37.3: form = init_form %.loc8_37.2, call_param2 [concrete = constants.%.650]
  201. // CHECK:STDOUT: %self.param: %C = value_param call_param0
  202. // CHECK:STDOUT: %C.ref.loc8_21: type = name_ref C, file.%C.decl [concrete = constants.%C]
  203. // CHECK:STDOUT: %self: %C = value_binding self, %self.param
  204. // CHECK:STDOUT: %other.param: %C = value_param call_param1
  205. // CHECK:STDOUT: %C.ref.loc8_31: type = name_ref C, file.%C.decl [concrete = constants.%C]
  206. // CHECK:STDOUT: %other: %C = value_binding other, %other.param
  207. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  208. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  209. // CHECK:STDOUT: }
  210. // CHECK:STDOUT: %EqWith.impl_witness_table = impl_witness_table (%C.as.EqWith.impl.Equal.decl, %C.as.EqWith.impl.NotEqual.decl), @C.as.EqWith.impl [concrete]
  211. // CHECK:STDOUT: %EqWith.impl_witness: <witness> = impl_witness %EqWith.impl_witness_table [concrete = constants.%EqWith.impl_witness]
  212. // CHECK:STDOUT:
  213. // CHECK:STDOUT: !members:
  214. // CHECK:STDOUT: .C = <poisoned>
  215. // CHECK:STDOUT: .Equal = %C.as.EqWith.impl.Equal.decl
  216. // CHECK:STDOUT: .NotEqual = %C.as.EqWith.impl.NotEqual.decl
  217. // CHECK:STDOUT: witness = %EqWith.impl_witness
  218. // CHECK:STDOUT: }
  219. // CHECK:STDOUT:
  220. // CHECK:STDOUT: class @C {
  221. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  222. // CHECK:STDOUT: complete_type_witness = %complete_type
  223. // CHECK:STDOUT:
  224. // CHECK:STDOUT: !members:
  225. // CHECK:STDOUT: .Self = constants.%C
  226. // CHECK:STDOUT: }
  227. // CHECK:STDOUT:
  228. // CHECK:STDOUT: fn @C.as.EqWith.impl.Equal(%self.param: %C, %other.param: %C) -> bool;
  229. // CHECK:STDOUT:
  230. // CHECK:STDOUT: fn @C.as.EqWith.impl.NotEqual(%self.param: %C, %other.param: %C) -> bool;
  231. // CHECK:STDOUT:
  232. // CHECK:STDOUT: fn @TestEqual(%a.param: %C, %b.param: %C) -> bool {
  233. // CHECK:STDOUT: !entry:
  234. // CHECK:STDOUT: %a.ref: %C = name_ref a, %a
  235. // CHECK:STDOUT: %b.ref: %C = name_ref b, %b
  236. // CHECK:STDOUT: %impl.elem0: %.5c2 = impl_witness_access constants.%EqWith.impl_witness, element0 [concrete = constants.%C.as.EqWith.impl.Equal]
  237. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.ref, %impl.elem0
  238. // CHECK:STDOUT: %C.as.EqWith.impl.Equal.call: init bool = call %bound_method(%a.ref, %b.ref)
  239. // CHECK:STDOUT: return %C.as.EqWith.impl.Equal.call to %return.param
  240. // CHECK:STDOUT: }
  241. // CHECK:STDOUT:
  242. // CHECK:STDOUT: fn @TestNotEqual(%a.param: %C, %b.param: %C) -> bool {
  243. // CHECK:STDOUT: !entry:
  244. // CHECK:STDOUT: %a.ref: %C = name_ref a, %a
  245. // CHECK:STDOUT: %b.ref: %C = name_ref b, %b
  246. // CHECK:STDOUT: %impl.elem1: %.371 = impl_witness_access constants.%EqWith.impl_witness, element1 [concrete = constants.%C.as.EqWith.impl.NotEqual]
  247. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.ref, %impl.elem1
  248. // CHECK:STDOUT: %C.as.EqWith.impl.NotEqual.call: init bool = call %bound_method(%a.ref, %b.ref)
  249. // CHECK:STDOUT: return %C.as.EqWith.impl.NotEqual.call to %return.param
  250. // CHECK:STDOUT: }
  251. // CHECK:STDOUT:
  252. // CHECK:STDOUT: --- fail_no_impl.carbon
  253. // CHECK:STDOUT:
  254. // CHECK:STDOUT: constants {
  255. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  256. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  257. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  258. // CHECK:STDOUT: %pattern_type.54d: type = pattern_type %D [concrete]
  259. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
  260. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
  261. // CHECK:STDOUT: %.650: form = init_form bool, call_param2 [concrete]
  262. // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete]
  263. // CHECK:STDOUT: %TestEqual.type: type = fn_type @TestEqual [concrete]
  264. // CHECK:STDOUT: %TestEqual: %TestEqual.type = struct_value () [concrete]
  265. // CHECK:STDOUT: %EqWith.type.c2e: type = generic_interface_type @EqWith [concrete]
  266. // CHECK:STDOUT: %EqWith.generic: %EqWith.type.c2e = struct_value () [concrete]
  267. // CHECK:STDOUT: %TestNotEqual.type: type = fn_type @TestNotEqual [concrete]
  268. // CHECK:STDOUT: %TestNotEqual: %TestNotEqual.type = struct_value () [concrete]
  269. // CHECK:STDOUT: }
  270. // CHECK:STDOUT:
  271. // CHECK:STDOUT: imports {
  272. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  273. // CHECK:STDOUT: .Bool = %Core.Bool
  274. // CHECK:STDOUT: .EqWith = %Core.EqWith
  275. // CHECK:STDOUT: import Core//prelude
  276. // CHECK:STDOUT: import Core//prelude/...
  277. // CHECK:STDOUT: }
  278. // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
  279. // CHECK:STDOUT: %Core.EqWith: %EqWith.type.c2e = import_ref Core//prelude/operators/comparison, EqWith, loaded [concrete = constants.%EqWith.generic]
  280. // CHECK:STDOUT: }
  281. // CHECK:STDOUT:
  282. // CHECK:STDOUT: file {
  283. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  284. // CHECK:STDOUT: .Core = imports.%Core
  285. // CHECK:STDOUT: .D = %D.decl
  286. // CHECK:STDOUT: .TestEqual = %TestEqual.decl
  287. // CHECK:STDOUT: .TestNotEqual = %TestNotEqual.decl
  288. // CHECK:STDOUT: }
  289. // CHECK:STDOUT: %Core.import = import Core
  290. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  291. // CHECK:STDOUT: %TestEqual.decl: %TestEqual.type = fn_decl @TestEqual [concrete = constants.%TestEqual] {
  292. // CHECK:STDOUT: %a.patt: %pattern_type.54d = value_binding_pattern a [concrete]
  293. // CHECK:STDOUT: %a.param_patt: %pattern_type.54d = value_param_pattern %a.patt, call_param0 [concrete]
  294. // CHECK:STDOUT: %b.patt: %pattern_type.54d = value_binding_pattern b [concrete]
  295. // CHECK:STDOUT: %b.param_patt: %pattern_type.54d = value_param_pattern %b.patt, call_param1 [concrete]
  296. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  297. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  298. // CHECK:STDOUT: } {
  299. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  300. // CHECK:STDOUT: %.loc6_29.1: type = value_of_initializer %Bool.call [concrete = bool]
  301. // CHECK:STDOUT: %.loc6_29.2: type = converted %Bool.call, %.loc6_29.1 [concrete = bool]
  302. // CHECK:STDOUT: %.loc6_29.3: form = init_form %.loc6_29.2, call_param2 [concrete = constants.%.650]
  303. // CHECK:STDOUT: %a.param: %D = value_param call_param0
  304. // CHECK:STDOUT: %D.ref.loc6_17: type = name_ref D, file.%D.decl [concrete = constants.%D]
  305. // CHECK:STDOUT: %a: %D = value_binding a, %a.param
  306. // CHECK:STDOUT: %b.param: %D = value_param call_param1
  307. // CHECK:STDOUT: %D.ref.loc6_23: type = name_ref D, file.%D.decl [concrete = constants.%D]
  308. // CHECK:STDOUT: %b: %D = value_binding b, %b.param
  309. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  310. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  311. // CHECK:STDOUT: }
  312. // CHECK:STDOUT: %TestNotEqual.decl: %TestNotEqual.type = fn_decl @TestNotEqual [concrete = constants.%TestNotEqual] {
  313. // CHECK:STDOUT: %a.patt: %pattern_type.54d = value_binding_pattern a [concrete]
  314. // CHECK:STDOUT: %a.param_patt: %pattern_type.54d = value_param_pattern %a.patt, call_param0 [concrete]
  315. // CHECK:STDOUT: %b.patt: %pattern_type.54d = value_binding_pattern b [concrete]
  316. // CHECK:STDOUT: %b.param_patt: %pattern_type.54d = value_param_pattern %b.patt, call_param1 [concrete]
  317. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  318. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  319. // CHECK:STDOUT: } {
  320. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  321. // CHECK:STDOUT: %.loc14_32.1: type = value_of_initializer %Bool.call [concrete = bool]
  322. // CHECK:STDOUT: %.loc14_32.2: type = converted %Bool.call, %.loc14_32.1 [concrete = bool]
  323. // CHECK:STDOUT: %.loc14_32.3: form = init_form %.loc14_32.2, call_param2 [concrete = constants.%.650]
  324. // CHECK:STDOUT: %a.param: %D = value_param call_param0
  325. // CHECK:STDOUT: %D.ref.loc14_20: type = name_ref D, file.%D.decl [concrete = constants.%D]
  326. // CHECK:STDOUT: %a: %D = value_binding a, %a.param
  327. // CHECK:STDOUT: %b.param: %D = value_param call_param1
  328. // CHECK:STDOUT: %D.ref.loc14_26: type = name_ref D, file.%D.decl [concrete = constants.%D]
  329. // CHECK:STDOUT: %b: %D = value_binding b, %b.param
  330. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  331. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  332. // CHECK:STDOUT: }
  333. // CHECK:STDOUT: }
  334. // CHECK:STDOUT:
  335. // CHECK:STDOUT: class @D {
  336. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  337. // CHECK:STDOUT: complete_type_witness = %complete_type
  338. // CHECK:STDOUT:
  339. // CHECK:STDOUT: !members:
  340. // CHECK:STDOUT: .Self = constants.%D
  341. // CHECK:STDOUT: }
  342. // CHECK:STDOUT:
  343. // CHECK:STDOUT: fn @TestEqual(%a.param: %D, %b.param: %D) -> bool {
  344. // CHECK:STDOUT: !entry:
  345. // CHECK:STDOUT: %a.ref: %D = name_ref a, %a
  346. // CHECK:STDOUT: %b.ref: %D = name_ref b, %b
  347. // CHECK:STDOUT: return <error> to %return.param
  348. // CHECK:STDOUT: }
  349. // CHECK:STDOUT:
  350. // CHECK:STDOUT: fn @TestNotEqual(%a.param: %D, %b.param: %D) -> bool {
  351. // CHECK:STDOUT: !entry:
  352. // CHECK:STDOUT: %a.ref: %D = name_ref a, %a
  353. // CHECK:STDOUT: %b.ref: %D = name_ref b, %b
  354. // CHECK:STDOUT: return <error> to %return.param
  355. // CHECK:STDOUT: }
  356. // CHECK:STDOUT:
  357. // CHECK:STDOUT: --- fail_no_impl_for_args.carbon
  358. // CHECK:STDOUT:
  359. // CHECK:STDOUT: constants {
  360. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  361. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  362. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  363. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  364. // CHECK:STDOUT: %EqWith.type.c2e: type = generic_interface_type @EqWith [concrete]
  365. // CHECK:STDOUT: %EqWith.generic: %EqWith.type.c2e = struct_value () [concrete]
  366. // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete]
  367. // CHECK:STDOUT: %.650: form = init_form bool, call_param2 [concrete]
  368. // CHECK:STDOUT: %EqWith.type.470: type = facet_type <@EqWith, @EqWith(%C)> [concrete]
  369. // CHECK:STDOUT: %EqWith.impl_witness: <witness> = impl_witness @C.as.EqWith.impl.%EqWith.impl_witness_table [concrete]
  370. // CHECK:STDOUT: %pattern_type.224: type = pattern_type %C [concrete]
  371. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
  372. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
  373. // CHECK:STDOUT: %C.as.EqWith.impl.Equal.type: type = fn_type @C.as.EqWith.impl.Equal [concrete]
  374. // CHECK:STDOUT: %C.as.EqWith.impl.Equal: %C.as.EqWith.impl.Equal.type = struct_value () [concrete]
  375. // CHECK:STDOUT: %C.as.EqWith.impl.NotEqual.type: type = fn_type @C.as.EqWith.impl.NotEqual [concrete]
  376. // CHECK:STDOUT: %C.as.EqWith.impl.NotEqual: %C.as.EqWith.impl.NotEqual.type = struct_value () [concrete]
  377. // CHECK:STDOUT: %pattern_type.07d: type = pattern_type %D [concrete]
  378. // CHECK:STDOUT: %TestRhsBad.type: type = fn_type @TestRhsBad [concrete]
  379. // CHECK:STDOUT: %TestRhsBad: %TestRhsBad.type = struct_value () [concrete]
  380. // CHECK:STDOUT: %TestLhsBad.type: type = fn_type @TestLhsBad [concrete]
  381. // CHECK:STDOUT: %TestLhsBad: %TestLhsBad.type = struct_value () [concrete]
  382. // CHECK:STDOUT: }
  383. // CHECK:STDOUT:
  384. // CHECK:STDOUT: imports {
  385. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  386. // CHECK:STDOUT: .EqWith = %Core.EqWith
  387. // CHECK:STDOUT: .Bool = %Core.Bool
  388. // CHECK:STDOUT: import Core//prelude
  389. // CHECK:STDOUT: import Core//prelude/...
  390. // CHECK:STDOUT: }
  391. // CHECK:STDOUT: %Core.EqWith: %EqWith.type.c2e = import_ref Core//prelude/operators/comparison, EqWith, loaded [concrete = constants.%EqWith.generic]
  392. // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
  393. // CHECK:STDOUT: }
  394. // CHECK:STDOUT:
  395. // CHECK:STDOUT: file {
  396. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  397. // CHECK:STDOUT: .Core = imports.%Core
  398. // CHECK:STDOUT: .C = %C.decl
  399. // CHECK:STDOUT: .D = %D.decl
  400. // CHECK:STDOUT: .TestRhsBad = %TestRhsBad.decl
  401. // CHECK:STDOUT: .TestLhsBad = %TestLhsBad.decl
  402. // CHECK:STDOUT: }
  403. // CHECK:STDOUT: %Core.import = import Core
  404. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  405. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  406. // CHECK:STDOUT: impl_decl @C.as.EqWith.impl [concrete] {} {
  407. // CHECK:STDOUT: %C.ref.loc7_6: type = name_ref C, file.%C.decl [concrete = constants.%C]
  408. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  409. // CHECK:STDOUT: %EqWith.ref: %EqWith.type.c2e = name_ref EqWith, imports.%Core.EqWith [concrete = constants.%EqWith.generic]
  410. // CHECK:STDOUT: %C.ref.loc7_23: type = name_ref C, file.%C.decl [concrete = constants.%C]
  411. // CHECK:STDOUT: %EqWith.type: type = facet_type <@EqWith, @EqWith(constants.%C)> [concrete = constants.%EqWith.type.470]
  412. // CHECK:STDOUT: }
  413. // CHECK:STDOUT: %TestRhsBad.decl: %TestRhsBad.type = fn_decl @TestRhsBad [concrete = constants.%TestRhsBad] {
  414. // CHECK:STDOUT: %a.patt: %pattern_type.224 = value_binding_pattern a [concrete]
  415. // CHECK:STDOUT: %a.param_patt: %pattern_type.224 = value_param_pattern %a.patt, call_param0 [concrete]
  416. // CHECK:STDOUT: %b.patt: %pattern_type.07d = value_binding_pattern b [concrete]
  417. // CHECK:STDOUT: %b.param_patt: %pattern_type.07d = value_param_pattern %b.patt, call_param1 [concrete]
  418. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  419. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  420. // CHECK:STDOUT: } {
  421. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  422. // CHECK:STDOUT: %.loc12_30.1: type = value_of_initializer %Bool.call [concrete = bool]
  423. // CHECK:STDOUT: %.loc12_30.2: type = converted %Bool.call, %.loc12_30.1 [concrete = bool]
  424. // CHECK:STDOUT: %.loc12_30.3: form = init_form %.loc12_30.2, call_param2 [concrete = constants.%.650]
  425. // CHECK:STDOUT: %a.param: %C = value_param call_param0
  426. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  427. // CHECK:STDOUT: %a: %C = value_binding a, %a.param
  428. // CHECK:STDOUT: %b.param: %D = value_param call_param1
  429. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
  430. // CHECK:STDOUT: %b: %D = value_binding b, %b.param
  431. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  432. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  433. // CHECK:STDOUT: }
  434. // CHECK:STDOUT: %TestLhsBad.decl: %TestLhsBad.type = fn_decl @TestLhsBad [concrete = constants.%TestLhsBad] {
  435. // CHECK:STDOUT: %a.patt: %pattern_type.07d = value_binding_pattern a [concrete]
  436. // CHECK:STDOUT: %a.param_patt: %pattern_type.07d = value_param_pattern %a.patt, call_param0 [concrete]
  437. // CHECK:STDOUT: %b.patt: %pattern_type.224 = value_binding_pattern b [concrete]
  438. // CHECK:STDOUT: %b.param_patt: %pattern_type.224 = value_param_pattern %b.patt, call_param1 [concrete]
  439. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  440. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  441. // CHECK:STDOUT: } {
  442. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  443. // CHECK:STDOUT: %.loc20_30.1: type = value_of_initializer %Bool.call [concrete = bool]
  444. // CHECK:STDOUT: %.loc20_30.2: type = converted %Bool.call, %.loc20_30.1 [concrete = bool]
  445. // CHECK:STDOUT: %.loc20_30.3: form = init_form %.loc20_30.2, call_param2 [concrete = constants.%.650]
  446. // CHECK:STDOUT: %a.param: %D = value_param call_param0
  447. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
  448. // CHECK:STDOUT: %a: %D = value_binding a, %a.param
  449. // CHECK:STDOUT: %b.param: %C = value_param call_param1
  450. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  451. // CHECK:STDOUT: %b: %C = value_binding b, %b.param
  452. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  453. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  454. // CHECK:STDOUT: }
  455. // CHECK:STDOUT: }
  456. // CHECK:STDOUT:
  457. // CHECK:STDOUT: impl @C.as.EqWith.impl: %C.ref.loc7_6 as %EqWith.type {
  458. // CHECK:STDOUT: %C.as.EqWith.impl.Equal.decl: %C.as.EqWith.impl.Equal.type = fn_decl @C.as.EqWith.impl.Equal [concrete = constants.%C.as.EqWith.impl.Equal] {
  459. // CHECK:STDOUT: %self.patt: %pattern_type.224 = value_binding_pattern self [concrete]
  460. // CHECK:STDOUT: %self.param_patt: %pattern_type.224 = value_param_pattern %self.patt, call_param0 [concrete]
  461. // CHECK:STDOUT: %other.patt: %pattern_type.224 = value_binding_pattern other [concrete]
  462. // CHECK:STDOUT: %other.param_patt: %pattern_type.224 = value_param_pattern %other.patt, call_param1 [concrete]
  463. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  464. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  465. // CHECK:STDOUT: } {
  466. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  467. // CHECK:STDOUT: %.loc8_34.1: type = value_of_initializer %Bool.call [concrete = bool]
  468. // CHECK:STDOUT: %.loc8_34.2: type = converted %Bool.call, %.loc8_34.1 [concrete = bool]
  469. // CHECK:STDOUT: %.loc8_34.3: form = init_form %.loc8_34.2, call_param2 [concrete = constants.%.650]
  470. // CHECK:STDOUT: %self.param: %C = value_param call_param0
  471. // CHECK:STDOUT: %C.ref.loc8_18: type = name_ref C, file.%C.decl [concrete = constants.%C]
  472. // CHECK:STDOUT: %self: %C = value_binding self, %self.param
  473. // CHECK:STDOUT: %other.param: %C = value_param call_param1
  474. // CHECK:STDOUT: %C.ref.loc8_28: type = name_ref C, file.%C.decl [concrete = constants.%C]
  475. // CHECK:STDOUT: %other: %C = value_binding other, %other.param
  476. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  477. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  478. // CHECK:STDOUT: }
  479. // CHECK:STDOUT: %C.as.EqWith.impl.NotEqual.decl: %C.as.EqWith.impl.NotEqual.type = fn_decl @C.as.EqWith.impl.NotEqual [concrete = constants.%C.as.EqWith.impl.NotEqual] {
  480. // CHECK:STDOUT: %self.patt: %pattern_type.224 = value_binding_pattern self [concrete]
  481. // CHECK:STDOUT: %self.param_patt: %pattern_type.224 = value_param_pattern %self.patt, call_param0 [concrete]
  482. // CHECK:STDOUT: %other.patt: %pattern_type.224 = value_binding_pattern other [concrete]
  483. // CHECK:STDOUT: %other.param_patt: %pattern_type.224 = value_param_pattern %other.patt, call_param1 [concrete]
  484. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  485. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  486. // CHECK:STDOUT: } {
  487. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  488. // CHECK:STDOUT: %.loc9_37.1: type = value_of_initializer %Bool.call [concrete = bool]
  489. // CHECK:STDOUT: %.loc9_37.2: type = converted %Bool.call, %.loc9_37.1 [concrete = bool]
  490. // CHECK:STDOUT: %.loc9_37.3: form = init_form %.loc9_37.2, call_param2 [concrete = constants.%.650]
  491. // CHECK:STDOUT: %self.param: %C = value_param call_param0
  492. // CHECK:STDOUT: %C.ref.loc9_21: type = name_ref C, file.%C.decl [concrete = constants.%C]
  493. // CHECK:STDOUT: %self: %C = value_binding self, %self.param
  494. // CHECK:STDOUT: %other.param: %C = value_param call_param1
  495. // CHECK:STDOUT: %C.ref.loc9_31: type = name_ref C, file.%C.decl [concrete = constants.%C]
  496. // CHECK:STDOUT: %other: %C = value_binding other, %other.param
  497. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  498. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  499. // CHECK:STDOUT: }
  500. // CHECK:STDOUT: %EqWith.impl_witness_table = impl_witness_table (%C.as.EqWith.impl.Equal.decl, %C.as.EqWith.impl.NotEqual.decl), @C.as.EqWith.impl [concrete]
  501. // CHECK:STDOUT: %EqWith.impl_witness: <witness> = impl_witness %EqWith.impl_witness_table [concrete = constants.%EqWith.impl_witness]
  502. // CHECK:STDOUT:
  503. // CHECK:STDOUT: !members:
  504. // CHECK:STDOUT: .C = <poisoned>
  505. // CHECK:STDOUT: .Equal = %C.as.EqWith.impl.Equal.decl
  506. // CHECK:STDOUT: .NotEqual = %C.as.EqWith.impl.NotEqual.decl
  507. // CHECK:STDOUT: witness = %EqWith.impl_witness
  508. // CHECK:STDOUT: }
  509. // CHECK:STDOUT:
  510. // CHECK:STDOUT: class @C {
  511. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  512. // CHECK:STDOUT: complete_type_witness = %complete_type
  513. // CHECK:STDOUT:
  514. // CHECK:STDOUT: !members:
  515. // CHECK:STDOUT: .Self = constants.%C
  516. // CHECK:STDOUT: }
  517. // CHECK:STDOUT:
  518. // CHECK:STDOUT: class @D {
  519. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  520. // CHECK:STDOUT: complete_type_witness = %complete_type
  521. // CHECK:STDOUT:
  522. // CHECK:STDOUT: !members:
  523. // CHECK:STDOUT: .Self = constants.%D
  524. // CHECK:STDOUT: }
  525. // CHECK:STDOUT:
  526. // CHECK:STDOUT: fn @C.as.EqWith.impl.Equal(%self.param: %C, %other.param: %C) -> bool;
  527. // CHECK:STDOUT:
  528. // CHECK:STDOUT: fn @C.as.EqWith.impl.NotEqual(%self.param: %C, %other.param: %C) -> bool;
  529. // CHECK:STDOUT:
  530. // CHECK:STDOUT: fn @TestRhsBad(%a.param: %C, %b.param: %D) -> bool {
  531. // CHECK:STDOUT: !entry:
  532. // CHECK:STDOUT: %a.ref: %C = name_ref a, %a
  533. // CHECK:STDOUT: %b.ref: %D = name_ref b, %b
  534. // CHECK:STDOUT: return <error> to %return.param
  535. // CHECK:STDOUT: }
  536. // CHECK:STDOUT:
  537. // CHECK:STDOUT: fn @TestLhsBad(%a.param: %D, %b.param: %C) -> bool {
  538. // CHECK:STDOUT: !entry:
  539. // CHECK:STDOUT: %a.ref: %D = name_ref a, %a
  540. // CHECK:STDOUT: %b.ref: %C = name_ref b, %b
  541. // CHECK:STDOUT: return <error> to %return.param
  542. // CHECK:STDOUT: }
  543. // CHECK:STDOUT: