fail_incomplete.carbon 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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/fail_incomplete.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_incomplete.carbon
  10. class Class;
  11. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:4: ERROR: Cannot declare a member of incomplete class `Class`.
  12. // CHECK:STDERR: fn Class.Function() {}
  13. // CHECK:STDERR: ^~~~~
  14. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-5]]:1: Class was forward declared here.
  15. // CHECK:STDERR: class Class;
  16. // CHECK:STDERR: ^~~~~~~~~~~~
  17. // CHECK:STDERR:
  18. fn Class.Function() {}
  19. fn CallClassFunction() {
  20. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:3: ERROR: Member access into incomplete class `Class`.
  21. // CHECK:STDERR: Class.Function();
  22. // CHECK:STDERR: ^~~~~~~~~~~~~~
  23. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-15]]:1: Class was forward declared here.
  24. // CHECK:STDERR: class Class;
  25. // CHECK:STDERR: ^~~~~~~~~~~~
  26. // CHECK:STDERR:
  27. Class.Function();
  28. }
  29. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:17: ERROR: Variable has incomplete type `Class`.
  30. // CHECK:STDERR: var global_var: Class;
  31. // CHECK:STDERR: ^~~~~
  32. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-25]]:1: Class was forward declared here.
  33. // CHECK:STDERR: class Class;
  34. // CHECK:STDERR: ^~~~~~~~~~~~
  35. // CHECK:STDERR:
  36. var global_var: Class;
  37. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:24: ERROR: Function returns incomplete type `Class`.
  38. // CHECK:STDERR: fn ConvertFromStruct() -> Class { return {}; }
  39. // CHECK:STDERR: ^~~~~~~~
  40. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-34]]:1: Class was forward declared here.
  41. // CHECK:STDERR: class Class;
  42. // CHECK:STDERR: ^~~~~~~~~~~~
  43. // CHECK:STDERR:
  44. fn ConvertFromStruct() -> Class { return {}; }
  45. fn G(p: Class*) -> i32 {
  46. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:10: ERROR: Member access into object of incomplete type `Class`.
  47. // CHECK:STDERR: return p->n;
  48. // CHECK:STDERR: ^~~~
  49. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-44]]:1: Class was forward declared here.
  50. // CHECK:STDERR: class Class;
  51. // CHECK:STDERR: ^~~~~~~~~~~~
  52. // CHECK:STDERR:
  53. return p->n;
  54. }
  55. fn MemberAccess(p: Class*) -> i32 {
  56. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:11: ERROR: Member access into object of incomplete type `Class`.
  57. // CHECK:STDERR: return (*p).n;
  58. // CHECK:STDERR: ^~
  59. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-55]]:1: Class was forward declared here.
  60. // CHECK:STDERR: class Class;
  61. // CHECK:STDERR: ^~~~~~~~~~~~
  62. // CHECK:STDERR:
  63. return (*p).n;
  64. }
  65. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:20: ERROR: Function returns incomplete type `Class`.
  66. // CHECK:STDERR: fn Copy(p: Class*) -> Class {
  67. // CHECK:STDERR: ^~~~~~~~
  68. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-65]]:1: Class was forward declared here.
  69. // CHECK:STDERR: class Class;
  70. // CHECK:STDERR: ^~~~~~~~~~~~
  71. // CHECK:STDERR:
  72. fn Copy(p: Class*) -> Class {
  73. return *p;
  74. }
  75. fn Let(p: Class*) {
  76. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:10: ERROR: `let` binding has incomplete type `Class`.
  77. // CHECK:STDERR: let c: Class = *p;
  78. // CHECK:STDERR: ^~~~~
  79. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-77]]:1: Class was forward declared here.
  80. // CHECK:STDERR: class Class;
  81. // CHECK:STDERR: ^~~~~~~~~~~~
  82. // CHECK:STDERR:
  83. let c: Class = *p;
  84. }
  85. fn TakeIncomplete(c: Class);
  86. fn ReturnIncomplete() -> Class;
  87. fn CallTakeIncomplete(p: Class*) {
  88. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+10]]:3: ERROR: Forming value of incomplete type `Class`.
  89. // CHECK:STDERR: TakeIncomplete(*p);
  90. // CHECK:STDERR: ^~~~~~~~~~~~~~~
  91. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-92]]:1: Class was forward declared here.
  92. // CHECK:STDERR: class Class;
  93. // CHECK:STDERR: ^~~~~~~~~~~~
  94. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-11]]:1: Initializing parameter 1 of function declared here.
  95. // CHECK:STDERR: fn TakeIncomplete(c: Class);
  96. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  97. // CHECK:STDERR:
  98. TakeIncomplete(*p);
  99. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+10]]:3: ERROR: Forming value of incomplete type `Class`.
  100. // CHECK:STDERR: TakeIncomplete({});
  101. // CHECK:STDERR: ^~~~~~~~~~~~~~~
  102. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-104]]:1: Class was forward declared here.
  103. // CHECK:STDERR: class Class;
  104. // CHECK:STDERR: ^~~~~~~~~~~~
  105. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-23]]:1: Initializing parameter 1 of function declared here.
  106. // CHECK:STDERR: fn TakeIncomplete(c: Class);
  107. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  108. // CHECK:STDERR:
  109. TakeIncomplete({});
  110. }
  111. fn CallReturnIncomplete() {
  112. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+9]]:3: ERROR: Function returns incomplete type `Class`.
  113. // CHECK:STDERR: ReturnIncomplete();
  114. // CHECK:STDERR: ^~~~~~~~~~~~~~~~
  115. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-118]]:1: Class was forward declared here.
  116. // CHECK:STDERR: class Class;
  117. // CHECK:STDERR: ^~~~~~~~~~~~
  118. // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-35]]:23: Return type declared here.
  119. // CHECK:STDERR: fn ReturnIncomplete() -> Class;
  120. // CHECK:STDERR: ^~~~~~~~
  121. ReturnIncomplete();
  122. }
  123. // CHECK:STDOUT: --- fail_incomplete.carbon
  124. // CHECK:STDOUT:
  125. // CHECK:STDOUT: constants {
  126. // CHECK:STDOUT: %Class: type = class_type @Class [template]
  127. // CHECK:STDOUT: %.type: type = fn_type @.1 [template]
  128. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  129. // CHECK:STDOUT: %.2: %.type = struct_value () [template]
  130. // CHECK:STDOUT: %CallClassFunction.type: type = fn_type @CallClassFunction [template]
  131. // CHECK:STDOUT: %CallClassFunction: %CallClassFunction.type = struct_value () [template]
  132. // CHECK:STDOUT: %ConvertFromStruct.type: type = fn_type @ConvertFromStruct [template]
  133. // CHECK:STDOUT: %ConvertFromStruct: %ConvertFromStruct.type = struct_value () [template]
  134. // CHECK:STDOUT: %.3: type = struct_type {} [template]
  135. // CHECK:STDOUT: %.4: type = ptr_type %Class [template]
  136. // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
  137. // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
  138. // CHECK:STDOUT: %G.type: type = fn_type @G [template]
  139. // CHECK:STDOUT: %G: %G.type = struct_value () [template]
  140. // CHECK:STDOUT: %MemberAccess.type: type = fn_type @MemberAccess [template]
  141. // CHECK:STDOUT: %MemberAccess: %MemberAccess.type = struct_value () [template]
  142. // CHECK:STDOUT: %Copy.type: type = fn_type @Copy [template]
  143. // CHECK:STDOUT: %Copy: %Copy.type = struct_value () [template]
  144. // CHECK:STDOUT: %Let.type: type = fn_type @Let [template]
  145. // CHECK:STDOUT: %Let: %Let.type = struct_value () [template]
  146. // CHECK:STDOUT: %TakeIncomplete.type: type = fn_type @TakeIncomplete [template]
  147. // CHECK:STDOUT: %TakeIncomplete: %TakeIncomplete.type = struct_value () [template]
  148. // CHECK:STDOUT: %ReturnIncomplete.type: type = fn_type @ReturnIncomplete [template]
  149. // CHECK:STDOUT: %ReturnIncomplete: %ReturnIncomplete.type = struct_value () [template]
  150. // CHECK:STDOUT: %CallTakeIncomplete.type: type = fn_type @CallTakeIncomplete [template]
  151. // CHECK:STDOUT: %CallTakeIncomplete: %CallTakeIncomplete.type = struct_value () [template]
  152. // CHECK:STDOUT: %CallReturnIncomplete.type: type = fn_type @CallReturnIncomplete [template]
  153. // CHECK:STDOUT: %CallReturnIncomplete: %CallReturnIncomplete.type = struct_value () [template]
  154. // CHECK:STDOUT: }
  155. // CHECK:STDOUT:
  156. // CHECK:STDOUT: file {
  157. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  158. // CHECK:STDOUT: .Core = %Core
  159. // CHECK:STDOUT: .Class = %Class.decl
  160. // CHECK:STDOUT: .CallClassFunction = %CallClassFunction.decl
  161. // CHECK:STDOUT: .global_var = %global_var
  162. // CHECK:STDOUT: .ConvertFromStruct = %ConvertFromStruct.decl
  163. // CHECK:STDOUT: .G = %G.decl
  164. // CHECK:STDOUT: .MemberAccess = %MemberAccess.decl
  165. // CHECK:STDOUT: .Copy = %Copy.decl
  166. // CHECK:STDOUT: .Let = %Let.decl
  167. // CHECK:STDOUT: .TakeIncomplete = %TakeIncomplete.decl
  168. // CHECK:STDOUT: .ReturnIncomplete = %ReturnIncomplete.decl
  169. // CHECK:STDOUT: .CallTakeIncomplete = %CallTakeIncomplete.decl
  170. // CHECK:STDOUT: .CallReturnIncomplete = %CallReturnIncomplete.decl
  171. // CHECK:STDOUT: }
  172. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  173. // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {}
  174. // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {}
  175. // CHECK:STDOUT: %CallClassFunction.decl: %CallClassFunction.type = fn_decl @CallClassFunction [template = constants.%CallClassFunction] {}
  176. // CHECK:STDOUT: %Class.ref.loc40: type = name_ref Class, %Class.decl [template = constants.%Class]
  177. // CHECK:STDOUT: %global_var.var: ref <error> = var global_var
  178. // CHECK:STDOUT: %global_var: ref <error> = bind_name global_var, %global_var.var
  179. // CHECK:STDOUT: %ConvertFromStruct.decl: %ConvertFromStruct.type = fn_decl @ConvertFromStruct [template = constants.%ConvertFromStruct] {
  180. // CHECK:STDOUT: %Class.ref.loc49: type = name_ref Class, %Class.decl [template = constants.%Class]
  181. // CHECK:STDOUT: @ConvertFromStruct.%return: ref %Class = var <return slot>
  182. // CHECK:STDOUT: }
  183. // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
  184. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
  185. // CHECK:STDOUT: %Class.ref.loc51: type = name_ref Class, %Class.decl [template = constants.%Class]
  186. // CHECK:STDOUT: %.loc51_14: type = ptr_type %Class [template = constants.%.4]
  187. // CHECK:STDOUT: %p.loc51_6.1: %.4 = param p
  188. // CHECK:STDOUT: @G.%p: %.4 = bind_name p, %p.loc51_6.1
  189. // CHECK:STDOUT: %int.make_type_32.loc51: init type = call constants.%Int32() [template = i32]
  190. // CHECK:STDOUT: %.loc51_20.1: type = value_of_initializer %int.make_type_32.loc51 [template = i32]
  191. // CHECK:STDOUT: %.loc51_20.2: type = converted %int.make_type_32.loc51, %.loc51_20.1 [template = i32]
  192. // CHECK:STDOUT: @G.%return: ref i32 = var <return slot>
  193. // CHECK:STDOUT: }
  194. // CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
  195. // CHECK:STDOUT: %MemberAccess.decl: %MemberAccess.type = fn_decl @MemberAccess [template = constants.%MemberAccess] {
  196. // CHECK:STDOUT: %Class.ref.loc62: type = name_ref Class, %Class.decl [template = constants.%Class]
  197. // CHECK:STDOUT: %.loc62_25: type = ptr_type %Class [template = constants.%.4]
  198. // CHECK:STDOUT: %p.loc62_17.1: %.4 = param p
  199. // CHECK:STDOUT: @MemberAccess.%p: %.4 = bind_name p, %p.loc62_17.1
  200. // CHECK:STDOUT: %int.make_type_32.loc62: init type = call constants.%Int32() [template = i32]
  201. // CHECK:STDOUT: %.loc62_31.1: type = value_of_initializer %int.make_type_32.loc62 [template = i32]
  202. // CHECK:STDOUT: %.loc62_31.2: type = converted %int.make_type_32.loc62, %.loc62_31.1 [template = i32]
  203. // CHECK:STDOUT: @MemberAccess.%return: ref i32 = var <return slot>
  204. // CHECK:STDOUT: }
  205. // CHECK:STDOUT: %Copy.decl: %Copy.type = fn_decl @Copy [template = constants.%Copy] {
  206. // CHECK:STDOUT: %Class.ref.loc80_12: type = name_ref Class, %Class.decl [template = constants.%Class]
  207. // CHECK:STDOUT: %.loc80: type = ptr_type %Class [template = constants.%.4]
  208. // CHECK:STDOUT: %p.loc80_9.1: %.4 = param p
  209. // CHECK:STDOUT: @Copy.%p: %.4 = bind_name p, %p.loc80_9.1
  210. // CHECK:STDOUT: %Class.ref.loc80_23: type = name_ref Class, %Class.decl [template = constants.%Class]
  211. // CHECK:STDOUT: @Copy.%return: ref %Class = var <return slot>
  212. // CHECK:STDOUT: }
  213. // CHECK:STDOUT: %Let.decl: %Let.type = fn_decl @Let [template = constants.%Let] {
  214. // CHECK:STDOUT: %Class.ref.loc84: type = name_ref Class, %Class.decl [template = constants.%Class]
  215. // CHECK:STDOUT: %.loc84: type = ptr_type %Class [template = constants.%.4]
  216. // CHECK:STDOUT: %p.loc84_8.1: %.4 = param p
  217. // CHECK:STDOUT: @Let.%p: %.4 = bind_name p, %p.loc84_8.1
  218. // CHECK:STDOUT: }
  219. // CHECK:STDOUT: %TakeIncomplete.decl: %TakeIncomplete.type = fn_decl @TakeIncomplete [template = constants.%TakeIncomplete] {
  220. // CHECK:STDOUT: %Class.ref.loc95: type = name_ref Class, %Class.decl [template = constants.%Class]
  221. // CHECK:STDOUT: %c.loc95_19.1: %Class = param c
  222. // CHECK:STDOUT: @TakeIncomplete.%c: %Class = bind_name c, %c.loc95_19.1
  223. // CHECK:STDOUT: }
  224. // CHECK:STDOUT: %ReturnIncomplete.decl: %ReturnIncomplete.type = fn_decl @ReturnIncomplete [template = constants.%ReturnIncomplete] {
  225. // CHECK:STDOUT: %Class.ref.loc97: type = name_ref Class, %Class.decl [template = constants.%Class]
  226. // CHECK:STDOUT: @ReturnIncomplete.%return: ref %Class = var <return slot>
  227. // CHECK:STDOUT: }
  228. // CHECK:STDOUT: %CallTakeIncomplete.decl: %CallTakeIncomplete.type = fn_decl @CallTakeIncomplete [template = constants.%CallTakeIncomplete] {
  229. // CHECK:STDOUT: %Class.ref.loc99: type = name_ref Class, %Class.decl [template = constants.%Class]
  230. // CHECK:STDOUT: %.loc99: type = ptr_type %Class [template = constants.%.4]
  231. // CHECK:STDOUT: %p.loc99_23.1: %.4 = param p
  232. // CHECK:STDOUT: @CallTakeIncomplete.%p: %.4 = bind_name p, %p.loc99_23.1
  233. // CHECK:STDOUT: }
  234. // CHECK:STDOUT: %CallReturnIncomplete.decl: %CallReturnIncomplete.type = fn_decl @CallReturnIncomplete [template = constants.%CallReturnIncomplete] {}
  235. // CHECK:STDOUT: }
  236. // CHECK:STDOUT:
  237. // CHECK:STDOUT: class @Class;
  238. // CHECK:STDOUT:
  239. // CHECK:STDOUT: fn @.1() {
  240. // CHECK:STDOUT: !entry:
  241. // CHECK:STDOUT: return
  242. // CHECK:STDOUT: }
  243. // CHECK:STDOUT:
  244. // CHECK:STDOUT: fn @CallClassFunction() {
  245. // CHECK:STDOUT: !entry:
  246. // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class]
  247. // CHECK:STDOUT: %Function.ref: <error> = name_ref Function, <error> [template = <error>]
  248. // CHECK:STDOUT: return
  249. // CHECK:STDOUT: }
  250. // CHECK:STDOUT:
  251. // CHECK:STDOUT: fn @ConvertFromStruct() -> %Class {
  252. // CHECK:STDOUT: !entry:
  253. // CHECK:STDOUT: %.loc49: %.3 = struct_literal ()
  254. // CHECK:STDOUT: return <error>
  255. // CHECK:STDOUT: }
  256. // CHECK:STDOUT:
  257. // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
  258. // CHECK:STDOUT:
  259. // CHECK:STDOUT: fn @G(%p: %.4) -> i32 {
  260. // CHECK:STDOUT: !entry:
  261. // CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p
  262. // CHECK:STDOUT: %.loc59: ref %Class = deref %p.ref
  263. // CHECK:STDOUT: return <error>
  264. // CHECK:STDOUT: }
  265. // CHECK:STDOUT:
  266. // CHECK:STDOUT: fn @MemberAccess(%p: %.4) -> i32 {
  267. // CHECK:STDOUT: !entry:
  268. // CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p
  269. // CHECK:STDOUT: %.loc70: ref %Class = deref %p.ref
  270. // CHECK:STDOUT: return <error>
  271. // CHECK:STDOUT: }
  272. // CHECK:STDOUT:
  273. // CHECK:STDOUT: fn @Copy(%p: %.4) -> %Class {
  274. // CHECK:STDOUT: !entry:
  275. // CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p
  276. // CHECK:STDOUT: %.loc81: ref %Class = deref %p.ref
  277. // CHECK:STDOUT: return <error>
  278. // CHECK:STDOUT: }
  279. // CHECK:STDOUT:
  280. // CHECK:STDOUT: fn @Let(%p: %.4) {
  281. // CHECK:STDOUT: !entry:
  282. // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [template = constants.%Class]
  283. // CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p
  284. // CHECK:STDOUT: %.loc92: ref %Class = deref %p.ref
  285. // CHECK:STDOUT: %c: <error> = bind_name c, <error>
  286. // CHECK:STDOUT: return
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: fn @TakeIncomplete(%c: %Class);
  290. // CHECK:STDOUT:
  291. // CHECK:STDOUT: fn @ReturnIncomplete() -> %Class;
  292. // CHECK:STDOUT:
  293. // CHECK:STDOUT: fn @CallTakeIncomplete(%p: %.4) {
  294. // CHECK:STDOUT: !entry:
  295. // CHECK:STDOUT: %TakeIncomplete.ref.loc110: %TakeIncomplete.type = name_ref TakeIncomplete, file.%TakeIncomplete.decl [template = constants.%TakeIncomplete]
  296. // CHECK:STDOUT: %p.ref: %.4 = name_ref p, %p
  297. // CHECK:STDOUT: %.loc110: ref %Class = deref %p.ref
  298. // CHECK:STDOUT: %TakeIncomplete.call.loc110: init %.1 = call %TakeIncomplete.ref.loc110(<invalid>) [template = <error>]
  299. // CHECK:STDOUT: %TakeIncomplete.ref.loc122: %TakeIncomplete.type = name_ref TakeIncomplete, file.%TakeIncomplete.decl [template = constants.%TakeIncomplete]
  300. // CHECK:STDOUT: %.loc122: %.3 = struct_literal ()
  301. // CHECK:STDOUT: %TakeIncomplete.call.loc122: init %.1 = call %TakeIncomplete.ref.loc122(<invalid>) [template = <error>]
  302. // CHECK:STDOUT: return
  303. // CHECK:STDOUT: }
  304. // CHECK:STDOUT:
  305. // CHECK:STDOUT: fn @CallReturnIncomplete() {
  306. // CHECK:STDOUT: !entry:
  307. // CHECK:STDOUT: %ReturnIncomplete.ref: %ReturnIncomplete.type = name_ref ReturnIncomplete, file.%ReturnIncomplete.decl [template = constants.%ReturnIncomplete]
  308. // CHECK:STDOUT: %ReturnIncomplete.call: init <error> = call %ReturnIncomplete.ref()
  309. // CHECK:STDOUT: return
  310. // CHECK:STDOUT: }
  311. // CHECK:STDOUT: