member_access.carbon 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/generic/member_access.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/generic/member_access.carbon
  10. // --- member_access.carbon
  11. class Class(T:! type) {
  12. var x: T;
  13. fn Get[self: Self]() -> T { return self.x; }
  14. fn GetAddr[addr self: Self*]() -> T* { return &self->x; }
  15. }
  16. fn DirectFieldAccess(x: Class(i32)) -> i32 {
  17. return x.x;
  18. }
  19. fn MethodCall(x: Class(i32)) -> i32 {
  20. return x.Get();
  21. }
  22. fn AddrMethodCall(p: Class(i32)*) -> i32 {
  23. return *p->GetAddr();
  24. }
  25. // --- fail_todo_static_member_fn_call.carbon
  26. library "[[@TEST_NAME]]";
  27. class Class(T:! type) {
  28. fn Make() -> Class(T) { return {}; }
  29. }
  30. fn StaticMemberFunctionCall(T:! type) -> Class(T) {
  31. // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+6]]:3: ERROR: Cannot implicitly convert from `Class` to `Class`.
  32. // CHECK:STDERR: return Class(T).Make();
  33. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
  34. // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+3]]:3: Type `Class` does not implement interface `ImplicitAs`.
  35. // CHECK:STDERR: return Class(T).Make();
  36. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
  37. return Class(T).Make();
  38. }
  39. // CHECK:STDOUT: --- member_access.carbon
  40. // CHECK:STDOUT:
  41. // CHECK:STDOUT: constants {
  42. // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic]
  43. // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template]
  44. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  45. // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template]
  46. // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T) [symbolic]
  47. // CHECK:STDOUT: %.2: type = unbound_element_type %Class.2, %T [symbolic]
  48. // CHECK:STDOUT: %Get.type.1: type = fn_type @Get, @Class(%T) [symbolic]
  49. // CHECK:STDOUT: %Get.1: %Get.type.1 = struct_value () [symbolic]
  50. // CHECK:STDOUT: %.3: type = ptr_type %Class.2 [symbolic]
  51. // CHECK:STDOUT: %.4: type = ptr_type %T [symbolic]
  52. // CHECK:STDOUT: %GetAddr.type.1: type = fn_type @GetAddr, @Class(%T) [symbolic]
  53. // CHECK:STDOUT: %GetAddr.1: %GetAddr.type.1 = struct_value () [symbolic]
  54. // CHECK:STDOUT: %.5: type = struct_type {.x: %T} [symbolic]
  55. // CHECK:STDOUT: %.6: type = ptr_type %.5 [symbolic]
  56. // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
  57. // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
  58. // CHECK:STDOUT: %Class.3: type = class_type @Class, @Class(i32) [template]
  59. // CHECK:STDOUT: %DirectFieldAccess.type: type = fn_type @DirectFieldAccess [template]
  60. // CHECK:STDOUT: %DirectFieldAccess: %DirectFieldAccess.type = struct_value () [template]
  61. // CHECK:STDOUT: %.7: type = unbound_element_type %Class.3, i32 [template]
  62. // CHECK:STDOUT: %Get.type.2: type = fn_type @Get, @Class(i32) [template]
  63. // CHECK:STDOUT: %Get.2: %Get.type.2 = struct_value () [template]
  64. // CHECK:STDOUT: %GetAddr.type.2: type = fn_type @GetAddr, @Class(i32) [template]
  65. // CHECK:STDOUT: %GetAddr.2: %GetAddr.type.2 = struct_value () [template]
  66. // CHECK:STDOUT: %MethodCall.type: type = fn_type @MethodCall [template]
  67. // CHECK:STDOUT: %MethodCall: %MethodCall.type = struct_value () [template]
  68. // CHECK:STDOUT: %.8: type = ptr_type %Class.3 [template]
  69. // CHECK:STDOUT: %AddrMethodCall.type: type = fn_type @AddrMethodCall [template]
  70. // CHECK:STDOUT: %AddrMethodCall: %AddrMethodCall.type = struct_value () [template]
  71. // CHECK:STDOUT: %.9: type = ptr_type i32 [template]
  72. // CHECK:STDOUT: }
  73. // CHECK:STDOUT:
  74. // CHECK:STDOUT: imports {
  75. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  76. // CHECK:STDOUT: .Int32 = %import_ref
  77. // CHECK:STDOUT: import Core//prelude
  78. // CHECK:STDOUT: import Core//prelude/operators
  79. // CHECK:STDOUT: import Core//prelude/types
  80. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  81. // CHECK:STDOUT: import Core//prelude/operators/as
  82. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  83. // CHECK:STDOUT: import Core//prelude/operators/comparison
  84. // CHECK:STDOUT: import Core//prelude/types/bool
  85. // CHECK:STDOUT: }
  86. // CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32]
  87. // CHECK:STDOUT: }
  88. // CHECK:STDOUT:
  89. // CHECK:STDOUT: file {
  90. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  91. // CHECK:STDOUT: .Core = imports.%Core
  92. // CHECK:STDOUT: .Class = %Class.decl
  93. // CHECK:STDOUT: .DirectFieldAccess = %DirectFieldAccess.decl
  94. // CHECK:STDOUT: .MethodCall = %MethodCall.decl
  95. // CHECK:STDOUT: .AddrMethodCall = %AddrMethodCall.decl
  96. // CHECK:STDOUT: }
  97. // CHECK:STDOUT: %Core.import = import Core
  98. // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] {
  99. // CHECK:STDOUT: %T.loc2_13.1: type = param T
  100. // CHECK:STDOUT: %T.loc2_13.2: type = bind_symbolic_name T 0, %T.loc2_13.1 [symbolic = @Class.%T (constants.%T)]
  101. // CHECK:STDOUT: }
  102. // CHECK:STDOUT: %DirectFieldAccess.decl: %DirectFieldAccess.type = fn_decl @DirectFieldAccess [template = constants.%DirectFieldAccess] {
  103. // CHECK:STDOUT: %Class.ref.loc10: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1]
  104. // CHECK:STDOUT: %int.make_type_32.loc10_31: init type = call constants.%Int32() [template = i32]
  105. // CHECK:STDOUT: %.loc10_30.1: type = value_of_initializer %int.make_type_32.loc10_31 [template = i32]
  106. // CHECK:STDOUT: %.loc10_30.2: type = converted %int.make_type_32.loc10_31, %.loc10_30.1 [template = i32]
  107. // CHECK:STDOUT: %.loc10_30.3: init type = call %Class.ref.loc10(%.loc10_30.2) [template = constants.%Class.3]
  108. // CHECK:STDOUT: %.loc10_34.1: type = value_of_initializer %.loc10_30.3 [template = constants.%Class.3]
  109. // CHECK:STDOUT: %.loc10_34.2: type = converted %.loc10_30.3, %.loc10_34.1 [template = constants.%Class.3]
  110. // CHECK:STDOUT: %x.loc10_22.1: %Class.3 = param x
  111. // CHECK:STDOUT: @DirectFieldAccess.%x: %Class.3 = bind_name x, %x.loc10_22.1
  112. // CHECK:STDOUT: %int.make_type_32.loc10_40: init type = call constants.%Int32() [template = i32]
  113. // CHECK:STDOUT: %.loc10_40.1: type = value_of_initializer %int.make_type_32.loc10_40 [template = i32]
  114. // CHECK:STDOUT: %.loc10_40.2: type = converted %int.make_type_32.loc10_40, %.loc10_40.1 [template = i32]
  115. // CHECK:STDOUT: @DirectFieldAccess.%return: ref i32 = var <return slot>
  116. // CHECK:STDOUT: }
  117. // CHECK:STDOUT: %MethodCall.decl: %MethodCall.type = fn_decl @MethodCall [template = constants.%MethodCall] {
  118. // CHECK:STDOUT: %Class.ref.loc14: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1]
  119. // CHECK:STDOUT: %int.make_type_32.loc14_24: init type = call constants.%Int32() [template = i32]
  120. // CHECK:STDOUT: %.loc14_23.1: type = value_of_initializer %int.make_type_32.loc14_24 [template = i32]
  121. // CHECK:STDOUT: %.loc14_23.2: type = converted %int.make_type_32.loc14_24, %.loc14_23.1 [template = i32]
  122. // CHECK:STDOUT: %.loc14_23.3: init type = call %Class.ref.loc14(%.loc14_23.2) [template = constants.%Class.3]
  123. // CHECK:STDOUT: %.loc14_27.1: type = value_of_initializer %.loc14_23.3 [template = constants.%Class.3]
  124. // CHECK:STDOUT: %.loc14_27.2: type = converted %.loc14_23.3, %.loc14_27.1 [template = constants.%Class.3]
  125. // CHECK:STDOUT: %x.loc14_15.1: %Class.3 = param x
  126. // CHECK:STDOUT: @MethodCall.%x: %Class.3 = bind_name x, %x.loc14_15.1
  127. // CHECK:STDOUT: %int.make_type_32.loc14_33: init type = call constants.%Int32() [template = i32]
  128. // CHECK:STDOUT: %.loc14_33.1: type = value_of_initializer %int.make_type_32.loc14_33 [template = i32]
  129. // CHECK:STDOUT: %.loc14_33.2: type = converted %int.make_type_32.loc14_33, %.loc14_33.1 [template = i32]
  130. // CHECK:STDOUT: @MethodCall.%return: ref i32 = var <return slot>
  131. // CHECK:STDOUT: }
  132. // CHECK:STDOUT: %AddrMethodCall.decl: %AddrMethodCall.type = fn_decl @AddrMethodCall [template = constants.%AddrMethodCall] {
  133. // CHECK:STDOUT: %Class.ref.loc18: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1]
  134. // CHECK:STDOUT: %int.make_type_32.loc18_28: init type = call constants.%Int32() [template = i32]
  135. // CHECK:STDOUT: %.loc18_27.1: type = value_of_initializer %int.make_type_32.loc18_28 [template = i32]
  136. // CHECK:STDOUT: %.loc18_27.2: type = converted %int.make_type_32.loc18_28, %.loc18_27.1 [template = i32]
  137. // CHECK:STDOUT: %.loc18_27.3: init type = call %Class.ref.loc18(%.loc18_27.2) [template = constants.%Class.3]
  138. // CHECK:STDOUT: %.loc18_32.1: type = value_of_initializer %.loc18_27.3 [template = constants.%Class.3]
  139. // CHECK:STDOUT: %.loc18_32.2: type = converted %.loc18_27.3, %.loc18_32.1 [template = constants.%Class.3]
  140. // CHECK:STDOUT: %.loc18_32.3: type = ptr_type %Class.3 [template = constants.%.8]
  141. // CHECK:STDOUT: %p.loc18_19.1: %.8 = param p
  142. // CHECK:STDOUT: @AddrMethodCall.%p: %.8 = bind_name p, %p.loc18_19.1
  143. // CHECK:STDOUT: %int.make_type_32.loc18_38: init type = call constants.%Int32() [template = i32]
  144. // CHECK:STDOUT: %.loc18_38.1: type = value_of_initializer %int.make_type_32.loc18_38 [template = i32]
  145. // CHECK:STDOUT: %.loc18_38.2: type = converted %int.make_type_32.loc18_38, %.loc18_38.1 [template = i32]
  146. // CHECK:STDOUT: @AddrMethodCall.%return: ref i32 = var <return slot>
  147. // CHECK:STDOUT: }
  148. // CHECK:STDOUT: }
  149. // CHECK:STDOUT:
  150. // CHECK:STDOUT: generic class @Class(file.%T.loc2_13.2: type) {
  151. // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)]
  152. // CHECK:STDOUT:
  153. // CHECK:STDOUT: !definition:
  154. // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)]
  155. // CHECK:STDOUT: %.1: type = unbound_element_type @Class.%Class (%Class.2), @Class.%T (%T) [symbolic = %.1 (constants.%.2)]
  156. // CHECK:STDOUT: %Get.type: type = fn_type @Get, @Class(%T) [symbolic = %Get.type (constants.%Get.type.1)]
  157. // CHECK:STDOUT: %Get: @Class.%Get.type (%Get.type.1) = struct_value () [symbolic = %Get (constants.%Get.1)]
  158. // CHECK:STDOUT: %GetAddr.type: type = fn_type @GetAddr, @Class(%T) [symbolic = %GetAddr.type (constants.%GetAddr.type.1)]
  159. // CHECK:STDOUT: %GetAddr: @Class.%GetAddr.type (%GetAddr.type.1) = struct_value () [symbolic = %GetAddr (constants.%GetAddr.1)]
  160. // CHECK:STDOUT:
  161. // CHECK:STDOUT: class {
  162. // CHECK:STDOUT: %T.ref.loc3: type = name_ref T, file.%T.loc2_13.2 [symbolic = %T (constants.%T)]
  163. // CHECK:STDOUT: %.loc3: @Class.%.1 (%.2) = field_decl x, element0 [template]
  164. // CHECK:STDOUT: %Get.decl: @Class.%Get.type (%Get.type.1) = fn_decl @Get [symbolic = %Get (constants.%Get.1)] {
  165. // CHECK:STDOUT: %.loc5: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = @Get.%Class (constants.%Class.2)]
  166. // CHECK:STDOUT: %Self.ref.loc5: type = name_ref Self, %.loc5 [symbolic = @Get.%Class (constants.%Class.2)]
  167. // CHECK:STDOUT: %self.loc5_10.1: @Get.%Class (%Class.2) = param self
  168. // CHECK:STDOUT: %self.loc5_10.2: @Get.%Class (%Class.2) = bind_name self, %self.loc5_10.1
  169. // CHECK:STDOUT: %T.ref.loc5: type = name_ref T, file.%T.loc2_13.2 [symbolic = @Get.%T (constants.%T)]
  170. // CHECK:STDOUT: %return.var.loc5: ref @Get.%T (%T) = var <return slot>
  171. // CHECK:STDOUT: }
  172. // CHECK:STDOUT: %GetAddr.decl: @Class.%GetAddr.type (%GetAddr.type.1) = fn_decl @GetAddr [symbolic = %GetAddr (constants.%GetAddr.1)] {
  173. // CHECK:STDOUT: %.loc7_25: type = specific_constant constants.%Class.2, @Class(constants.%T) [symbolic = @GetAddr.%Class (constants.%Class.2)]
  174. // CHECK:STDOUT: %Self.ref.loc7: type = name_ref Self, %.loc7_25 [symbolic = @GetAddr.%Class (constants.%Class.2)]
  175. // CHECK:STDOUT: %.loc7_29: type = ptr_type %Class.2 [symbolic = @GetAddr.%.1 (constants.%.3)]
  176. // CHECK:STDOUT: %self.loc7_19.1: @GetAddr.%.1 (%.3) = param self
  177. // CHECK:STDOUT: %self.loc7_19.3: @GetAddr.%.1 (%.3) = bind_name self, %self.loc7_19.1
  178. // CHECK:STDOUT: %.loc7_14: @GetAddr.%.1 (%.3) = addr_pattern %self.loc7_19.3
  179. // CHECK:STDOUT: %T.ref.loc7: type = name_ref T, file.%T.loc2_13.2 [symbolic = @GetAddr.%T (constants.%T)]
  180. // CHECK:STDOUT: %.loc7_38: type = ptr_type %T [symbolic = @GetAddr.%.2 (constants.%.4)]
  181. // CHECK:STDOUT: %return.var.loc7: ref @GetAddr.%.2 (%.4) = var <return slot>
  182. // CHECK:STDOUT: }
  183. // CHECK:STDOUT:
  184. // CHECK:STDOUT: !members:
  185. // CHECK:STDOUT: .Self = constants.%Class.2
  186. // CHECK:STDOUT: .x = %.loc3
  187. // CHECK:STDOUT: .Get = %Get.decl
  188. // CHECK:STDOUT: .GetAddr = %GetAddr.decl
  189. // CHECK:STDOUT: }
  190. // CHECK:STDOUT: }
  191. // CHECK:STDOUT:
  192. // CHECK:STDOUT: generic fn @Get(file.%T.loc2_13.2: type) {
  193. // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)]
  194. // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)]
  195. // CHECK:STDOUT:
  196. // CHECK:STDOUT: !definition:
  197. // CHECK:STDOUT: %.1: type = unbound_element_type @Get.%Class (%Class.2), @Get.%T (%T) [symbolic = %.1 (constants.%.2)]
  198. // CHECK:STDOUT:
  199. // CHECK:STDOUT: fn[@Class.%self.loc5_10.2: @Get.%Class (%Class.2)]() -> @Get.%T (%T) {
  200. // CHECK:STDOUT: !entry:
  201. // CHECK:STDOUT: %self.ref: @Get.%Class (%Class.2) = name_ref self, @Class.%self.loc5_10.2
  202. // CHECK:STDOUT: %x.ref: @Get.%.1 (%.2) = name_ref x, @Class.%.loc3 [template = @Class.%.loc3]
  203. // CHECK:STDOUT: %.loc5_42.1: ref @Get.%T (%T) = class_element_access %self.ref, element0
  204. // CHECK:STDOUT: %.loc5_42.2: @Get.%T (%T) = bind_value %.loc5_42.1
  205. // CHECK:STDOUT: return %.loc5_42.2
  206. // CHECK:STDOUT: }
  207. // CHECK:STDOUT: }
  208. // CHECK:STDOUT:
  209. // CHECK:STDOUT: generic fn @GetAddr(file.%T.loc2_13.2: type) {
  210. // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)]
  211. // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)]
  212. // CHECK:STDOUT: %.1: type = ptr_type @GetAddr.%Class (%Class.2) [symbolic = %.1 (constants.%.3)]
  213. // CHECK:STDOUT: %.2: type = ptr_type @GetAddr.%T (%T) [symbolic = %.2 (constants.%.4)]
  214. // CHECK:STDOUT:
  215. // CHECK:STDOUT: !definition:
  216. // CHECK:STDOUT: %.3: type = unbound_element_type @GetAddr.%Class (%Class.2), @GetAddr.%T (%T) [symbolic = %.3 (constants.%.2)]
  217. // CHECK:STDOUT:
  218. // CHECK:STDOUT: fn[addr @Class.%self.loc7_19.3: @GetAddr.%.1 (%.3)]() -> @GetAddr.%.2 (%.4) {
  219. // CHECK:STDOUT: !entry:
  220. // CHECK:STDOUT: %self.ref: @GetAddr.%.1 (%.3) = name_ref self, @Class.%self.loc7_19.3
  221. // CHECK:STDOUT: %.loc7_54.1: ref @GetAddr.%Class (%Class.2) = deref %self.ref
  222. // CHECK:STDOUT: %x.ref: @GetAddr.%.3 (%.2) = name_ref x, @Class.%.loc3 [template = @Class.%.loc3]
  223. // CHECK:STDOUT: %.loc7_54.2: ref @GetAddr.%T (%T) = class_element_access %.loc7_54.1, element0
  224. // CHECK:STDOUT: %.loc7_49: @GetAddr.%.2 (%.4) = addr_of %.loc7_54.2
  225. // CHECK:STDOUT: return %.loc7_49
  226. // CHECK:STDOUT: }
  227. // CHECK:STDOUT: }
  228. // CHECK:STDOUT:
  229. // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
  230. // CHECK:STDOUT:
  231. // CHECK:STDOUT: fn @DirectFieldAccess(%x: %Class.3) -> i32 {
  232. // CHECK:STDOUT: !entry:
  233. // CHECK:STDOUT: %x.ref.loc11_10: %Class.3 = name_ref x, %x
  234. // CHECK:STDOUT: %x.ref.loc11_11: %.7 = name_ref x, @Class.%.loc3 [template = @Class.%.loc3]
  235. // CHECK:STDOUT: %.loc11_11.1: ref i32 = class_element_access %x.ref.loc11_10, element0
  236. // CHECK:STDOUT: %.loc11_11.2: i32 = bind_value %.loc11_11.1
  237. // CHECK:STDOUT: return %.loc11_11.2
  238. // CHECK:STDOUT: }
  239. // CHECK:STDOUT:
  240. // CHECK:STDOUT: fn @MethodCall(%x: %Class.3) -> i32 {
  241. // CHECK:STDOUT: !entry:
  242. // CHECK:STDOUT: %x.ref: %Class.3 = name_ref x, %x
  243. // CHECK:STDOUT: %.loc15_11.1: %Get.type.2 = specific_constant @Class.%Get.decl, @Class(i32) [template = constants.%Get.2]
  244. // CHECK:STDOUT: %Get.ref: %Get.type.2 = name_ref Get, %.loc15_11.1 [template = constants.%Get.2]
  245. // CHECK:STDOUT: %.loc15_11.2: <bound method> = bound_method %x.ref, %Get.ref
  246. // CHECK:STDOUT: %Get.call: init i32 = call %.loc15_11.2(%x.ref)
  247. // CHECK:STDOUT: %.loc15_17.1: i32 = value_of_initializer %Get.call
  248. // CHECK:STDOUT: %.loc15_17.2: i32 = converted %Get.call, %.loc15_17.1
  249. // CHECK:STDOUT: return %.loc15_17.2
  250. // CHECK:STDOUT: }
  251. // CHECK:STDOUT:
  252. // CHECK:STDOUT: fn @AddrMethodCall(%p: %.8) -> i32 {
  253. // CHECK:STDOUT: !entry:
  254. // CHECK:STDOUT: %p.ref: %.8 = name_ref p, %p
  255. // CHECK:STDOUT: %.loc19_12.1: ref %Class.3 = deref %p.ref
  256. // CHECK:STDOUT: %.loc19_12.2: %GetAddr.type.2 = specific_constant @Class.%GetAddr.decl, @Class(i32) [template = constants.%GetAddr.2]
  257. // CHECK:STDOUT: %GetAddr.ref: %GetAddr.type.2 = name_ref GetAddr, %.loc19_12.2 [template = constants.%GetAddr.2]
  258. // CHECK:STDOUT: %.loc19_12.3: <bound method> = bound_method %.loc19_12.1, %GetAddr.ref
  259. // CHECK:STDOUT: %.loc19_12.4: %.8 = addr_of %.loc19_12.1
  260. // CHECK:STDOUT: %GetAddr.call: init %.9 = call %.loc19_12.3(%.loc19_12.4)
  261. // CHECK:STDOUT: %.loc19_21.1: %.9 = value_of_initializer %GetAddr.call
  262. // CHECK:STDOUT: %.loc19_21.2: %.9 = converted %GetAddr.call, %.loc19_21.1
  263. // CHECK:STDOUT: %.loc19_10.1: ref i32 = deref %.loc19_21.2
  264. // CHECK:STDOUT: %.loc19_10.2: i32 = bind_value %.loc19_10.1
  265. // CHECK:STDOUT: return %.loc19_10.2
  266. // CHECK:STDOUT: }
  267. // CHECK:STDOUT:
  268. // CHECK:STDOUT: specific @Class(constants.%T) {
  269. // CHECK:STDOUT: %T => constants.%T
  270. // CHECK:STDOUT:
  271. // CHECK:STDOUT: !definition:
  272. // CHECK:STDOUT: %Class => constants.%Class.2
  273. // CHECK:STDOUT: %.1 => constants.%.2
  274. // CHECK:STDOUT: %Get.type => constants.%Get.type.1
  275. // CHECK:STDOUT: %Get => constants.%Get.1
  276. // CHECK:STDOUT: %GetAddr.type => constants.%GetAddr.type.1
  277. // CHECK:STDOUT: %GetAddr => constants.%GetAddr.1
  278. // CHECK:STDOUT: }
  279. // CHECK:STDOUT:
  280. // CHECK:STDOUT: specific @Class(@Get.%T) {
  281. // CHECK:STDOUT: %T => constants.%T
  282. // CHECK:STDOUT: }
  283. // CHECK:STDOUT:
  284. // CHECK:STDOUT: specific @Get(constants.%T) {
  285. // CHECK:STDOUT: %T => constants.%T
  286. // CHECK:STDOUT: %Class => constants.%Class.2
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: specific @Class(@GetAddr.%T) {
  290. // CHECK:STDOUT: %T => constants.%T
  291. // CHECK:STDOUT: }
  292. // CHECK:STDOUT:
  293. // CHECK:STDOUT: specific @GetAddr(constants.%T) {
  294. // CHECK:STDOUT: %T => constants.%T
  295. // CHECK:STDOUT: %Class => constants.%Class.2
  296. // CHECK:STDOUT: %.1 => constants.%.3
  297. // CHECK:STDOUT: %.2 => constants.%.4
  298. // CHECK:STDOUT: }
  299. // CHECK:STDOUT:
  300. // CHECK:STDOUT: specific @Class(@Class.%T) {
  301. // CHECK:STDOUT: %T => constants.%T
  302. // CHECK:STDOUT: }
  303. // CHECK:STDOUT:
  304. // CHECK:STDOUT: specific @Class(i32) {
  305. // CHECK:STDOUT: %T => i32
  306. // CHECK:STDOUT:
  307. // CHECK:STDOUT: !definition:
  308. // CHECK:STDOUT: %Class => constants.%Class.3
  309. // CHECK:STDOUT: %.1 => constants.%.7
  310. // CHECK:STDOUT: %Get.type => constants.%Get.type.2
  311. // CHECK:STDOUT: %Get => constants.%Get.2
  312. // CHECK:STDOUT: %GetAddr.type => constants.%GetAddr.type.2
  313. // CHECK:STDOUT: %GetAddr => constants.%GetAddr.2
  314. // CHECK:STDOUT: }
  315. // CHECK:STDOUT:
  316. // CHECK:STDOUT: specific @Get(i32) {
  317. // CHECK:STDOUT: %T => i32
  318. // CHECK:STDOUT: %Class => constants.%Class.3
  319. // CHECK:STDOUT: }
  320. // CHECK:STDOUT:
  321. // CHECK:STDOUT: specific @GetAddr(i32) {
  322. // CHECK:STDOUT: %T => i32
  323. // CHECK:STDOUT: %Class => constants.%Class.3
  324. // CHECK:STDOUT: %.1 => constants.%.8
  325. // CHECK:STDOUT: %.2 => constants.%.9
  326. // CHECK:STDOUT: }
  327. // CHECK:STDOUT:
  328. // CHECK:STDOUT: --- fail_todo_static_member_fn_call.carbon
  329. // CHECK:STDOUT:
  330. // CHECK:STDOUT: constants {
  331. // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic]
  332. // CHECK:STDOUT: %Class.type: type = generic_class_type @Class [template]
  333. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  334. // CHECK:STDOUT: %Class.1: %Class.type = struct_value () [template]
  335. // CHECK:STDOUT: %Class.2: type = class_type @Class, @Class(%T) [symbolic]
  336. // CHECK:STDOUT: %Make.type: type = fn_type @Make, @Class(%T) [symbolic]
  337. // CHECK:STDOUT: %Make: %Make.type = struct_value () [symbolic]
  338. // CHECK:STDOUT: %.2: type = struct_type {} [template]
  339. // CHECK:STDOUT: %.3: type = ptr_type %.2 [template]
  340. // CHECK:STDOUT: %struct: %Class.2 = struct_value () [symbolic]
  341. // CHECK:STDOUT: %StaticMemberFunctionCall.type: type = fn_type @StaticMemberFunctionCall [template]
  342. // CHECK:STDOUT: %StaticMemberFunctionCall: %StaticMemberFunctionCall.type = struct_value () [template]
  343. // CHECK:STDOUT: %ImplicitAs.type: type = generic_interface_type @ImplicitAs [template]
  344. // CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type = struct_value () [template]
  345. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic]
  346. // CHECK:STDOUT: %.4: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic]
  347. // CHECK:STDOUT: %Self.1: @ImplicitAs.%.1 (%.4) = bind_symbolic_name Self 1 [symbolic]
  348. // CHECK:STDOUT: %Self.2: %.4 = bind_symbolic_name Self 1 [symbolic]
  349. // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic]
  350. // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic]
  351. // CHECK:STDOUT: %.5: type = assoc_entity_type %.4, %Convert.type.1 [symbolic]
  352. // CHECK:STDOUT: %.6: %.5 = assoc_entity element0, imports.%import_ref.5 [symbolic]
  353. // CHECK:STDOUT: %.7: type = interface_type @ImplicitAs, @ImplicitAs(%Class.2) [symbolic]
  354. // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%Class.2) [symbolic]
  355. // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic]
  356. // CHECK:STDOUT: %.8: type = assoc_entity_type %.7, %Convert.type.2 [symbolic]
  357. // CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.5 [symbolic]
  358. // CHECK:STDOUT: %.10: %.5 = assoc_entity element0, imports.%import_ref.6 [symbolic]
  359. // CHECK:STDOUT: }
  360. // CHECK:STDOUT:
  361. // CHECK:STDOUT: imports {
  362. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  363. // CHECK:STDOUT: .ImplicitAs = %import_ref.1
  364. // CHECK:STDOUT: import Core//prelude
  365. // CHECK:STDOUT: import Core//prelude/operators
  366. // CHECK:STDOUT: import Core//prelude/types
  367. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  368. // CHECK:STDOUT: import Core//prelude/operators/as
  369. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  370. // CHECK:STDOUT: import Core//prelude/operators/comparison
  371. // CHECK:STDOUT: import Core//prelude/types/bool
  372. // CHECK:STDOUT: }
  373. // CHECK:STDOUT: %import_ref.1: %ImplicitAs.type = import_ref Core//prelude/operators/as, inst+37, loaded [template = constants.%ImplicitAs]
  374. // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+42, unloaded
  375. // CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.2 (%.5) = import_ref Core//prelude/operators/as, inst+59, loaded [symbolic = @ImplicitAs.%.3 (constants.%.10)]
  376. // CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+52, unloaded
  377. // CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+52, unloaded
  378. // CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+52, unloaded
  379. // CHECK:STDOUT: }
  380. // CHECK:STDOUT:
  381. // CHECK:STDOUT: file {
  382. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  383. // CHECK:STDOUT: .Core = imports.%Core
  384. // CHECK:STDOUT: .Class = %Class.decl
  385. // CHECK:STDOUT: .StaticMemberFunctionCall = %StaticMemberFunctionCall.decl
  386. // CHECK:STDOUT: }
  387. // CHECK:STDOUT: %Core.import = import Core
  388. // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] {
  389. // CHECK:STDOUT: %T.loc4_13.1: type = param T
  390. // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Class.%T (constants.%T)]
  391. // CHECK:STDOUT: }
  392. // CHECK:STDOUT: %StaticMemberFunctionCall.decl: %StaticMemberFunctionCall.type = fn_decl @StaticMemberFunctionCall [template = constants.%StaticMemberFunctionCall] {
  393. // CHECK:STDOUT: %T.loc8_29.1: type = param T
  394. // CHECK:STDOUT: @StaticMemberFunctionCall.%T.loc8: type = bind_symbolic_name T 0, %T.loc8_29.1 [symbolic = @StaticMemberFunctionCall.%T.1 (constants.%T)]
  395. // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, %Class.decl [template = constants.%Class.1]
  396. // CHECK:STDOUT: %T.ref: type = name_ref T, @StaticMemberFunctionCall.%T.loc8 [symbolic = @StaticMemberFunctionCall.%T.1 (constants.%T)]
  397. // CHECK:STDOUT: %.loc8_47: init type = call %Class.ref(%T.ref) [symbolic = @StaticMemberFunctionCall.%Class (constants.%Class.2)]
  398. // CHECK:STDOUT: %.loc8_49.1: type = value_of_initializer %.loc8_47 [symbolic = @StaticMemberFunctionCall.%Class (constants.%Class.2)]
  399. // CHECK:STDOUT: %.loc8_49.2: type = converted %.loc8_47, %.loc8_49.1 [symbolic = @StaticMemberFunctionCall.%Class (constants.%Class.2)]
  400. // CHECK:STDOUT: @StaticMemberFunctionCall.%return: ref @StaticMemberFunctionCall.%Class (%Class.2) = var <return slot>
  401. // CHECK:STDOUT: }
  402. // CHECK:STDOUT: }
  403. // CHECK:STDOUT:
  404. // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) {
  405. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)]
  406. // CHECK:STDOUT:
  407. // CHECK:STDOUT: !definition:
  408. // CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.4)]
  409. // CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)]
  410. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)]
  411. // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)]
  412. // CHECK:STDOUT: %.2: type = assoc_entity_type @ImplicitAs.%.1 (%.4), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.2 (constants.%.5)]
  413. // CHECK:STDOUT: %.3: @ImplicitAs.%.2 (%.5) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.3 (constants.%.6)]
  414. // CHECK:STDOUT:
  415. // CHECK:STDOUT: interface {
  416. // CHECK:STDOUT: !members:
  417. // CHECK:STDOUT: .Self = imports.%import_ref.2
  418. // CHECK:STDOUT: .Convert = imports.%import_ref.3
  419. // CHECK:STDOUT: witness = (imports.%import_ref.4)
  420. // CHECK:STDOUT: }
  421. // CHECK:STDOUT: }
  422. // CHECK:STDOUT:
  423. // CHECK:STDOUT: generic class @Class(file.%T.loc4_13.2: type) {
  424. // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)]
  425. // CHECK:STDOUT:
  426. // CHECK:STDOUT: !definition:
  427. // CHECK:STDOUT: %Make.type: type = fn_type @Make, @Class(%T) [symbolic = %Make.type (constants.%Make.type)]
  428. // CHECK:STDOUT: %Make: @Class.%Make.type (%Make.type) = struct_value () [symbolic = %Make (constants.%Make)]
  429. // CHECK:STDOUT:
  430. // CHECK:STDOUT: class {
  431. // CHECK:STDOUT: %Make.decl: @Class.%Make.type (%Make.type) = fn_decl @Make [symbolic = %Make (constants.%Make)] {
  432. // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1]
  433. // CHECK:STDOUT: %T.ref: type = name_ref T, file.%T.loc4_13.2 [symbolic = @Make.%T (constants.%T)]
  434. // CHECK:STDOUT: %.loc5_21: init type = call %Class.ref(%T.ref) [symbolic = @Make.%Class (constants.%Class.2)]
  435. // CHECK:STDOUT: %.loc5_23.1: type = value_of_initializer %.loc5_21 [symbolic = @Make.%Class (constants.%Class.2)]
  436. // CHECK:STDOUT: %.loc5_23.2: type = converted %.loc5_21, %.loc5_23.1 [symbolic = @Make.%Class (constants.%Class.2)]
  437. // CHECK:STDOUT: %return.var: ref @Make.%Class (%Class.2) = var <return slot>
  438. // CHECK:STDOUT: }
  439. // CHECK:STDOUT:
  440. // CHECK:STDOUT: !members:
  441. // CHECK:STDOUT: .Self = constants.%Class.2
  442. // CHECK:STDOUT: .Make = %Make.decl
  443. // CHECK:STDOUT: }
  444. // CHECK:STDOUT: }
  445. // CHECK:STDOUT:
  446. // CHECK:STDOUT: generic fn @Make(file.%T.loc4_13.2: type) {
  447. // CHECK:STDOUT: %T: type = bind_symbolic_name T 0 [symbolic = %T (constants.%T)]
  448. // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T) [symbolic = %Class (constants.%Class.2)]
  449. // CHECK:STDOUT:
  450. // CHECK:STDOUT: !definition:
  451. // CHECK:STDOUT: %struct: @Make.%Class (%Class.2) = struct_value () [symbolic = %struct (constants.%struct)]
  452. // CHECK:STDOUT:
  453. // CHECK:STDOUT: fn() -> @Class.%return.var: @Make.%Class (%Class.2) {
  454. // CHECK:STDOUT: !entry:
  455. // CHECK:STDOUT: %.loc5_35.1: %.2 = struct_literal ()
  456. // CHECK:STDOUT: %.loc5_35.2: init @Make.%Class (%Class.2) = class_init (), @Class.%return.var [symbolic = %struct (constants.%struct)]
  457. // CHECK:STDOUT: %.loc5_36: init @Make.%Class (%Class.2) = converted %.loc5_35.1, %.loc5_35.2 [symbolic = %struct (constants.%struct)]
  458. // CHECK:STDOUT: return %.loc5_36 to @Class.%return.var
  459. // CHECK:STDOUT: }
  460. // CHECK:STDOUT: }
  461. // CHECK:STDOUT:
  462. // CHECK:STDOUT: generic fn @StaticMemberFunctionCall(%T.loc8: type) {
  463. // CHECK:STDOUT: %T.1: type = bind_symbolic_name T 0 [symbolic = %T.1 (constants.%T)]
  464. // CHECK:STDOUT: %Class: type = class_type @Class, @Class(%T.1) [symbolic = %Class (constants.%Class.2)]
  465. // CHECK:STDOUT:
  466. // CHECK:STDOUT: !definition:
  467. // CHECK:STDOUT: %Make.type: type = fn_type @Make, @Class(%T.1) [symbolic = %Make.type (constants.%Make.type)]
  468. // CHECK:STDOUT: %Make: @StaticMemberFunctionCall.%Make.type (%Make.type) = struct_value () [symbolic = %Make (constants.%Make)]
  469. // CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Class) [symbolic = %.1 (constants.%.7)]
  470. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Class) [symbolic = %Convert.type (constants.%Convert.type.2)]
  471. // CHECK:STDOUT: %.2: type = assoc_entity_type @StaticMemberFunctionCall.%.1 (%.7), @StaticMemberFunctionCall.%Convert.type (%Convert.type.2) [symbolic = %.2 (constants.%.8)]
  472. // CHECK:STDOUT: %.3: @StaticMemberFunctionCall.%.2 (%.8) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.3 (constants.%.9)]
  473. // CHECK:STDOUT:
  474. // CHECK:STDOUT: fn(%T.loc8: type) -> %return: @StaticMemberFunctionCall.%Class (%Class.2) {
  475. // CHECK:STDOUT: !entry:
  476. // CHECK:STDOUT: %Class.ref: %Class.type = name_ref Class, file.%Class.decl [template = constants.%Class.1]
  477. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc8 [symbolic = %T.1 (constants.%T)]
  478. // CHECK:STDOUT: %.loc15_15: init type = call %Class.ref(%T.ref) [symbolic = %Class (constants.%Class.2)]
  479. // CHECK:STDOUT: %.loc15_18: @StaticMemberFunctionCall.%Make.type (%Make.type) = specific_constant @Class.%Make.decl, @Class(constants.%T) [symbolic = %Make (constants.%Make)]
  480. // CHECK:STDOUT: %Make.ref: @StaticMemberFunctionCall.%Make.type (%Make.type) = name_ref Make, %.loc15_18 [symbolic = %Make (constants.%Make)]
  481. // CHECK:STDOUT: %.loc15_23.1: ref @StaticMemberFunctionCall.%Class (%Class.2) = temporary_storage
  482. // CHECK:STDOUT: %Make.call: init @StaticMemberFunctionCall.%Class (%Class.2) = call %Make.ref() to %.loc15_23.1
  483. // CHECK:STDOUT: %.loc15_25.1: init type = call constants.%ImplicitAs(constants.%Class.2) [symbolic = %.1 (constants.%.7)]
  484. // CHECK:STDOUT: %.loc15_25.2: @StaticMemberFunctionCall.%.2 (%.8) = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%Class.2) [symbolic = %.3 (constants.%.9)]
  485. // CHECK:STDOUT: %Convert.ref: @StaticMemberFunctionCall.%.2 (%.8) = name_ref Convert, %.loc15_25.2 [symbolic = %.3 (constants.%.9)]
  486. // CHECK:STDOUT: %.loc15_23.2: ref @StaticMemberFunctionCall.%Class (%Class.2) = temporary %.loc15_23.1, %Make.call
  487. // CHECK:STDOUT: %.loc15_25.3: @StaticMemberFunctionCall.%Class (%Class.2) = converted %Make.call, <error> [template = <error>]
  488. // CHECK:STDOUT: return <error> to %return
  489. // CHECK:STDOUT: }
  490. // CHECK:STDOUT: }
  491. // CHECK:STDOUT:
  492. // CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%.1 (%.4)) {
  493. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest 0 [symbolic = %Dest (constants.%Dest)]
  494. // CHECK:STDOUT: %.1: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %.1 (constants.%.4)]
  495. // CHECK:STDOUT: %Self: %.4 = bind_symbolic_name Self 1 [symbolic = %Self (constants.%Self.2)]
  496. // CHECK:STDOUT:
  497. // CHECK:STDOUT: fn[%self: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest);
  498. // CHECK:STDOUT: }
  499. // CHECK:STDOUT:
  500. // CHECK:STDOUT: specific @Class(constants.%T) {
  501. // CHECK:STDOUT: %T => constants.%T
  502. // CHECK:STDOUT:
  503. // CHECK:STDOUT: !definition:
  504. // CHECK:STDOUT: %Make.type => constants.%Make.type
  505. // CHECK:STDOUT: %Make => constants.%Make
  506. // CHECK:STDOUT: }
  507. // CHECK:STDOUT:
  508. // CHECK:STDOUT: specific @Class(@Make.%T) {
  509. // CHECK:STDOUT: %T => constants.%T
  510. // CHECK:STDOUT: }
  511. // CHECK:STDOUT:
  512. // CHECK:STDOUT: specific @Make(constants.%T) {
  513. // CHECK:STDOUT: %T => constants.%T
  514. // CHECK:STDOUT: %Class => constants.%Class.2
  515. // CHECK:STDOUT: }
  516. // CHECK:STDOUT:
  517. // CHECK:STDOUT: specific @Class(@Class.%T) {
  518. // CHECK:STDOUT: %T => constants.%T
  519. // CHECK:STDOUT: }
  520. // CHECK:STDOUT:
  521. // CHECK:STDOUT: specific @Class(@StaticMemberFunctionCall.%T.1) {
  522. // CHECK:STDOUT: %T => constants.%T
  523. // CHECK:STDOUT: }
  524. // CHECK:STDOUT:
  525. // CHECK:STDOUT: specific @StaticMemberFunctionCall(constants.%T) {
  526. // CHECK:STDOUT: %T.1 => constants.%T
  527. // CHECK:STDOUT: %Class => constants.%Class.2
  528. // CHECK:STDOUT: }
  529. // CHECK:STDOUT:
  530. // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
  531. // CHECK:STDOUT: %Dest => constants.%Dest
  532. // CHECK:STDOUT: }
  533. // CHECK:STDOUT:
  534. // CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) {
  535. // CHECK:STDOUT: %Dest => constants.%Dest
  536. // CHECK:STDOUT: }
  537. // CHECK:STDOUT:
  538. // CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) {
  539. // CHECK:STDOUT: %Dest => constants.%Dest
  540. // CHECK:STDOUT: }
  541. // CHECK:STDOUT:
  542. // CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) {
  543. // CHECK:STDOUT: %Dest => constants.%Dest
  544. // CHECK:STDOUT: %.1 => constants.%.4
  545. // CHECK:STDOUT: %Self => constants.%Self.1
  546. // CHECK:STDOUT: }
  547. // CHECK:STDOUT:
  548. // CHECK:STDOUT: specific @ImplicitAs(constants.%Class.2) {
  549. // CHECK:STDOUT: %Dest => constants.%Class.2
  550. // CHECK:STDOUT:
  551. // CHECK:STDOUT: !definition:
  552. // CHECK:STDOUT: %.1 => constants.%.7
  553. // CHECK:STDOUT: %Self => constants.%Self.2
  554. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.2
  555. // CHECK:STDOUT: %Convert => constants.%Convert.2
  556. // CHECK:STDOUT: %.2 => constants.%.8
  557. // CHECK:STDOUT: %.3 => constants.%.9
  558. // CHECK:STDOUT: }
  559. // CHECK:STDOUT:
  560. // CHECK:STDOUT: specific @ImplicitAs(@StaticMemberFunctionCall.%Class) {
  561. // CHECK:STDOUT: %Dest => constants.%Class.2
  562. // CHECK:STDOUT: }
  563. // CHECK:STDOUT: