ordered.carbon 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  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/ordered.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/overloaded/ordered.carbon
  14. // --- user.carbon
  15. package User;
  16. class C {};
  17. impl C as Core.OrderedWith(C) {
  18. fn Less[self: C](other: C) -> bool;
  19. fn LessOrEquivalent[self: C](other: C) -> bool;
  20. fn Greater[self: C](other: C) -> bool;
  21. fn GreaterOrEquivalent[self: C](other: C) -> bool;
  22. }
  23. fn TestLess(a: C, b: C) -> bool {
  24. return a < b;
  25. }
  26. fn TestLessEqual(a: C, b: C) -> bool {
  27. return a <= b;
  28. }
  29. fn TestGreater(a: C, b: C) -> bool {
  30. return a > b;
  31. }
  32. fn TestGreaterEqual(a: C, b: C) -> bool {
  33. return a >= b;
  34. }
  35. // --- fail_no_impl.carbon
  36. package FailNoImpl;
  37. class D {};
  38. fn TestLess(a: D, b: D) -> bool {
  39. // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.OrderedWith(D)` in type `D` that does not implement that interface [MissingImplInMemberAccess]
  40. // CHECK:STDERR: return a < b;
  41. // CHECK:STDERR: ^~~~~
  42. // CHECK:STDERR:
  43. return a < b;
  44. }
  45. fn TestLessEqual(a: D, b: D) -> bool {
  46. // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.OrderedWith(D)` in type `D` that does not implement that interface [MissingImplInMemberAccess]
  47. // CHECK:STDERR: return a <= b;
  48. // CHECK:STDERR: ^~~~~~
  49. // CHECK:STDERR:
  50. return a <= b;
  51. }
  52. fn TestGreater(a: D, b: D) -> bool {
  53. // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.OrderedWith(D)` in type `D` 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 TestGreaterEqual(a: D, b: D) -> bool {
  60. // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.OrderedWith(D)` 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: %OrderedWith.type.270: type = generic_interface_type @OrderedWith [concrete]
  73. // CHECK:STDOUT: %OrderedWith.generic: %OrderedWith.type.270 = struct_value () [concrete]
  74. // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete]
  75. // CHECK:STDOUT: %OrderedWith.type.b75: type = facet_type <@OrderedWith, @OrderedWith(%C)> [concrete]
  76. // CHECK:STDOUT: %OrderedWith.Less.type.ef8: type = fn_type @OrderedWith.Less, @OrderedWith(%C) [concrete]
  77. // CHECK:STDOUT: %OrderedWith.LessOrEquivalent.type.718: type = fn_type @OrderedWith.LessOrEquivalent, @OrderedWith(%C) [concrete]
  78. // CHECK:STDOUT: %OrderedWith.Greater.type.394: type = fn_type @OrderedWith.Greater, @OrderedWith(%C) [concrete]
  79. // CHECK:STDOUT: %OrderedWith.GreaterOrEquivalent.type.f2b: type = fn_type @OrderedWith.GreaterOrEquivalent, @OrderedWith(%C) [concrete]
  80. // CHECK:STDOUT: %OrderedWith.impl_witness: <witness> = impl_witness file.%OrderedWith.impl_witness_table [concrete]
  81. // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
  82. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
  83. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
  84. // CHECK:STDOUT: %C.as.OrderedWith.impl.Less.type: type = fn_type @C.as.OrderedWith.impl.Less [concrete]
  85. // CHECK:STDOUT: %C.as.OrderedWith.impl.Less: %C.as.OrderedWith.impl.Less.type = struct_value () [concrete]
  86. // CHECK:STDOUT: %C.as.OrderedWith.impl.LessOrEquivalent.type: type = fn_type @C.as.OrderedWith.impl.LessOrEquivalent [concrete]
  87. // CHECK:STDOUT: %C.as.OrderedWith.impl.LessOrEquivalent: %C.as.OrderedWith.impl.LessOrEquivalent.type = struct_value () [concrete]
  88. // CHECK:STDOUT: %C.as.OrderedWith.impl.Greater.type: type = fn_type @C.as.OrderedWith.impl.Greater [concrete]
  89. // CHECK:STDOUT: %C.as.OrderedWith.impl.Greater: %C.as.OrderedWith.impl.Greater.type = struct_value () [concrete]
  90. // CHECK:STDOUT: %C.as.OrderedWith.impl.GreaterOrEquivalent.type: type = fn_type @C.as.OrderedWith.impl.GreaterOrEquivalent [concrete]
  91. // CHECK:STDOUT: %C.as.OrderedWith.impl.GreaterOrEquivalent: %C.as.OrderedWith.impl.GreaterOrEquivalent.type = struct_value () [concrete]
  92. // CHECK:STDOUT: %OrderedWith.facet: %OrderedWith.type.b75 = facet_value %C, (%OrderedWith.impl_witness) [concrete]
  93. // CHECK:STDOUT: %TestLess.type: type = fn_type @TestLess [concrete]
  94. // CHECK:STDOUT: %TestLess: %TestLess.type = struct_value () [concrete]
  95. // CHECK:STDOUT: %.9bd: type = fn_type_with_self_type %OrderedWith.Less.type.ef8, %OrderedWith.facet [concrete]
  96. // CHECK:STDOUT: %TestLessEqual.type: type = fn_type @TestLessEqual [concrete]
  97. // CHECK:STDOUT: %TestLessEqual: %TestLessEqual.type = struct_value () [concrete]
  98. // CHECK:STDOUT: %.851: type = fn_type_with_self_type %OrderedWith.LessOrEquivalent.type.718, %OrderedWith.facet [concrete]
  99. // CHECK:STDOUT: %TestGreater.type: type = fn_type @TestGreater [concrete]
  100. // CHECK:STDOUT: %TestGreater: %TestGreater.type = struct_value () [concrete]
  101. // CHECK:STDOUT: %.a50: type = fn_type_with_self_type %OrderedWith.Greater.type.394, %OrderedWith.facet [concrete]
  102. // CHECK:STDOUT: %TestGreaterEqual.type: type = fn_type @TestGreaterEqual [concrete]
  103. // CHECK:STDOUT: %TestGreaterEqual: %TestGreaterEqual.type = struct_value () [concrete]
  104. // CHECK:STDOUT: %.cfe: type = fn_type_with_self_type %OrderedWith.GreaterOrEquivalent.type.f2b, %OrderedWith.facet [concrete]
  105. // CHECK:STDOUT: }
  106. // CHECK:STDOUT:
  107. // CHECK:STDOUT: imports {
  108. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  109. // CHECK:STDOUT: .OrderedWith = %Core.OrderedWith
  110. // CHECK:STDOUT: .Bool = %Core.Bool
  111. // CHECK:STDOUT: import Core//prelude
  112. // CHECK:STDOUT: import Core//prelude/...
  113. // CHECK:STDOUT: }
  114. // CHECK:STDOUT: %Core.OrderedWith: %OrderedWith.type.270 = import_ref Core//prelude/operators/comparison, OrderedWith, loaded [concrete = constants.%OrderedWith.generic]
  115. // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
  116. // CHECK:STDOUT: }
  117. // CHECK:STDOUT:
  118. // CHECK:STDOUT: file {
  119. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  120. // CHECK:STDOUT: .Core = imports.%Core
  121. // CHECK:STDOUT: .C = %C.decl
  122. // CHECK:STDOUT: .TestLess = %TestLess.decl
  123. // CHECK:STDOUT: .TestLessEqual = %TestLessEqual.decl
  124. // CHECK:STDOUT: .TestGreater = %TestGreater.decl
  125. // CHECK:STDOUT: .TestGreaterEqual = %TestGreaterEqual.decl
  126. // CHECK:STDOUT: }
  127. // CHECK:STDOUT: %Core.import = import Core
  128. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  129. // CHECK:STDOUT: impl_decl @C.as.OrderedWith.impl [concrete] {} {
  130. // CHECK:STDOUT: %C.ref.loc6_6: type = name_ref C, file.%C.decl [concrete = constants.%C]
  131. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  132. // CHECK:STDOUT: %OrderedWith.ref: %OrderedWith.type.270 = name_ref OrderedWith, imports.%Core.OrderedWith [concrete = constants.%OrderedWith.generic]
  133. // CHECK:STDOUT: %C.ref.loc6_28: type = name_ref C, file.%C.decl [concrete = constants.%C]
  134. // CHECK:STDOUT: %OrderedWith.type: type = facet_type <@OrderedWith, @OrderedWith(constants.%C)> [concrete = constants.%OrderedWith.type.b75]
  135. // CHECK:STDOUT: }
  136. // CHECK:STDOUT: %OrderedWith.impl_witness_table = impl_witness_table (@C.as.OrderedWith.impl.%C.as.OrderedWith.impl.Less.decl, @C.as.OrderedWith.impl.%C.as.OrderedWith.impl.LessOrEquivalent.decl, @C.as.OrderedWith.impl.%C.as.OrderedWith.impl.Greater.decl, @C.as.OrderedWith.impl.%C.as.OrderedWith.impl.GreaterOrEquivalent.decl), @C.as.OrderedWith.impl [concrete]
  137. // CHECK:STDOUT: %OrderedWith.impl_witness: <witness> = impl_witness %OrderedWith.impl_witness_table [concrete = constants.%OrderedWith.impl_witness]
  138. // CHECK:STDOUT: %TestLess.decl: %TestLess.type = fn_decl @TestLess [concrete = constants.%TestLess] {
  139. // CHECK:STDOUT: %a.patt: %pattern_type.c48 = value_binding_pattern a [concrete]
  140. // CHECK:STDOUT: %a.param_patt: %pattern_type.c48 = value_param_pattern %a.patt, call_param0 [concrete]
  141. // CHECK:STDOUT: %b.patt: %pattern_type.c48 = value_binding_pattern b [concrete]
  142. // CHECK:STDOUT: %b.param_patt: %pattern_type.c48 = value_param_pattern %b.patt, call_param1 [concrete]
  143. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  144. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  145. // CHECK:STDOUT: } {
  146. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  147. // CHECK:STDOUT: %.loc13_28.1: type = value_of_initializer %Bool.call [concrete = bool]
  148. // CHECK:STDOUT: %.loc13_28.2: type = converted %Bool.call, %.loc13_28.1 [concrete = bool]
  149. // CHECK:STDOUT: %a.param: %C = value_param call_param0
  150. // CHECK:STDOUT: %C.ref.loc13_16: type = name_ref C, file.%C.decl [concrete = constants.%C]
  151. // CHECK:STDOUT: %a: %C = value_binding a, %a.param
  152. // CHECK:STDOUT: %b.param: %C = value_param call_param1
  153. // CHECK:STDOUT: %C.ref.loc13_22: type = name_ref C, file.%C.decl [concrete = constants.%C]
  154. // CHECK:STDOUT: %b: %C = value_binding b, %b.param
  155. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  156. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  157. // CHECK:STDOUT: }
  158. // CHECK:STDOUT: %TestLessEqual.decl: %TestLessEqual.type = fn_decl @TestLessEqual [concrete = constants.%TestLessEqual] {
  159. // CHECK:STDOUT: %a.patt: %pattern_type.c48 = value_binding_pattern a [concrete]
  160. // CHECK:STDOUT: %a.param_patt: %pattern_type.c48 = value_param_pattern %a.patt, call_param0 [concrete]
  161. // CHECK:STDOUT: %b.patt: %pattern_type.c48 = value_binding_pattern b [concrete]
  162. // CHECK:STDOUT: %b.param_patt: %pattern_type.c48 = value_param_pattern %b.patt, call_param1 [concrete]
  163. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  164. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  165. // CHECK:STDOUT: } {
  166. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  167. // CHECK:STDOUT: %.loc17_33.1: type = value_of_initializer %Bool.call [concrete = bool]
  168. // CHECK:STDOUT: %.loc17_33.2: type = converted %Bool.call, %.loc17_33.1 [concrete = bool]
  169. // CHECK:STDOUT: %a.param: %C = value_param call_param0
  170. // CHECK:STDOUT: %C.ref.loc17_21: type = name_ref C, file.%C.decl [concrete = constants.%C]
  171. // CHECK:STDOUT: %a: %C = value_binding a, %a.param
  172. // CHECK:STDOUT: %b.param: %C = value_param call_param1
  173. // CHECK:STDOUT: %C.ref.loc17_27: type = name_ref C, file.%C.decl [concrete = constants.%C]
  174. // CHECK:STDOUT: %b: %C = value_binding b, %b.param
  175. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  176. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  177. // CHECK:STDOUT: }
  178. // CHECK:STDOUT: %TestGreater.decl: %TestGreater.type = fn_decl @TestGreater [concrete = constants.%TestGreater] {
  179. // CHECK:STDOUT: %a.patt: %pattern_type.c48 = value_binding_pattern a [concrete]
  180. // CHECK:STDOUT: %a.param_patt: %pattern_type.c48 = value_param_pattern %a.patt, call_param0 [concrete]
  181. // CHECK:STDOUT: %b.patt: %pattern_type.c48 = value_binding_pattern b [concrete]
  182. // CHECK:STDOUT: %b.param_patt: %pattern_type.c48 = value_param_pattern %b.patt, call_param1 [concrete]
  183. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  184. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  185. // CHECK:STDOUT: } {
  186. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  187. // CHECK:STDOUT: %.loc21_31.1: type = value_of_initializer %Bool.call [concrete = bool]
  188. // CHECK:STDOUT: %.loc21_31.2: type = converted %Bool.call, %.loc21_31.1 [concrete = bool]
  189. // CHECK:STDOUT: %a.param: %C = value_param call_param0
  190. // CHECK:STDOUT: %C.ref.loc21_19: type = name_ref C, file.%C.decl [concrete = constants.%C]
  191. // CHECK:STDOUT: %a: %C = value_binding a, %a.param
  192. // CHECK:STDOUT: %b.param: %C = value_param call_param1
  193. // CHECK:STDOUT: %C.ref.loc21_25: type = name_ref C, file.%C.decl [concrete = constants.%C]
  194. // CHECK:STDOUT: %b: %C = value_binding b, %b.param
  195. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  196. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  197. // CHECK:STDOUT: }
  198. // CHECK:STDOUT: %TestGreaterEqual.decl: %TestGreaterEqual.type = fn_decl @TestGreaterEqual [concrete = constants.%TestGreaterEqual] {
  199. // CHECK:STDOUT: %a.patt: %pattern_type.c48 = value_binding_pattern a [concrete]
  200. // CHECK:STDOUT: %a.param_patt: %pattern_type.c48 = value_param_pattern %a.patt, call_param0 [concrete]
  201. // CHECK:STDOUT: %b.patt: %pattern_type.c48 = value_binding_pattern b [concrete]
  202. // CHECK:STDOUT: %b.param_patt: %pattern_type.c48 = value_param_pattern %b.patt, call_param1 [concrete]
  203. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  204. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  205. // CHECK:STDOUT: } {
  206. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  207. // CHECK:STDOUT: %.loc25_36.1: type = value_of_initializer %Bool.call [concrete = bool]
  208. // CHECK:STDOUT: %.loc25_36.2: type = converted %Bool.call, %.loc25_36.1 [concrete = bool]
  209. // CHECK:STDOUT: %a.param: %C = value_param call_param0
  210. // CHECK:STDOUT: %C.ref.loc25_24: type = name_ref C, file.%C.decl [concrete = constants.%C]
  211. // CHECK:STDOUT: %a: %C = value_binding a, %a.param
  212. // CHECK:STDOUT: %b.param: %C = value_param call_param1
  213. // CHECK:STDOUT: %C.ref.loc25_30: type = name_ref C, file.%C.decl [concrete = constants.%C]
  214. // CHECK:STDOUT: %b: %C = value_binding b, %b.param
  215. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  216. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  217. // CHECK:STDOUT: }
  218. // CHECK:STDOUT: }
  219. // CHECK:STDOUT:
  220. // CHECK:STDOUT: impl @C.as.OrderedWith.impl: %C.ref.loc6_6 as %OrderedWith.type {
  221. // CHECK:STDOUT: %C.as.OrderedWith.impl.Less.decl: %C.as.OrderedWith.impl.Less.type = fn_decl @C.as.OrderedWith.impl.Less [concrete = constants.%C.as.OrderedWith.impl.Less] {
  222. // CHECK:STDOUT: %self.patt: %pattern_type.c48 = value_binding_pattern self [concrete]
  223. // CHECK:STDOUT: %self.param_patt: %pattern_type.c48 = value_param_pattern %self.patt, call_param0 [concrete]
  224. // CHECK:STDOUT: %other.patt: %pattern_type.c48 = value_binding_pattern other [concrete]
  225. // CHECK:STDOUT: %other.param_patt: %pattern_type.c48 = value_param_pattern %other.patt, call_param1 [concrete]
  226. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  227. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  228. // CHECK:STDOUT: } {
  229. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  230. // CHECK:STDOUT: %.loc7_33.1: type = value_of_initializer %Bool.call [concrete = bool]
  231. // CHECK:STDOUT: %.loc7_33.2: type = converted %Bool.call, %.loc7_33.1 [concrete = bool]
  232. // CHECK:STDOUT: %self.param: %C = value_param call_param0
  233. // CHECK:STDOUT: %C.ref.loc7_17: type = name_ref C, file.%C.decl [concrete = constants.%C]
  234. // CHECK:STDOUT: %self: %C = value_binding self, %self.param
  235. // CHECK:STDOUT: %other.param: %C = value_param call_param1
  236. // CHECK:STDOUT: %C.ref.loc7_27: type = name_ref C, file.%C.decl [concrete = constants.%C]
  237. // CHECK:STDOUT: %other: %C = value_binding other, %other.param
  238. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  239. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  240. // CHECK:STDOUT: }
  241. // CHECK:STDOUT: %C.as.OrderedWith.impl.LessOrEquivalent.decl: %C.as.OrderedWith.impl.LessOrEquivalent.type = fn_decl @C.as.OrderedWith.impl.LessOrEquivalent [concrete = constants.%C.as.OrderedWith.impl.LessOrEquivalent] {
  242. // CHECK:STDOUT: %self.patt: %pattern_type.c48 = value_binding_pattern self [concrete]
  243. // CHECK:STDOUT: %self.param_patt: %pattern_type.c48 = value_param_pattern %self.patt, call_param0 [concrete]
  244. // CHECK:STDOUT: %other.patt: %pattern_type.c48 = value_binding_pattern other [concrete]
  245. // CHECK:STDOUT: %other.param_patt: %pattern_type.c48 = value_param_pattern %other.patt, call_param1 [concrete]
  246. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  247. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  248. // CHECK:STDOUT: } {
  249. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  250. // CHECK:STDOUT: %.loc8_45.1: type = value_of_initializer %Bool.call [concrete = bool]
  251. // CHECK:STDOUT: %.loc8_45.2: type = converted %Bool.call, %.loc8_45.1 [concrete = bool]
  252. // CHECK:STDOUT: %self.param: %C = value_param call_param0
  253. // CHECK:STDOUT: %C.ref.loc8_29: type = name_ref C, file.%C.decl [concrete = constants.%C]
  254. // CHECK:STDOUT: %self: %C = value_binding self, %self.param
  255. // CHECK:STDOUT: %other.param: %C = value_param call_param1
  256. // CHECK:STDOUT: %C.ref.loc8_39: type = name_ref C, file.%C.decl [concrete = constants.%C]
  257. // CHECK:STDOUT: %other: %C = value_binding other, %other.param
  258. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  259. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  260. // CHECK:STDOUT: }
  261. // CHECK:STDOUT: %C.as.OrderedWith.impl.Greater.decl: %C.as.OrderedWith.impl.Greater.type = fn_decl @C.as.OrderedWith.impl.Greater [concrete = constants.%C.as.OrderedWith.impl.Greater] {
  262. // CHECK:STDOUT: %self.patt: %pattern_type.c48 = value_binding_pattern self [concrete]
  263. // CHECK:STDOUT: %self.param_patt: %pattern_type.c48 = value_param_pattern %self.patt, call_param0 [concrete]
  264. // CHECK:STDOUT: %other.patt: %pattern_type.c48 = value_binding_pattern other [concrete]
  265. // CHECK:STDOUT: %other.param_patt: %pattern_type.c48 = value_param_pattern %other.patt, call_param1 [concrete]
  266. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  267. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  268. // CHECK:STDOUT: } {
  269. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  270. // CHECK:STDOUT: %.loc9_36.1: type = value_of_initializer %Bool.call [concrete = bool]
  271. // CHECK:STDOUT: %.loc9_36.2: type = converted %Bool.call, %.loc9_36.1 [concrete = bool]
  272. // CHECK:STDOUT: %self.param: %C = value_param call_param0
  273. // CHECK:STDOUT: %C.ref.loc9_20: type = name_ref C, file.%C.decl [concrete = constants.%C]
  274. // CHECK:STDOUT: %self: %C = value_binding self, %self.param
  275. // CHECK:STDOUT: %other.param: %C = value_param call_param1
  276. // CHECK:STDOUT: %C.ref.loc9_30: type = name_ref C, file.%C.decl [concrete = constants.%C]
  277. // CHECK:STDOUT: %other: %C = value_binding other, %other.param
  278. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  279. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  280. // CHECK:STDOUT: }
  281. // CHECK:STDOUT: %C.as.OrderedWith.impl.GreaterOrEquivalent.decl: %C.as.OrderedWith.impl.GreaterOrEquivalent.type = fn_decl @C.as.OrderedWith.impl.GreaterOrEquivalent [concrete = constants.%C.as.OrderedWith.impl.GreaterOrEquivalent] {
  282. // CHECK:STDOUT: %self.patt: %pattern_type.c48 = value_binding_pattern self [concrete]
  283. // CHECK:STDOUT: %self.param_patt: %pattern_type.c48 = value_param_pattern %self.patt, call_param0 [concrete]
  284. // CHECK:STDOUT: %other.patt: %pattern_type.c48 = value_binding_pattern other [concrete]
  285. // CHECK:STDOUT: %other.param_patt: %pattern_type.c48 = value_param_pattern %other.patt, call_param1 [concrete]
  286. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  287. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  288. // CHECK:STDOUT: } {
  289. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  290. // CHECK:STDOUT: %.loc10_48.1: type = value_of_initializer %Bool.call [concrete = bool]
  291. // CHECK:STDOUT: %.loc10_48.2: type = converted %Bool.call, %.loc10_48.1 [concrete = bool]
  292. // CHECK:STDOUT: %self.param: %C = value_param call_param0
  293. // CHECK:STDOUT: %C.ref.loc10_32: type = name_ref C, file.%C.decl [concrete = constants.%C]
  294. // CHECK:STDOUT: %self: %C = value_binding self, %self.param
  295. // CHECK:STDOUT: %other.param: %C = value_param call_param1
  296. // CHECK:STDOUT: %C.ref.loc10_42: type = name_ref C, file.%C.decl [concrete = constants.%C]
  297. // CHECK:STDOUT: %other: %C = value_binding other, %other.param
  298. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  299. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  300. // CHECK:STDOUT: }
  301. // CHECK:STDOUT:
  302. // CHECK:STDOUT: !members:
  303. // CHECK:STDOUT: .C = <poisoned>
  304. // CHECK:STDOUT: .Less = %C.as.OrderedWith.impl.Less.decl
  305. // CHECK:STDOUT: .LessOrEquivalent = %C.as.OrderedWith.impl.LessOrEquivalent.decl
  306. // CHECK:STDOUT: .Greater = %C.as.OrderedWith.impl.Greater.decl
  307. // CHECK:STDOUT: .GreaterOrEquivalent = %C.as.OrderedWith.impl.GreaterOrEquivalent.decl
  308. // CHECK:STDOUT: witness = file.%OrderedWith.impl_witness
  309. // CHECK:STDOUT: }
  310. // CHECK:STDOUT:
  311. // CHECK:STDOUT: class @C {
  312. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  313. // CHECK:STDOUT: complete_type_witness = %complete_type
  314. // CHECK:STDOUT:
  315. // CHECK:STDOUT: !members:
  316. // CHECK:STDOUT: .Self = constants.%C
  317. // CHECK:STDOUT: }
  318. // CHECK:STDOUT:
  319. // CHECK:STDOUT: fn @C.as.OrderedWith.impl.Less(%self.param: %C, %other.param: %C) -> bool;
  320. // CHECK:STDOUT:
  321. // CHECK:STDOUT: fn @C.as.OrderedWith.impl.LessOrEquivalent(%self.param: %C, %other.param: %C) -> bool;
  322. // CHECK:STDOUT:
  323. // CHECK:STDOUT: fn @C.as.OrderedWith.impl.Greater(%self.param: %C, %other.param: %C) -> bool;
  324. // CHECK:STDOUT:
  325. // CHECK:STDOUT: fn @C.as.OrderedWith.impl.GreaterOrEquivalent(%self.param: %C, %other.param: %C) -> bool;
  326. // CHECK:STDOUT:
  327. // CHECK:STDOUT: fn @TestLess(%a.param: %C, %b.param: %C) -> bool {
  328. // CHECK:STDOUT: !entry:
  329. // CHECK:STDOUT: %a.ref: %C = name_ref a, %a
  330. // CHECK:STDOUT: %b.ref: %C = name_ref b, %b
  331. // CHECK:STDOUT: %impl.elem0: %.9bd = impl_witness_access constants.%OrderedWith.impl_witness, element0 [concrete = constants.%C.as.OrderedWith.impl.Less]
  332. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.ref, %impl.elem0
  333. // CHECK:STDOUT: %C.as.OrderedWith.impl.Less.call: init bool = call %bound_method(%a.ref, %b.ref)
  334. // CHECK:STDOUT: return %C.as.OrderedWith.impl.Less.call to %return
  335. // CHECK:STDOUT: }
  336. // CHECK:STDOUT:
  337. // CHECK:STDOUT: fn @TestLessEqual(%a.param: %C, %b.param: %C) -> bool {
  338. // CHECK:STDOUT: !entry:
  339. // CHECK:STDOUT: %a.ref: %C = name_ref a, %a
  340. // CHECK:STDOUT: %b.ref: %C = name_ref b, %b
  341. // CHECK:STDOUT: %impl.elem1: %.851 = impl_witness_access constants.%OrderedWith.impl_witness, element1 [concrete = constants.%C.as.OrderedWith.impl.LessOrEquivalent]
  342. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.ref, %impl.elem1
  343. // CHECK:STDOUT: %C.as.OrderedWith.impl.LessOrEquivalent.call: init bool = call %bound_method(%a.ref, %b.ref)
  344. // CHECK:STDOUT: return %C.as.OrderedWith.impl.LessOrEquivalent.call to %return
  345. // CHECK:STDOUT: }
  346. // CHECK:STDOUT:
  347. // CHECK:STDOUT: fn @TestGreater(%a.param: %C, %b.param: %C) -> bool {
  348. // CHECK:STDOUT: !entry:
  349. // CHECK:STDOUT: %a.ref: %C = name_ref a, %a
  350. // CHECK:STDOUT: %b.ref: %C = name_ref b, %b
  351. // CHECK:STDOUT: %impl.elem2: %.a50 = impl_witness_access constants.%OrderedWith.impl_witness, element2 [concrete = constants.%C.as.OrderedWith.impl.Greater]
  352. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.ref, %impl.elem2
  353. // CHECK:STDOUT: %C.as.OrderedWith.impl.Greater.call: init bool = call %bound_method(%a.ref, %b.ref)
  354. // CHECK:STDOUT: return %C.as.OrderedWith.impl.Greater.call to %return
  355. // CHECK:STDOUT: }
  356. // CHECK:STDOUT:
  357. // CHECK:STDOUT: fn @TestGreaterEqual(%a.param: %C, %b.param: %C) -> bool {
  358. // CHECK:STDOUT: !entry:
  359. // CHECK:STDOUT: %a.ref: %C = name_ref a, %a
  360. // CHECK:STDOUT: %b.ref: %C = name_ref b, %b
  361. // CHECK:STDOUT: %impl.elem3: %.cfe = impl_witness_access constants.%OrderedWith.impl_witness, element3 [concrete = constants.%C.as.OrderedWith.impl.GreaterOrEquivalent]
  362. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.ref, %impl.elem3
  363. // CHECK:STDOUT: %C.as.OrderedWith.impl.GreaterOrEquivalent.call: init bool = call %bound_method(%a.ref, %b.ref)
  364. // CHECK:STDOUT: return %C.as.OrderedWith.impl.GreaterOrEquivalent.call to %return
  365. // CHECK:STDOUT: }
  366. // CHECK:STDOUT:
  367. // CHECK:STDOUT: --- fail_no_impl.carbon
  368. // CHECK:STDOUT:
  369. // CHECK:STDOUT: constants {
  370. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  371. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  372. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  373. // CHECK:STDOUT: %pattern_type.510: type = pattern_type %D [concrete]
  374. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
  375. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
  376. // CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete]
  377. // CHECK:STDOUT: %TestLess.type: type = fn_type @TestLess [concrete]
  378. // CHECK:STDOUT: %TestLess: %TestLess.type = struct_value () [concrete]
  379. // CHECK:STDOUT: %OrderedWith.type.270: type = generic_interface_type @OrderedWith [concrete]
  380. // CHECK:STDOUT: %OrderedWith.generic: %OrderedWith.type.270 = struct_value () [concrete]
  381. // CHECK:STDOUT: %TestLessEqual.type: type = fn_type @TestLessEqual [concrete]
  382. // CHECK:STDOUT: %TestLessEqual: %TestLessEqual.type = struct_value () [concrete]
  383. // CHECK:STDOUT: %TestGreater.type: type = fn_type @TestGreater [concrete]
  384. // CHECK:STDOUT: %TestGreater: %TestGreater.type = struct_value () [concrete]
  385. // CHECK:STDOUT: %TestGreaterEqual.type: type = fn_type @TestGreaterEqual [concrete]
  386. // CHECK:STDOUT: %TestGreaterEqual: %TestGreaterEqual.type = struct_value () [concrete]
  387. // CHECK:STDOUT: }
  388. // CHECK:STDOUT:
  389. // CHECK:STDOUT: imports {
  390. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  391. // CHECK:STDOUT: .Bool = %Core.Bool
  392. // CHECK:STDOUT: .OrderedWith = %Core.OrderedWith
  393. // CHECK:STDOUT: import Core//prelude
  394. // CHECK:STDOUT: import Core//prelude/...
  395. // CHECK:STDOUT: }
  396. // CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
  397. // CHECK:STDOUT: %Core.OrderedWith: %OrderedWith.type.270 = import_ref Core//prelude/operators/comparison, OrderedWith, loaded [concrete = constants.%OrderedWith.generic]
  398. // CHECK:STDOUT: }
  399. // CHECK:STDOUT:
  400. // CHECK:STDOUT: file {
  401. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  402. // CHECK:STDOUT: .Core = imports.%Core
  403. // CHECK:STDOUT: .D = %D.decl
  404. // CHECK:STDOUT: .TestLess = %TestLess.decl
  405. // CHECK:STDOUT: .TestLessEqual = %TestLessEqual.decl
  406. // CHECK:STDOUT: .TestGreater = %TestGreater.decl
  407. // CHECK:STDOUT: .TestGreaterEqual = %TestGreaterEqual.decl
  408. // CHECK:STDOUT: }
  409. // CHECK:STDOUT: %Core.import = import Core
  410. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  411. // CHECK:STDOUT: %TestLess.decl: %TestLess.type = fn_decl @TestLess [concrete = constants.%TestLess] {
  412. // CHECK:STDOUT: %a.patt: %pattern_type.510 = value_binding_pattern a [concrete]
  413. // CHECK:STDOUT: %a.param_patt: %pattern_type.510 = value_param_pattern %a.patt, call_param0 [concrete]
  414. // CHECK:STDOUT: %b.patt: %pattern_type.510 = value_binding_pattern b [concrete]
  415. // CHECK:STDOUT: %b.param_patt: %pattern_type.510 = value_param_pattern %b.patt, call_param1 [concrete]
  416. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  417. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  418. // CHECK:STDOUT: } {
  419. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  420. // CHECK:STDOUT: %.loc6_28.1: type = value_of_initializer %Bool.call [concrete = bool]
  421. // CHECK:STDOUT: %.loc6_28.2: type = converted %Bool.call, %.loc6_28.1 [concrete = bool]
  422. // CHECK:STDOUT: %a.param: %D = value_param call_param0
  423. // CHECK:STDOUT: %D.ref.loc6_16: type = name_ref D, file.%D.decl [concrete = constants.%D]
  424. // CHECK:STDOUT: %a: %D = value_binding a, %a.param
  425. // CHECK:STDOUT: %b.param: %D = value_param call_param1
  426. // CHECK:STDOUT: %D.ref.loc6_22: type = name_ref D, file.%D.decl [concrete = constants.%D]
  427. // CHECK:STDOUT: %b: %D = value_binding b, %b.param
  428. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  429. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  430. // CHECK:STDOUT: }
  431. // CHECK:STDOUT: %TestLessEqual.decl: %TestLessEqual.type = fn_decl @TestLessEqual [concrete = constants.%TestLessEqual] {
  432. // CHECK:STDOUT: %a.patt: %pattern_type.510 = value_binding_pattern a [concrete]
  433. // CHECK:STDOUT: %a.param_patt: %pattern_type.510 = value_param_pattern %a.patt, call_param0 [concrete]
  434. // CHECK:STDOUT: %b.patt: %pattern_type.510 = value_binding_pattern b [concrete]
  435. // CHECK:STDOUT: %b.param_patt: %pattern_type.510 = value_param_pattern %b.patt, call_param1 [concrete]
  436. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  437. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  438. // CHECK:STDOUT: } {
  439. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  440. // CHECK:STDOUT: %.loc14_33.1: type = value_of_initializer %Bool.call [concrete = bool]
  441. // CHECK:STDOUT: %.loc14_33.2: type = converted %Bool.call, %.loc14_33.1 [concrete = bool]
  442. // CHECK:STDOUT: %a.param: %D = value_param call_param0
  443. // CHECK:STDOUT: %D.ref.loc14_21: type = name_ref D, file.%D.decl [concrete = constants.%D]
  444. // CHECK:STDOUT: %a: %D = value_binding a, %a.param
  445. // CHECK:STDOUT: %b.param: %D = value_param call_param1
  446. // CHECK:STDOUT: %D.ref.loc14_27: type = name_ref D, file.%D.decl [concrete = constants.%D]
  447. // CHECK:STDOUT: %b: %D = value_binding b, %b.param
  448. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  449. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  450. // CHECK:STDOUT: }
  451. // CHECK:STDOUT: %TestGreater.decl: %TestGreater.type = fn_decl @TestGreater [concrete = constants.%TestGreater] {
  452. // CHECK:STDOUT: %a.patt: %pattern_type.510 = value_binding_pattern a [concrete]
  453. // CHECK:STDOUT: %a.param_patt: %pattern_type.510 = value_param_pattern %a.patt, call_param0 [concrete]
  454. // CHECK:STDOUT: %b.patt: %pattern_type.510 = value_binding_pattern b [concrete]
  455. // CHECK:STDOUT: %b.param_patt: %pattern_type.510 = value_param_pattern %b.patt, call_param1 [concrete]
  456. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  457. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  458. // CHECK:STDOUT: } {
  459. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  460. // CHECK:STDOUT: %.loc22_31.1: type = value_of_initializer %Bool.call [concrete = bool]
  461. // CHECK:STDOUT: %.loc22_31.2: type = converted %Bool.call, %.loc22_31.1 [concrete = bool]
  462. // CHECK:STDOUT: %a.param: %D = value_param call_param0
  463. // CHECK:STDOUT: %D.ref.loc22_19: type = name_ref D, file.%D.decl [concrete = constants.%D]
  464. // CHECK:STDOUT: %a: %D = value_binding a, %a.param
  465. // CHECK:STDOUT: %b.param: %D = value_param call_param1
  466. // CHECK:STDOUT: %D.ref.loc22_25: type = name_ref D, file.%D.decl [concrete = constants.%D]
  467. // CHECK:STDOUT: %b: %D = value_binding b, %b.param
  468. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  469. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  470. // CHECK:STDOUT: }
  471. // CHECK:STDOUT: %TestGreaterEqual.decl: %TestGreaterEqual.type = fn_decl @TestGreaterEqual [concrete = constants.%TestGreaterEqual] {
  472. // CHECK:STDOUT: %a.patt: %pattern_type.510 = value_binding_pattern a [concrete]
  473. // CHECK:STDOUT: %a.param_patt: %pattern_type.510 = value_param_pattern %a.patt, call_param0 [concrete]
  474. // CHECK:STDOUT: %b.patt: %pattern_type.510 = value_binding_pattern b [concrete]
  475. // CHECK:STDOUT: %b.param_patt: %pattern_type.510 = value_param_pattern %b.patt, call_param1 [concrete]
  476. // CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
  477. // CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
  478. // CHECK:STDOUT: } {
  479. // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
  480. // CHECK:STDOUT: %.loc30_36.1: type = value_of_initializer %Bool.call [concrete = bool]
  481. // CHECK:STDOUT: %.loc30_36.2: type = converted %Bool.call, %.loc30_36.1 [concrete = bool]
  482. // CHECK:STDOUT: %a.param: %D = value_param call_param0
  483. // CHECK:STDOUT: %D.ref.loc30_24: type = name_ref D, file.%D.decl [concrete = constants.%D]
  484. // CHECK:STDOUT: %a: %D = value_binding a, %a.param
  485. // CHECK:STDOUT: %b.param: %D = value_param call_param1
  486. // CHECK:STDOUT: %D.ref.loc30_30: type = name_ref D, file.%D.decl [concrete = constants.%D]
  487. // CHECK:STDOUT: %b: %D = value_binding b, %b.param
  488. // CHECK:STDOUT: %return.param: ref bool = out_param call_param2
  489. // CHECK:STDOUT: %return: ref bool = return_slot %return.param
  490. // CHECK:STDOUT: }
  491. // CHECK:STDOUT: }
  492. // CHECK:STDOUT:
  493. // CHECK:STDOUT: class @D {
  494. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  495. // CHECK:STDOUT: complete_type_witness = %complete_type
  496. // CHECK:STDOUT:
  497. // CHECK:STDOUT: !members:
  498. // CHECK:STDOUT: .Self = constants.%D
  499. // CHECK:STDOUT: }
  500. // CHECK:STDOUT:
  501. // CHECK:STDOUT: fn @TestLess(%a.param: %D, %b.param: %D) -> bool {
  502. // CHECK:STDOUT: !entry:
  503. // CHECK:STDOUT: %a.ref: %D = name_ref a, %a
  504. // CHECK:STDOUT: %b.ref: %D = name_ref b, %b
  505. // CHECK:STDOUT: return <error> to %return
  506. // CHECK:STDOUT: }
  507. // CHECK:STDOUT:
  508. // CHECK:STDOUT: fn @TestLessEqual(%a.param: %D, %b.param: %D) -> bool {
  509. // CHECK:STDOUT: !entry:
  510. // CHECK:STDOUT: %a.ref: %D = name_ref a, %a
  511. // CHECK:STDOUT: %b.ref: %D = name_ref b, %b
  512. // CHECK:STDOUT: return <error> to %return
  513. // CHECK:STDOUT: }
  514. // CHECK:STDOUT:
  515. // CHECK:STDOUT: fn @TestGreater(%a.param: %D, %b.param: %D) -> bool {
  516. // CHECK:STDOUT: !entry:
  517. // CHECK:STDOUT: %a.ref: %D = name_ref a, %a
  518. // CHECK:STDOUT: %b.ref: %D = name_ref b, %b
  519. // CHECK:STDOUT: return <error> to %return
  520. // CHECK:STDOUT: }
  521. // CHECK:STDOUT:
  522. // CHECK:STDOUT: fn @TestGreaterEqual(%a.param: %D, %b.param: %D) -> bool {
  523. // CHECK:STDOUT: !entry:
  524. // CHECK:STDOUT: %a.ref: %D = name_ref a, %a
  525. // CHECK:STDOUT: %b.ref: %D = name_ref b, %b
  526. // CHECK:STDOUT: return <error> to %return
  527. // CHECK:STDOUT: }
  528. // CHECK:STDOUT: