fail_address_of_value.carbon 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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/int.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/pointer/fail_address_of_value.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/pointer/fail_address_of_value.carbon
  14. fn G() -> i32;
  15. fn H() -> {.a: i32};
  16. fn AddressOfLiteral() {
  17. // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression [AddrOfNonRef]
  18. // CHECK:STDERR: &0;
  19. // CHECK:STDERR: ^
  20. // CHECK:STDERR:
  21. &0;
  22. // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression [AddrOfNonRef]
  23. // CHECK:STDERR: &true;
  24. // CHECK:STDERR: ^
  25. // CHECK:STDERR:
  26. &true;
  27. // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression [AddrOfNonRef]
  28. // CHECK:STDERR: &1.0;
  29. // CHECK:STDERR: ^
  30. // CHECK:STDERR:
  31. &1.0;
  32. // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression [AddrOfNonRef]
  33. // CHECK:STDERR: &"Hello";
  34. // CHECK:STDERR: ^
  35. // CHECK:STDERR:
  36. &"Hello";
  37. // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression [AddrOfNonRef]
  38. // CHECK:STDERR: &(1, 2);
  39. // CHECK:STDERR: ^
  40. // CHECK:STDERR:
  41. &(1, 2);
  42. // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression [AddrOfNonRef]
  43. // CHECK:STDERR: &{.a = 5};
  44. // CHECK:STDERR: ^
  45. // CHECK:STDERR:
  46. &{.a = 5};
  47. }
  48. fn AddressOfOperator() {
  49. // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression [AddrOfNonRef]
  50. // CHECK:STDERR: &(true and false);
  51. // CHECK:STDERR: ^
  52. // CHECK:STDERR:
  53. &(true and false);
  54. // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of a temporary object [AddrOfEphemeralRef]
  55. // CHECK:STDERR: &H().a;
  56. // CHECK:STDERR: ^
  57. // CHECK:STDERR:
  58. &H().a;
  59. // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression [AddrOfNonRef]
  60. // CHECK:STDERR: &(not true);
  61. // CHECK:STDERR: ^
  62. // CHECK:STDERR:
  63. &(not true);
  64. }
  65. fn AddressOfCall() {
  66. // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression [AddrOfNonRef]
  67. // CHECK:STDERR: &G();
  68. // CHECK:STDERR: ^
  69. // CHECK:STDERR:
  70. &G();
  71. }
  72. fn AddressOfType() {
  73. // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression [AddrOfNonRef]
  74. // CHECK:STDERR: &i32;
  75. // CHECK:STDERR: ^
  76. // CHECK:STDERR:
  77. &i32;
  78. // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression [AddrOfNonRef]
  79. // CHECK:STDERR: &(const i32*);
  80. // CHECK:STDERR: ^
  81. // CHECK:STDERR:
  82. &(const i32*);
  83. }
  84. fn AddressOfTupleElementValue() {
  85. // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression [AddrOfNonRef]
  86. // CHECK:STDERR: &((1, 2).0);
  87. // CHECK:STDERR: ^
  88. // CHECK:STDERR:
  89. &((1, 2).0);
  90. }
  91. fn AddressOfParam(param: i32) {
  92. // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:26: error: cannot take the address of non-reference expression [AddrOfNonRef]
  93. // CHECK:STDERR: var param_addr: i32* = &param;
  94. // CHECK:STDERR: ^
  95. // CHECK:STDERR:
  96. var param_addr: i32* = &param;
  97. }
  98. // CHECK:STDOUT: --- fail_address_of_value.carbon
  99. // CHECK:STDOUT:
  100. // CHECK:STDOUT: constants {
  101. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  102. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  103. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  104. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  105. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  106. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  107. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  108. // CHECK:STDOUT: %struct_type.a.ba9: type = struct_type {.a: %i32} [concrete]
  109. // CHECK:STDOUT: %pattern_type.268: type = pattern_type %struct_type.a.ba9 [concrete]
  110. // CHECK:STDOUT: %H.type: type = fn_type @H [concrete]
  111. // CHECK:STDOUT: %H: %H.type = struct_value () [concrete]
  112. // CHECK:STDOUT: %AddressOfLiteral.type: type = fn_type @AddressOfLiteral [concrete]
  113. // CHECK:STDOUT: %AddressOfLiteral: %AddressOfLiteral.type = struct_value () [concrete]
  114. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  115. // CHECK:STDOUT: %ptr.1d1: type = ptr_type Core.IntLiteral [concrete]
  116. // CHECK:STDOUT: %true: bool = bool_literal true [concrete]
  117. // CHECK:STDOUT: %ptr.bb2: type = ptr_type bool [concrete]
  118. // CHECK:STDOUT: %float: f64 = float_literal 1 [concrete]
  119. // CHECK:STDOUT: %ptr.ef1: type = ptr_type f64 [concrete]
  120. // CHECK:STDOUT: %ptr.a45: type = ptr_type String [concrete]
  121. // CHECK:STDOUT: %str: String = string_literal "Hello" [concrete]
  122. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  123. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  124. // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
  125. // CHECK:STDOUT: %ptr.b50: type = ptr_type %tuple.type [concrete]
  126. // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete]
  127. // CHECK:STDOUT: %struct_type.a.a6c: type = struct_type {.a: Core.IntLiteral} [concrete]
  128. // CHECK:STDOUT: %ptr.4e0: type = ptr_type %struct_type.a.a6c [concrete]
  129. // CHECK:STDOUT: %AddressOfOperator.type: type = fn_type @AddressOfOperator [concrete]
  130. // CHECK:STDOUT: %AddressOfOperator: %AddressOfOperator.type = struct_value () [concrete]
  131. // CHECK:STDOUT: %false: bool = bool_literal false [concrete]
  132. // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete]
  133. // CHECK:STDOUT: %AddressOfCall.type: type = fn_type @AddressOfCall [concrete]
  134. // CHECK:STDOUT: %AddressOfCall: %AddressOfCall.type = struct_value () [concrete]
  135. // CHECK:STDOUT: %AddressOfType.type: type = fn_type @AddressOfType [concrete]
  136. // CHECK:STDOUT: %AddressOfType: %AddressOfType.type = struct_value () [concrete]
  137. // CHECK:STDOUT: %ptr.db7: type = ptr_type type [concrete]
  138. // CHECK:STDOUT: %const: type = const_type %i32 [concrete]
  139. // CHECK:STDOUT: %ptr.36b: type = ptr_type %const [concrete]
  140. // CHECK:STDOUT: %AddressOfTupleElementValue.type: type = fn_type @AddressOfTupleElementValue [concrete]
  141. // CHECK:STDOUT: %AddressOfTupleElementValue: %AddressOfTupleElementValue.type = struct_value () [concrete]
  142. // CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%int_1, %int_2) [concrete]
  143. // CHECK:STDOUT: %AddressOfParam.type: type = fn_type @AddressOfParam [concrete]
  144. // CHECK:STDOUT: %AddressOfParam: %AddressOfParam.type = struct_value () [concrete]
  145. // CHECK:STDOUT: %pattern_type.fe8: type = pattern_type %ptr.235 [concrete]
  146. // CHECK:STDOUT: }
  147. // CHECK:STDOUT:
  148. // CHECK:STDOUT: imports {
  149. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  150. // CHECK:STDOUT: .Int = %Core.Int
  151. // CHECK:STDOUT: import Core//prelude
  152. // CHECK:STDOUT: import Core//prelude/...
  153. // CHECK:STDOUT: }
  154. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  155. // CHECK:STDOUT: }
  156. // CHECK:STDOUT:
  157. // CHECK:STDOUT: file {
  158. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  159. // CHECK:STDOUT: .Core = imports.%Core
  160. // CHECK:STDOUT: .G = %G.decl
  161. // CHECK:STDOUT: .H = %H.decl
  162. // CHECK:STDOUT: .AddressOfLiteral = %AddressOfLiteral.decl
  163. // CHECK:STDOUT: .AddressOfOperator = %AddressOfOperator.decl
  164. // CHECK:STDOUT: .AddressOfCall = %AddressOfCall.decl
  165. // CHECK:STDOUT: .AddressOfType = %AddressOfType.decl
  166. // CHECK:STDOUT: .AddressOfTupleElementValue = %AddressOfTupleElementValue.decl
  167. // CHECK:STDOUT: .AddressOfParam = %AddressOfParam.decl
  168. // CHECK:STDOUT: }
  169. // CHECK:STDOUT: %Core.import = import Core
  170. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  171. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  172. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
  173. // CHECK:STDOUT: } {
  174. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  175. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  176. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
  177. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  178. // CHECK:STDOUT: }
  179. // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [concrete = constants.%H] {
  180. // CHECK:STDOUT: %return.patt: %pattern_type.268 = return_slot_pattern [concrete]
  181. // CHECK:STDOUT: %return.param_patt: %pattern_type.268 = out_param_pattern %return.patt, call_param0 [concrete]
  182. // CHECK:STDOUT: } {
  183. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  184. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  185. // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [concrete = constants.%struct_type.a.ba9]
  186. // CHECK:STDOUT: %return.param: ref %struct_type.a.ba9 = out_param call_param0
  187. // CHECK:STDOUT: %return: ref %struct_type.a.ba9 = return_slot %return.param
  188. // CHECK:STDOUT: }
  189. // CHECK:STDOUT: %AddressOfLiteral.decl: %AddressOfLiteral.type = fn_decl @AddressOfLiteral [concrete = constants.%AddressOfLiteral] {} {}
  190. // CHECK:STDOUT: %AddressOfOperator.decl: %AddressOfOperator.type = fn_decl @AddressOfOperator [concrete = constants.%AddressOfOperator] {} {}
  191. // CHECK:STDOUT: %AddressOfCall.decl: %AddressOfCall.type = fn_decl @AddressOfCall [concrete = constants.%AddressOfCall] {} {}
  192. // CHECK:STDOUT: %AddressOfType.decl: %AddressOfType.type = fn_decl @AddressOfType [concrete = constants.%AddressOfType] {} {}
  193. // CHECK:STDOUT: %AddressOfTupleElementValue.decl: %AddressOfTupleElementValue.type = fn_decl @AddressOfTupleElementValue [concrete = constants.%AddressOfTupleElementValue] {} {}
  194. // CHECK:STDOUT: %AddressOfParam.decl: %AddressOfParam.type = fn_decl @AddressOfParam [concrete = constants.%AddressOfParam] {
  195. // CHECK:STDOUT: %param.patt: %pattern_type.7ce = binding_pattern param [concrete]
  196. // CHECK:STDOUT: %param.param_patt: %pattern_type.7ce = value_param_pattern %param.patt, call_param0 [concrete]
  197. // CHECK:STDOUT: } {
  198. // CHECK:STDOUT: %param.param: %i32 = value_param call_param0
  199. // CHECK:STDOUT: %.loc99: type = splice_block %i32.loc99 [concrete = constants.%i32] {
  200. // CHECK:STDOUT: %int_32.loc99: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  201. // CHECK:STDOUT: %i32.loc99: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  202. // CHECK:STDOUT: }
  203. // CHECK:STDOUT: %param: %i32 = bind_name param, %param.param
  204. // CHECK:STDOUT: }
  205. // CHECK:STDOUT: }
  206. // CHECK:STDOUT:
  207. // CHECK:STDOUT: fn @G() -> %i32;
  208. // CHECK:STDOUT:
  209. // CHECK:STDOUT: fn @H() -> %struct_type.a.ba9;
  210. // CHECK:STDOUT:
  211. // CHECK:STDOUT: fn @AddressOfLiteral() {
  212. // CHECK:STDOUT: !entry:
  213. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  214. // CHECK:STDOUT: %addr.loc24: %ptr.1d1 = addr_of <error> [concrete = <error>]
  215. // CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
  216. // CHECK:STDOUT: %addr.loc29: %ptr.bb2 = addr_of <error> [concrete = <error>]
  217. // CHECK:STDOUT: %float: f64 = float_literal 1 [concrete = constants.%float]
  218. // CHECK:STDOUT: %addr.loc34: %ptr.ef1 = addr_of <error> [concrete = <error>]
  219. // CHECK:STDOUT: %str: String = string_literal "Hello" [concrete = constants.%str]
  220. // CHECK:STDOUT: %addr.loc39: %ptr.a45 = addr_of <error> [concrete = <error>]
  221. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  222. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  223. // CHECK:STDOUT: %.loc44: %tuple.type = tuple_literal (%int_1, %int_2)
  224. // CHECK:STDOUT: %addr.loc44: %ptr.b50 = addr_of <error> [concrete = <error>]
  225. // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5]
  226. // CHECK:STDOUT: %.loc49: %struct_type.a.a6c = struct_literal (%int_5)
  227. // CHECK:STDOUT: %addr.loc49: %ptr.4e0 = addr_of <error> [concrete = <error>]
  228. // CHECK:STDOUT: return
  229. // CHECK:STDOUT: }
  230. // CHECK:STDOUT:
  231. // CHECK:STDOUT: fn @AddressOfOperator() {
  232. // CHECK:STDOUT: !entry:
  233. // CHECK:STDOUT: %true.loc57: bool = bool_literal true [concrete = constants.%true]
  234. // CHECK:STDOUT: %false.loc57_10: bool = bool_literal false [concrete = constants.%false]
  235. // CHECK:STDOUT: if %true.loc57 br !and.rhs else br !and.result(%false.loc57_10)
  236. // CHECK:STDOUT:
  237. // CHECK:STDOUT: !and.rhs:
  238. // CHECK:STDOUT: %false.loc57_14: bool = bool_literal false [concrete = constants.%false]
  239. // CHECK:STDOUT: br !and.result(%false.loc57_14)
  240. // CHECK:STDOUT:
  241. // CHECK:STDOUT: !and.result:
  242. // CHECK:STDOUT: %.loc57: bool = block_arg !and.result [concrete = constants.%false]
  243. // CHECK:STDOUT: %addr.loc57: %ptr.bb2 = addr_of <error> [concrete = <error>]
  244. // CHECK:STDOUT: %H.ref: %H.type = name_ref H, file.%H.decl [concrete = constants.%H]
  245. // CHECK:STDOUT: %H.call: init %struct_type.a.ba9 = call %H.ref()
  246. // CHECK:STDOUT: %.loc62_6.1: ref %struct_type.a.ba9 = temporary_storage
  247. // CHECK:STDOUT: %.loc62_6.2: ref %struct_type.a.ba9 = temporary %.loc62_6.1, %H.call
  248. // CHECK:STDOUT: %.loc62_7: ref %i32 = struct_access %.loc62_6.2, element0
  249. // CHECK:STDOUT: %addr.loc62: %ptr.235 = addr_of <error> [concrete = <error>]
  250. // CHECK:STDOUT: %true.loc67: bool = bool_literal true [concrete = constants.%true]
  251. // CHECK:STDOUT: %.loc67: bool = not %true.loc67 [concrete = constants.%false]
  252. // CHECK:STDOUT: %addr.loc67: %ptr.bb2 = addr_of <error> [concrete = <error>]
  253. // CHECK:STDOUT: return
  254. // CHECK:STDOUT: }
  255. // CHECK:STDOUT:
  256. // CHECK:STDOUT: fn @AddressOfCall() {
  257. // CHECK:STDOUT: !entry:
  258. // CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G]
  259. // CHECK:STDOUT: %G.call: init %i32 = call %G.ref()
  260. // CHECK:STDOUT: %addr: %ptr.235 = addr_of <error> [concrete = <error>]
  261. // CHECK:STDOUT: return
  262. // CHECK:STDOUT: }
  263. // CHECK:STDOUT:
  264. // CHECK:STDOUT: fn @AddressOfType() {
  265. // CHECK:STDOUT: !entry:
  266. // CHECK:STDOUT: %int_32.loc83: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  267. // CHECK:STDOUT: %i32.loc83: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  268. // CHECK:STDOUT: %addr.loc83: %ptr.db7 = addr_of <error> [concrete = <error>]
  269. // CHECK:STDOUT: %int_32.loc88: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  270. // CHECK:STDOUT: %i32.loc88: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  271. // CHECK:STDOUT: %const: type = const_type %i32.loc88 [concrete = constants.%const]
  272. // CHECK:STDOUT: %ptr: type = ptr_type %const [concrete = constants.%ptr.36b]
  273. // CHECK:STDOUT: %addr.loc88: %ptr.db7 = addr_of <error> [concrete = <error>]
  274. // CHECK:STDOUT: return
  275. // CHECK:STDOUT: }
  276. // CHECK:STDOUT:
  277. // CHECK:STDOUT: fn @AddressOfTupleElementValue() {
  278. // CHECK:STDOUT: !entry:
  279. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  280. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  281. // CHECK:STDOUT: %.loc96_10.1: %tuple.type = tuple_literal (%int_1, %int_2)
  282. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  283. // CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%int_1, %int_2) [concrete = constants.%tuple]
  284. // CHECK:STDOUT: %.loc96_10.2: %tuple.type = converted %.loc96_10.1, %tuple [concrete = constants.%tuple]
  285. // CHECK:STDOUT: %tuple.elem0: Core.IntLiteral = tuple_access %.loc96_10.2, element0 [concrete = constants.%int_1]
  286. // CHECK:STDOUT: %addr: %ptr.1d1 = addr_of <error> [concrete = <error>]
  287. // CHECK:STDOUT: return
  288. // CHECK:STDOUT: }
  289. // CHECK:STDOUT:
  290. // CHECK:STDOUT: fn @AddressOfParam(%param.param: %i32) {
  291. // CHECK:STDOUT: !entry:
  292. // CHECK:STDOUT: name_binding_decl {
  293. // CHECK:STDOUT: %param_addr.patt: %pattern_type.fe8 = binding_pattern param_addr [concrete]
  294. // CHECK:STDOUT: %param_addr.var_patt: %pattern_type.fe8 = var_pattern %param_addr.patt [concrete]
  295. // CHECK:STDOUT: }
  296. // CHECK:STDOUT: %param_addr.var: ref %ptr.235 = var %param_addr.var_patt
  297. // CHECK:STDOUT: %param.ref: %i32 = name_ref param, %param
  298. // CHECK:STDOUT: %addr: %ptr.235 = addr_of <error> [concrete = <error>]
  299. // CHECK:STDOUT: assign %param_addr.var, %addr
  300. // CHECK:STDOUT: %.loc104: type = splice_block %ptr [concrete = constants.%ptr.235] {
  301. // CHECK:STDOUT: %int_32.loc104: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  302. // CHECK:STDOUT: %i32.loc104: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  303. // CHECK:STDOUT: %ptr: type = ptr_type %i32.loc104 [concrete = constants.%ptr.235]
  304. // CHECK:STDOUT: }
  305. // CHECK:STDOUT: %param_addr: ref %ptr.235 = bind_name param_addr, %param_addr.var
  306. // CHECK:STDOUT: return
  307. // CHECK:STDOUT: }
  308. // CHECK:STDOUT: