fail_address_of_value.carbon 17 KB

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