no_definition_in_impl_file.carbon 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  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/none.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/impl/no_definition_in_impl_file.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_definition_in_impl_file.carbon
  14. // --- fail_decl_in_api_definition_in_impl.carbon
  15. library "[[@TEST_NAME]]";
  16. interface A {}
  17. // CHECK:STDERR: fail_decl_in_api_definition_in_impl.carbon:[[@LINE+4]]:1: error: impl declared but not defined [ImplMissingDefinition]
  18. // CHECK:STDERR: impl () as A;
  19. // CHECK:STDERR: ^~~~~~~~~~~~~
  20. // CHECK:STDERR:
  21. impl () as A;
  22. // --- fail_decl_in_api_definition_in_impl.impl.carbon
  23. impl library "[[@TEST_NAME]]";
  24. // CHECK:STDERR: fail_decl_in_api_definition_in_impl.impl.carbon:[[@LINE+4]]:1: error: redeclaration of imported impl [RedeclImportedImpl]
  25. // CHECK:STDERR: impl () as A;
  26. // CHECK:STDERR: ^~~~~~~~~~~~~
  27. // CHECK:STDERR:
  28. impl () as A;
  29. // CHECK:STDERR: fail_decl_in_api_definition_in_impl.impl.carbon:[[@LINE+4]]:1: error: redeclaration of imported impl [RedeclImportedImpl]
  30. // CHECK:STDERR: impl () as A {}
  31. // CHECK:STDERR: ^~~~~~~~~~~~~~
  32. // CHECK:STDERR:
  33. impl () as A {}
  34. // --- use_decl_in_api.carbon
  35. library "[[@TEST_NAME]]";
  36. // --- use_decl_in_api.impl.carbon
  37. impl library "[[@TEST_NAME]]";
  38. import library "decl_in_api_definition_in_impl";
  39. // --- fail_decl_only_in_api.carbon
  40. library "[[@TEST_NAME]]";
  41. interface B {}
  42. // CHECK:STDERR: fail_decl_only_in_api.carbon:[[@LINE+4]]:1: error: impl declared but not defined [ImplMissingDefinition]
  43. // CHECK:STDERR: impl () as B;
  44. // CHECK:STDERR: ^~~~~~~~~~~~~
  45. // CHECK:STDERR:
  46. impl () as B;
  47. // --- decl_only_in_api.impl.carbon
  48. impl library "[[@TEST_NAME]]";
  49. // --- fail_decl_in_api_decl_in_impl.carbon
  50. library "[[@TEST_NAME]]";
  51. interface C {}
  52. // CHECK:STDERR: fail_decl_in_api_decl_in_impl.carbon:[[@LINE+4]]:1: error: impl declared but not defined [ImplMissingDefinition]
  53. // CHECK:STDERR: impl () as C;
  54. // CHECK:STDERR: ^~~~~~~~~~~~~
  55. // CHECK:STDERR:
  56. impl () as C;
  57. // --- fail_decl_in_api_decl_in_impl.impl.carbon
  58. impl library "[[@TEST_NAME]]";
  59. // CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+4]]:1: error: redeclaration of imported impl [RedeclImportedImpl]
  60. // CHECK:STDERR: impl () as C;
  61. // CHECK:STDERR: ^~~~~~~~~~~~~
  62. // CHECK:STDERR:
  63. impl () as C;
  64. // --- decl_only_in_impl.carbon
  65. library "[[@TEST_NAME]]";
  66. // --- fail_decl_only_in_impl.impl.carbon
  67. impl library "[[@TEST_NAME]]";
  68. interface D {}
  69. // CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+4]]:1: error: impl declared but not defined [ImplMissingDefinition]
  70. // CHECK:STDERR: impl () as D;
  71. // CHECK:STDERR: ^~~~~~~~~~~~~
  72. // CHECK:STDERR:
  73. impl () as D;
  74. // CHECK:STDOUT: --- fail_decl_in_api_definition_in_impl.carbon
  75. // CHECK:STDOUT:
  76. // CHECK:STDOUT: constants {
  77. // CHECK:STDOUT: %A.type: type = facet_type <@A> [concrete]
  78. // CHECK:STDOUT: %Self: %A.type = symbolic_binding Self, 0 [symbolic]
  79. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  80. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  81. // CHECK:STDOUT: %A.impl_witness: <witness> = impl_witness file.%A.impl_witness_table [concrete]
  82. // CHECK:STDOUT: }
  83. // CHECK:STDOUT:
  84. // CHECK:STDOUT: file {
  85. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  86. // CHECK:STDOUT: .A = %A.decl
  87. // CHECK:STDOUT: }
  88. // CHECK:STDOUT: %A.decl: type = interface_decl @A [concrete = constants.%A.type] {} {}
  89. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.A.impl [concrete] {} {
  90. // CHECK:STDOUT: %.loc10_7.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  91. // CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  92. // CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
  93. // CHECK:STDOUT: }
  94. // CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (), @empty_tuple.type.as.A.impl [concrete]
  95. // CHECK:STDOUT: %A.impl_witness: <witness> = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness]
  96. // CHECK:STDOUT: }
  97. // CHECK:STDOUT:
  98. // CHECK:STDOUT: interface @A {
  99. // CHECK:STDOUT: %Self: %A.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  100. // CHECK:STDOUT:
  101. // CHECK:STDOUT: !members:
  102. // CHECK:STDOUT: .Self = %Self
  103. // CHECK:STDOUT: witness = ()
  104. // CHECK:STDOUT:
  105. // CHECK:STDOUT: !requires:
  106. // CHECK:STDOUT: }
  107. // CHECK:STDOUT:
  108. // CHECK:STDOUT: impl @empty_tuple.type.as.A.impl: %.loc10_7.2 as %A.ref;
  109. // CHECK:STDOUT:
  110. // CHECK:STDOUT: --- fail_decl_in_api_definition_in_impl.impl.carbon
  111. // CHECK:STDOUT:
  112. // CHECK:STDOUT: constants {
  113. // CHECK:STDOUT: %A.type: type = facet_type <@A> [concrete]
  114. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  115. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  116. // CHECK:STDOUT: }
  117. // CHECK:STDOUT:
  118. // CHECK:STDOUT: imports {
  119. // CHECK:STDOUT: %Main.A: type = import_ref Main//decl_in_api_definition_in_impl, A, loaded [concrete = constants.%A.type]
  120. // CHECK:STDOUT: %Main.import_ref.3b8 = import_ref Main//decl_in_api_definition_in_impl, loc4_13, unloaded
  121. // CHECK:STDOUT: %Main.import_ref.e5c: type = import_ref Main//decl_in_api_definition_in_impl, loc10_7, loaded [concrete = constants.%empty_tuple.type]
  122. // CHECK:STDOUT: %Main.import_ref.831: type = import_ref Main//decl_in_api_definition_in_impl, loc10_12, loaded [concrete = constants.%A.type]
  123. // CHECK:STDOUT: }
  124. // CHECK:STDOUT:
  125. // CHECK:STDOUT: file {
  126. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  127. // CHECK:STDOUT: .A = imports.%Main.A
  128. // CHECK:STDOUT: }
  129. // CHECK:STDOUT: %default.import.loc2_46.1 = import <none>
  130. // CHECK:STDOUT: %default.import.loc2_46.2 = import <none>
  131. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.A.impl.766c6e.2 [concrete] {} {
  132. // CHECK:STDOUT: %.loc8_7.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  133. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  134. // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%Main.A [concrete = constants.%A.type]
  135. // CHECK:STDOUT: }
  136. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.A.impl.766c6e.3 [concrete] {} {
  137. // CHECK:STDOUT: %.loc14_7.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  138. // CHECK:STDOUT: %.loc14_7.2: type = converted %.loc14_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  139. // CHECK:STDOUT: %A.ref: type = name_ref A, imports.%Main.A [concrete = constants.%A.type]
  140. // CHECK:STDOUT: }
  141. // CHECK:STDOUT: }
  142. // CHECK:STDOUT:
  143. // CHECK:STDOUT: interface @A [from "fail_decl_in_api_definition_in_impl.carbon"] {
  144. // CHECK:STDOUT: !members:
  145. // CHECK:STDOUT: .Self = imports.%Main.import_ref.3b8
  146. // CHECK:STDOUT: witness = ()
  147. // CHECK:STDOUT:
  148. // CHECK:STDOUT: !requires:
  149. // CHECK:STDOUT: }
  150. // CHECK:STDOUT:
  151. // CHECK:STDOUT: impl @empty_tuple.type.as.A.impl.766c6e.1: imports.%Main.import_ref.e5c as imports.%Main.import_ref.831 [from "fail_decl_in_api_definition_in_impl.carbon"];
  152. // CHECK:STDOUT:
  153. // CHECK:STDOUT: impl @empty_tuple.type.as.A.impl.766c6e.2: %.loc8_7.2 as %A.ref;
  154. // CHECK:STDOUT:
  155. // CHECK:STDOUT: impl @empty_tuple.type.as.A.impl.766c6e.3: %.loc14_7.2 as %A.ref {
  156. // CHECK:STDOUT: !members:
  157. // CHECK:STDOUT: witness = <error>
  158. // CHECK:STDOUT: }
  159. // CHECK:STDOUT:
  160. // CHECK:STDOUT: --- use_decl_in_api.carbon
  161. // CHECK:STDOUT:
  162. // CHECK:STDOUT: file {
  163. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {}
  164. // CHECK:STDOUT: }
  165. // CHECK:STDOUT:
  166. // CHECK:STDOUT: --- use_decl_in_api.impl.carbon
  167. // CHECK:STDOUT:
  168. // CHECK:STDOUT: imports {
  169. // CHECK:STDOUT: %Main.A = import_ref Main//decl_in_api_definition_in_impl, A, unloaded
  170. // CHECK:STDOUT: }
  171. // CHECK:STDOUT:
  172. // CHECK:STDOUT: file {
  173. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  174. // CHECK:STDOUT: .A = imports.%Main.A
  175. // CHECK:STDOUT: }
  176. // CHECK:STDOUT: %default.import.loc2_31.1 = import <none>
  177. // CHECK:STDOUT: %default.import.loc2_31.2 = import <none>
  178. // CHECK:STDOUT: }
  179. // CHECK:STDOUT:
  180. // CHECK:STDOUT: --- fail_decl_only_in_api.carbon
  181. // CHECK:STDOUT:
  182. // CHECK:STDOUT: constants {
  183. // CHECK:STDOUT: %B.type: type = facet_type <@B> [concrete]
  184. // CHECK:STDOUT: %Self: %B.type = symbolic_binding Self, 0 [symbolic]
  185. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  186. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  187. // CHECK:STDOUT: %B.impl_witness: <witness> = impl_witness file.%B.impl_witness_table [concrete]
  188. // CHECK:STDOUT: }
  189. // CHECK:STDOUT:
  190. // CHECK:STDOUT: file {
  191. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  192. // CHECK:STDOUT: .B = %B.decl
  193. // CHECK:STDOUT: }
  194. // CHECK:STDOUT: %B.decl: type = interface_decl @B [concrete = constants.%B.type] {} {}
  195. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.B.impl [concrete] {} {
  196. // CHECK:STDOUT: %.loc10_7.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  197. // CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  198. // CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B.type]
  199. // CHECK:STDOUT: }
  200. // CHECK:STDOUT: %B.impl_witness_table = impl_witness_table (), @empty_tuple.type.as.B.impl [concrete]
  201. // CHECK:STDOUT: %B.impl_witness: <witness> = impl_witness %B.impl_witness_table [concrete = constants.%B.impl_witness]
  202. // CHECK:STDOUT: }
  203. // CHECK:STDOUT:
  204. // CHECK:STDOUT: interface @B {
  205. // CHECK:STDOUT: %Self: %B.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  206. // CHECK:STDOUT:
  207. // CHECK:STDOUT: !members:
  208. // CHECK:STDOUT: .Self = %Self
  209. // CHECK:STDOUT: witness = ()
  210. // CHECK:STDOUT:
  211. // CHECK:STDOUT: !requires:
  212. // CHECK:STDOUT: }
  213. // CHECK:STDOUT:
  214. // CHECK:STDOUT: impl @empty_tuple.type.as.B.impl: %.loc10_7.2 as %B.ref;
  215. // CHECK:STDOUT:
  216. // CHECK:STDOUT: --- decl_only_in_api.impl.carbon
  217. // CHECK:STDOUT:
  218. // CHECK:STDOUT: constants {
  219. // CHECK:STDOUT: %B.type: type = facet_type <@B> [concrete]
  220. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  221. // CHECK:STDOUT: }
  222. // CHECK:STDOUT:
  223. // CHECK:STDOUT: imports {
  224. // CHECK:STDOUT: %Main.B = import_ref Main//decl_only_in_api, B, unloaded
  225. // CHECK:STDOUT: %Main.import_ref.5c0 = import_ref Main//decl_only_in_api, loc4_13, unloaded
  226. // CHECK:STDOUT: %Main.import_ref.e5c: type = import_ref Main//decl_only_in_api, loc10_7, loaded [concrete = constants.%empty_tuple.type]
  227. // CHECK:STDOUT: %Main.import_ref.171: type = import_ref Main//decl_only_in_api, loc10_12, loaded [concrete = constants.%B.type]
  228. // CHECK:STDOUT: }
  229. // CHECK:STDOUT:
  230. // CHECK:STDOUT: file {
  231. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  232. // CHECK:STDOUT: .B = imports.%Main.B
  233. // CHECK:STDOUT: }
  234. // CHECK:STDOUT: %default.import.loc2_32.1 = import <none>
  235. // CHECK:STDOUT: %default.import.loc2_32.2 = import <none>
  236. // CHECK:STDOUT: }
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: interface @B [from "fail_decl_only_in_api.carbon"] {
  239. // CHECK:STDOUT: !members:
  240. // CHECK:STDOUT: .Self = imports.%Main.import_ref.5c0
  241. // CHECK:STDOUT: witness = ()
  242. // CHECK:STDOUT:
  243. // CHECK:STDOUT: !requires:
  244. // CHECK:STDOUT: }
  245. // CHECK:STDOUT:
  246. // CHECK:STDOUT: impl @empty_tuple.type.as.B.impl: imports.%Main.import_ref.e5c as imports.%Main.import_ref.171 [from "fail_decl_only_in_api.carbon"];
  247. // CHECK:STDOUT:
  248. // CHECK:STDOUT: --- fail_decl_in_api_decl_in_impl.carbon
  249. // CHECK:STDOUT:
  250. // CHECK:STDOUT: constants {
  251. // CHECK:STDOUT: %C.type: type = facet_type <@C> [concrete]
  252. // CHECK:STDOUT: %Self: %C.type = symbolic_binding Self, 0 [symbolic]
  253. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  254. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  255. // CHECK:STDOUT: %C.impl_witness: <witness> = impl_witness file.%C.impl_witness_table [concrete]
  256. // CHECK:STDOUT: }
  257. // CHECK:STDOUT:
  258. // CHECK:STDOUT: file {
  259. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  260. // CHECK:STDOUT: .C = %C.decl
  261. // CHECK:STDOUT: }
  262. // CHECK:STDOUT: %C.decl: type = interface_decl @C [concrete = constants.%C.type] {} {}
  263. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.C.impl [concrete] {} {
  264. // CHECK:STDOUT: %.loc10_7.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  265. // CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  266. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C.type]
  267. // CHECK:STDOUT: }
  268. // CHECK:STDOUT: %C.impl_witness_table = impl_witness_table (), @empty_tuple.type.as.C.impl [concrete]
  269. // CHECK:STDOUT: %C.impl_witness: <witness> = impl_witness %C.impl_witness_table [concrete = constants.%C.impl_witness]
  270. // CHECK:STDOUT: }
  271. // CHECK:STDOUT:
  272. // CHECK:STDOUT: interface @C {
  273. // CHECK:STDOUT: %Self: %C.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  274. // CHECK:STDOUT:
  275. // CHECK:STDOUT: !members:
  276. // CHECK:STDOUT: .Self = %Self
  277. // CHECK:STDOUT: witness = ()
  278. // CHECK:STDOUT:
  279. // CHECK:STDOUT: !requires:
  280. // CHECK:STDOUT: }
  281. // CHECK:STDOUT:
  282. // CHECK:STDOUT: impl @empty_tuple.type.as.C.impl: %.loc10_7.2 as %C.ref;
  283. // CHECK:STDOUT:
  284. // CHECK:STDOUT: --- fail_decl_in_api_decl_in_impl.impl.carbon
  285. // CHECK:STDOUT:
  286. // CHECK:STDOUT: constants {
  287. // CHECK:STDOUT: %C.type: type = facet_type <@C> [concrete]
  288. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  289. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  290. // CHECK:STDOUT: }
  291. // CHECK:STDOUT:
  292. // CHECK:STDOUT: imports {
  293. // CHECK:STDOUT: %Main.C: type = import_ref Main//decl_in_api_decl_in_impl, C, loaded [concrete = constants.%C.type]
  294. // CHECK:STDOUT: %Main.import_ref.a1a = import_ref Main//decl_in_api_decl_in_impl, loc4_13, unloaded
  295. // CHECK:STDOUT: %Main.import_ref.e5c: type = import_ref Main//decl_in_api_decl_in_impl, loc10_7, loaded [concrete = constants.%empty_tuple.type]
  296. // CHECK:STDOUT: %Main.import_ref.653: type = import_ref Main//decl_in_api_decl_in_impl, loc10_12, loaded [concrete = constants.%C.type]
  297. // CHECK:STDOUT: }
  298. // CHECK:STDOUT:
  299. // CHECK:STDOUT: file {
  300. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  301. // CHECK:STDOUT: .C = imports.%Main.C
  302. // CHECK:STDOUT: }
  303. // CHECK:STDOUT: %default.import.loc2_40.1 = import <none>
  304. // CHECK:STDOUT: %default.import.loc2_40.2 = import <none>
  305. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.C.impl.130841.2 [concrete] {} {
  306. // CHECK:STDOUT: %.loc8_7.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  307. // CHECK:STDOUT: %.loc8_7.2: type = converted %.loc8_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  308. // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C.type]
  309. // CHECK:STDOUT: }
  310. // CHECK:STDOUT: }
  311. // CHECK:STDOUT:
  312. // CHECK:STDOUT: interface @C [from "fail_decl_in_api_decl_in_impl.carbon"] {
  313. // CHECK:STDOUT: !members:
  314. // CHECK:STDOUT: .Self = imports.%Main.import_ref.a1a
  315. // CHECK:STDOUT: witness = ()
  316. // CHECK:STDOUT:
  317. // CHECK:STDOUT: !requires:
  318. // CHECK:STDOUT: }
  319. // CHECK:STDOUT:
  320. // CHECK:STDOUT: impl @empty_tuple.type.as.C.impl.130841.1: imports.%Main.import_ref.e5c as imports.%Main.import_ref.653 [from "fail_decl_in_api_decl_in_impl.carbon"];
  321. // CHECK:STDOUT:
  322. // CHECK:STDOUT: impl @empty_tuple.type.as.C.impl.130841.2: %.loc8_7.2 as %C.ref;
  323. // CHECK:STDOUT:
  324. // CHECK:STDOUT: --- decl_only_in_impl.carbon
  325. // CHECK:STDOUT:
  326. // CHECK:STDOUT: file {
  327. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {}
  328. // CHECK:STDOUT: }
  329. // CHECK:STDOUT:
  330. // CHECK:STDOUT: --- fail_decl_only_in_impl.impl.carbon
  331. // CHECK:STDOUT:
  332. // CHECK:STDOUT: constants {
  333. // CHECK:STDOUT: %D.type: type = facet_type <@D> [concrete]
  334. // CHECK:STDOUT: %Self: %D.type = symbolic_binding Self, 0 [symbolic]
  335. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  336. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  337. // CHECK:STDOUT: %D.impl_witness: <witness> = impl_witness file.%D.impl_witness_table [concrete]
  338. // CHECK:STDOUT: }
  339. // CHECK:STDOUT:
  340. // CHECK:STDOUT: file {
  341. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  342. // CHECK:STDOUT: .D = %D.decl
  343. // CHECK:STDOUT: }
  344. // CHECK:STDOUT: %default.import.loc2_33.1 = import <none>
  345. // CHECK:STDOUT: %default.import.loc2_33.2 = import <none>
  346. // CHECK:STDOUT: %D.decl: type = interface_decl @D [concrete = constants.%D.type] {} {}
  347. // CHECK:STDOUT: impl_decl @empty_tuple.type.as.D.impl [concrete] {} {
  348. // CHECK:STDOUT: %.loc10_7.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
  349. // CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  350. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D.type]
  351. // CHECK:STDOUT: }
  352. // CHECK:STDOUT: %D.impl_witness_table = impl_witness_table (), @empty_tuple.type.as.D.impl [concrete]
  353. // CHECK:STDOUT: %D.impl_witness: <witness> = impl_witness %D.impl_witness_table [concrete = constants.%D.impl_witness]
  354. // CHECK:STDOUT: }
  355. // CHECK:STDOUT:
  356. // CHECK:STDOUT: interface @D {
  357. // CHECK:STDOUT: %Self: %D.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  358. // CHECK:STDOUT:
  359. // CHECK:STDOUT: !members:
  360. // CHECK:STDOUT: .Self = %Self
  361. // CHECK:STDOUT: witness = ()
  362. // CHECK:STDOUT:
  363. // CHECK:STDOUT: !requires:
  364. // CHECK:STDOUT: }
  365. // CHECK:STDOUT:
  366. // CHECK:STDOUT: impl @empty_tuple.type.as.D.impl: %.loc10_7.2 as %D.ref;
  367. // CHECK:STDOUT: