name_poisoning.carbon 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210
  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/function/declaration/no_prelude/name_poisoning.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon
  10. // --- no_poison.carbon
  11. library "[[@TEST_NAME]]";
  12. class C {};
  13. // Both N.F1 and N.F2 use N.C and not C.
  14. namespace N;
  15. class N.C {}
  16. fn N.F1(x: C);
  17. fn N.F2(x: C) { N.F1(x); }
  18. // --- poison.carbon
  19. library "[[@TEST_NAME]]";
  20. class C {};
  21. namespace N;
  22. // Here we use C and poison N.C.
  23. fn N.F1(x: C);
  24. // --- fail_poison_class_without_usage.carbon
  25. // CHECK:STDERR: fail_poison_class_without_usage.carbon: error: name used before it was declared [NameUseBeforeDecl]
  26. library "[[@TEST_NAME]]";
  27. class C {};
  28. namespace N;
  29. // Here we use C and poison N.C.
  30. fn N.F1(x: C);
  31. // Should fail here since C was poisoned for namespace N when it was used in N
  32. // context without qualification.
  33. // CHECK:STDERR: fail_poison_class_without_usage.carbon:[[@LINE+4]]:1: note: declared here [NameUseBeforeDeclNote]
  34. // CHECK:STDERR: class N.C {}
  35. // CHECK:STDERR: ^~~~~~~~~~~
  36. // CHECK:STDERR:
  37. class N.C {}
  38. // --- fail_poison_interface_without_usage.carbon
  39. // CHECK:STDERR: fail_poison_interface_without_usage.carbon: error: name used before it was declared [NameUseBeforeDecl]
  40. library "[[@TEST_NAME]]";
  41. interface I {};
  42. namespace N;
  43. // Here we use I and poison N.I.
  44. fn N.F1(x: I);
  45. // Should fail here since I was poisoned for namespace N when it was used in N
  46. // context without qualification.
  47. // CHECK:STDERR: fail_poison_interface_without_usage.carbon:[[@LINE+4]]:1: note: declared here [NameUseBeforeDeclNote]
  48. // CHECK:STDERR: interface N.I {}
  49. // CHECK:STDERR: ^~~~~~~~~~~~~~~
  50. // CHECK:STDERR:
  51. interface N.I {}
  52. // --- fail_poison_namespace_without_usage.carbon
  53. // CHECK:STDERR: fail_poison_namespace_without_usage.carbon: error: name used before it was declared [NameUseBeforeDecl]
  54. library "[[@TEST_NAME]]";
  55. class C {};
  56. namespace N;
  57. // Here we use C and poison N.C.
  58. fn N.F1(x: C);
  59. // Should fail here since C was poisoned for namespace N when it was used in N
  60. // context without qualification.
  61. // CHECK:STDERR: fail_poison_namespace_without_usage.carbon:[[@LINE+4]]:1: note: declared here [NameUseBeforeDeclNote]
  62. // CHECK:STDERR: namespace N.C;
  63. // CHECK:STDERR: ^~~~~~~~~~~~~~
  64. // CHECK:STDERR:
  65. namespace N.C;
  66. // --- fail_poison_member_without_usage.carbon
  67. // CHECK:STDERR: fail_poison_member_without_usage.carbon: error: name used before it was declared [NameUseBeforeDecl]
  68. library "[[@TEST_NAME]]";
  69. class C1 {};
  70. class D {
  71. // Here we use C1 and poison D.C1.
  72. fn F1(x: C1);
  73. class C2 {};
  74. // Should fail here since C1 was poisoned for namespace class D when it was
  75. // used in D context without qualification.
  76. // CHECK:STDERR: fail_poison_member_without_usage.carbon:[[@LINE+4]]:7: note: declared here [NameUseBeforeDeclNote]
  77. // CHECK:STDERR: var C1: C2;
  78. // CHECK:STDERR: ^~~~~~
  79. // CHECK:STDERR:
  80. var C1: C2;
  81. }
  82. // --- fail_poison_function_without_usage.carbon
  83. // CHECK:STDERR: fail_poison_function_without_usage.carbon: error: name used before it was declared [NameUseBeforeDecl]
  84. library "[[@TEST_NAME]]";
  85. class C {};
  86. namespace N;
  87. // Here we use C and poison N.C.
  88. fn N.F1(x: C);
  89. // Should fail here since C was poisoned for namespace N when it was used in N
  90. // context without qualification.
  91. // CHECK:STDERR: fail_poison_function_without_usage.carbon:[[@LINE+4]]:1: note: declared here [NameUseBeforeDeclNote]
  92. // CHECK:STDERR: fn N.C();
  93. // CHECK:STDERR: ^~~~~~~~~
  94. // CHECK:STDERR:
  95. fn N.C();
  96. // --- fail_use_undefined_poisoned_name.carbon
  97. library "[[@TEST_NAME]]";
  98. class C {};
  99. namespace N;
  100. // Here we use C and poison N.C.
  101. fn N.F1() -> C;
  102. // Try to use N.C which was never defined and poisoned.
  103. // CHECK:STDERR: fail_use_undefined_poisoned_name.carbon:[[@LINE+4]]:14: error: member name `C` not found in `N` [MemberNameNotFoundInScope]
  104. // CHECK:STDERR: fn N.F2() -> N.C;
  105. // CHECK:STDERR: ^~~
  106. // CHECK:STDERR:
  107. fn N.F2() -> N.C;
  108. // --- fail_poison_with_usage.carbon
  109. // CHECK:STDERR: fail_poison_with_usage.carbon: error: name used before it was declared [NameUseBeforeDecl]
  110. library "[[@TEST_NAME]]";
  111. class C {};
  112. namespace N;
  113. // Here we use C and poison N.C.
  114. fn N.F1(x: C);
  115. // Should fail here since C was poisoned for namespace N when it was used in N
  116. // context without qualification.
  117. // CHECK:STDERR: fail_poison_with_usage.carbon:[[@LINE+4]]:1: note: declared here [NameUseBeforeDeclNote]
  118. // CHECK:STDERR: class N.C {}
  119. // CHECK:STDERR: ^~~~~~~~~~~
  120. // CHECK:STDERR:
  121. class N.C {}
  122. // Should not fail here since both N.F2() and N.F1() input is the class C and
  123. // not class N.C.
  124. fn N.F2(x: C) { N.F1(x); }
  125. // --- fail_poison_multiple_scopes.carbon
  126. // CHECK:STDERR: fail_poison_multiple_scopes.carbon: error: name used before it was declared [NameUseBeforeDecl]
  127. library "[[@TEST_NAME]]";
  128. class C {};
  129. namespace N1;
  130. namespace N1.N2;
  131. namespace N1.N2.N3;
  132. class N1.N2.N3.D1 {
  133. interface D2 {
  134. class D3 {
  135. // Here we use C and poison:
  136. // * N1.C
  137. // * N1.N2.C
  138. // * N1.N2.N3.C
  139. // * N1.N2.N3.D1.C
  140. // * N1.N2.N3.D1.D2.C
  141. // * N1.N2.N3.D1.D2.D3.C
  142. fn F(x: C);
  143. // CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+5]]:7: note: declared here [NameUseBeforeDeclNote]
  144. // CHECK:STDERR: class C {}
  145. // CHECK:STDERR: ^~~~~~~~~
  146. // CHECK:STDERR:
  147. // CHECK:STDERR: fail_poison_multiple_scopes.carbon: error: name used before it was declared [NameUseBeforeDecl]
  148. class C {}
  149. }
  150. // CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+5]]:5: note: declared here [NameUseBeforeDeclNote]
  151. // CHECK:STDERR: class C {}
  152. // CHECK:STDERR: ^~~~~~~~~
  153. // CHECK:STDERR:
  154. // CHECK:STDERR: fail_poison_multiple_scopes.carbon: error: name used before it was declared [NameUseBeforeDecl]
  155. class C {}
  156. }
  157. // CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+5]]:3: note: declared here [NameUseBeforeDeclNote]
  158. // CHECK:STDERR: class C {}
  159. // CHECK:STDERR: ^~~~~~~~~
  160. // CHECK:STDERR:
  161. // CHECK:STDERR: fail_poison_multiple_scopes.carbon: error: name used before it was declared [NameUseBeforeDecl]
  162. class C {}
  163. }
  164. // CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+5]]:1: note: declared here [NameUseBeforeDeclNote]
  165. // CHECK:STDERR: class N1.C {}
  166. // CHECK:STDERR: ^~~~~~~~~~~~
  167. // CHECK:STDERR:
  168. // CHECK:STDERR: fail_poison_multiple_scopes.carbon: error: name used before it was declared [NameUseBeforeDecl]
  169. class N1.C {}
  170. // CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+5]]:1: note: declared here [NameUseBeforeDeclNote]
  171. // CHECK:STDERR: interface N1.N2.C {}
  172. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
  173. // CHECK:STDERR:
  174. // CHECK:STDERR: fail_poison_multiple_scopes.carbon: error: name used before it was declared [NameUseBeforeDecl]
  175. interface N1.N2.C {}
  176. // CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+4]]:1: note: declared here [NameUseBeforeDeclNote]
  177. // CHECK:STDERR: class N1.N2.N3.C {}
  178. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
  179. // CHECK:STDERR:
  180. class N1.N2.N3.C {}
  181. // --- fail_alias.carbon
  182. // CHECK:STDERR: fail_alias.carbon: error: name used before it was declared [NameUseBeforeDecl]
  183. library "[[@TEST_NAME]]";
  184. class C {}
  185. namespace N;
  186. // CHECK:STDERR: fail_alias.carbon:[[@LINE+4]]:9: note: declared here [NameUseBeforeDeclNote]
  187. // CHECK:STDERR: alias N.C = C;
  188. // CHECK:STDERR: ^
  189. // CHECK:STDERR:
  190. alias N.C = C;
  191. // --- ignored_poison_in_import.carbon
  192. library "[[@TEST_NAME]]";
  193. import library "poison";
  194. // This doesn't fail.
  195. class N.C {}
  196. // --- poison.impl.carbon
  197. impl library "[[@TEST_NAME]]";
  198. // TODO: This should fail since N.C was poisoned in the api.
  199. class N.C {}
  200. // --- using_poisoned_name_in_impl.carbon
  201. library "[[@TEST_NAME]]";
  202. interface C {};
  203. namespace N;
  204. // Here we use C and poison N.C.
  205. fn N.F1(x: C);
  206. class N.X {
  207. extend impl as C {
  208. }
  209. }
  210. // --- fail_using_poisoned_name_in_impl_outside_class.carbon
  211. library "[[@TEST_NAME]]";
  212. interface A {
  213. fn B();
  214. }
  215. class X {
  216. extend impl as A {
  217. fn F() { return; }
  218. // CHECK:STDERR: fail_using_poisoned_name_in_impl_outside_class.carbon:[[@LINE+4]]:10: error: `impl as` can only be used in a class [ImplAsOutsideClass]
  219. // CHECK:STDERR: impl as B {}
  220. // CHECK:STDERR: ^~
  221. // CHECK:STDERR:
  222. impl as B {}
  223. }
  224. }
  225. // --- fail_no_poison_when_lookup_fails.carbon
  226. library "[[@TEST_NAME]]";
  227. namespace N;
  228. // Here we fail to find C so we don't poison anything.
  229. // CHECK:STDERR: fail_no_poison_when_lookup_fails.carbon:[[@LINE+3]]:11: error: name `C` not found [NameNotFound]
  230. // CHECK:STDERR: fn N.F(x: C);
  231. // CHECK:STDERR: ^
  232. fn N.F(x: C);
  233. // No failures below because nothing was poisoned.
  234. class C {}
  235. class N.C {}
  236. // CHECK:STDOUT: --- no_poison.carbon
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: constants {
  239. // CHECK:STDOUT: %C.f79: type = class_type @C.1 [template]
  240. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  241. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  242. // CHECK:STDOUT: %C.9f4: type = class_type @C.2 [template]
  243. // CHECK:STDOUT: %F1.type: type = fn_type @F1 [template]
  244. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  245. // CHECK:STDOUT: %F1: %F1.type = struct_value () [template]
  246. // CHECK:STDOUT: %F2.type: type = fn_type @F2 [template]
  247. // CHECK:STDOUT: %F2: %F2.type = struct_value () [template]
  248. // CHECK:STDOUT: }
  249. // CHECK:STDOUT:
  250. // CHECK:STDOUT: file {
  251. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  252. // CHECK:STDOUT: .C = %C.decl.loc4
  253. // CHECK:STDOUT: .N = %N
  254. // CHECK:STDOUT: }
  255. // CHECK:STDOUT: %C.decl.loc4: type = class_decl @C.1 [template = constants.%C.f79] {} {}
  256. // CHECK:STDOUT: %N: <namespace> = namespace [template] {
  257. // CHECK:STDOUT: .C = %C.decl.loc8
  258. // CHECK:STDOUT: .F1 = %F1.decl
  259. // CHECK:STDOUT: .F2 = %F2.decl
  260. // CHECK:STDOUT: }
  261. // CHECK:STDOUT: %C.decl.loc8: type = class_decl @C.2 [template = constants.%C.9f4] {} {}
  262. // CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] {
  263. // CHECK:STDOUT: %x.patt: %C.9f4 = binding_pattern x
  264. // CHECK:STDOUT: %x.param_patt: %C.9f4 = value_param_pattern %x.patt, runtime_param0
  265. // CHECK:STDOUT: } {
  266. // CHECK:STDOUT: %x.param: %C.9f4 = value_param runtime_param0
  267. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl.loc8 [template = constants.%C.9f4]
  268. // CHECK:STDOUT: %x: %C.9f4 = bind_name x, %x.param
  269. // CHECK:STDOUT: }
  270. // CHECK:STDOUT: %F2.decl: %F2.type = fn_decl @F2 [template = constants.%F2] {
  271. // CHECK:STDOUT: %x.patt: %C.9f4 = binding_pattern x
  272. // CHECK:STDOUT: %x.param_patt: %C.9f4 = value_param_pattern %x.patt, runtime_param0
  273. // CHECK:STDOUT: } {
  274. // CHECK:STDOUT: %x.param: %C.9f4 = value_param runtime_param0
  275. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl.loc8 [template = constants.%C.9f4]
  276. // CHECK:STDOUT: %x: %C.9f4 = bind_name x, %x.param
  277. // CHECK:STDOUT: }
  278. // CHECK:STDOUT: }
  279. // CHECK:STDOUT:
  280. // CHECK:STDOUT: class @C.1 {
  281. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  282. // CHECK:STDOUT:
  283. // CHECK:STDOUT: !members:
  284. // CHECK:STDOUT: .Self = constants.%C.f79
  285. // CHECK:STDOUT: complete_type_witness = %complete_type
  286. // CHECK:STDOUT: }
  287. // CHECK:STDOUT:
  288. // CHECK:STDOUT: class @C.2 {
  289. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  290. // CHECK:STDOUT:
  291. // CHECK:STDOUT: !members:
  292. // CHECK:STDOUT: .Self = constants.%C.9f4
  293. // CHECK:STDOUT: complete_type_witness = %complete_type
  294. // CHECK:STDOUT: }
  295. // CHECK:STDOUT:
  296. // CHECK:STDOUT: fn @F1(%x.param_patt: %C.9f4);
  297. // CHECK:STDOUT:
  298. // CHECK:STDOUT: fn @F2(%x.param_patt: %C.9f4) {
  299. // CHECK:STDOUT: !entry:
  300. // CHECK:STDOUT: %N.ref: <namespace> = name_ref N, file.%N [template = file.%N]
  301. // CHECK:STDOUT: %F1.ref: %F1.type = name_ref F1, file.%F1.decl [template = constants.%F1]
  302. // CHECK:STDOUT: %x.ref: %C.9f4 = name_ref x, %x
  303. // CHECK:STDOUT: %F1.call: init %empty_tuple.type = call %F1.ref(%x.ref)
  304. // CHECK:STDOUT: return
  305. // CHECK:STDOUT: }
  306. // CHECK:STDOUT:
  307. // CHECK:STDOUT: --- poison.carbon
  308. // CHECK:STDOUT:
  309. // CHECK:STDOUT: constants {
  310. // CHECK:STDOUT: %C: type = class_type @C [template]
  311. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  312. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  313. // CHECK:STDOUT: %F1.type: type = fn_type @F1 [template]
  314. // CHECK:STDOUT: %F1: %F1.type = struct_value () [template]
  315. // CHECK:STDOUT: }
  316. // CHECK:STDOUT:
  317. // CHECK:STDOUT: file {
  318. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  319. // CHECK:STDOUT: .C = %C.decl
  320. // CHECK:STDOUT: .N = %N
  321. // CHECK:STDOUT: }
  322. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {}
  323. // CHECK:STDOUT: %N: <namespace> = namespace [template] {
  324. // CHECK:STDOUT: .F1 = %F1.decl
  325. // CHECK:STDOUT: }
  326. // CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] {
  327. // CHECK:STDOUT: %x.patt: %C = binding_pattern x
  328. // CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0
  329. // CHECK:STDOUT: } {
  330. // CHECK:STDOUT: %x.param: %C = value_param runtime_param0
  331. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
  332. // CHECK:STDOUT: %x: %C = bind_name x, %x.param
  333. // CHECK:STDOUT: }
  334. // CHECK:STDOUT: }
  335. // CHECK:STDOUT:
  336. // CHECK:STDOUT: class @C {
  337. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  338. // CHECK:STDOUT:
  339. // CHECK:STDOUT: !members:
  340. // CHECK:STDOUT: .Self = constants.%C
  341. // CHECK:STDOUT: complete_type_witness = %complete_type
  342. // CHECK:STDOUT: }
  343. // CHECK:STDOUT:
  344. // CHECK:STDOUT: fn @F1(%x.param_patt: %C);
  345. // CHECK:STDOUT:
  346. // CHECK:STDOUT: --- fail_poison_class_without_usage.carbon
  347. // CHECK:STDOUT:
  348. // CHECK:STDOUT: constants {
  349. // CHECK:STDOUT: %C: type = class_type @C [template]
  350. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  351. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  352. // CHECK:STDOUT: %F1.type: type = fn_type @F1 [template]
  353. // CHECK:STDOUT: %F1: %F1.type = struct_value () [template]
  354. // CHECK:STDOUT: %.fb7: type = class_type @.1 [template]
  355. // CHECK:STDOUT: }
  356. // CHECK:STDOUT:
  357. // CHECK:STDOUT: file {
  358. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  359. // CHECK:STDOUT: .C = %C.decl
  360. // CHECK:STDOUT: .N = %N
  361. // CHECK:STDOUT: }
  362. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {}
  363. // CHECK:STDOUT: %N: <namespace> = namespace [template] {
  364. // CHECK:STDOUT: .F1 = %F1.decl
  365. // CHECK:STDOUT: }
  366. // CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] {
  367. // CHECK:STDOUT: %x.patt: %C = binding_pattern x
  368. // CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0
  369. // CHECK:STDOUT: } {
  370. // CHECK:STDOUT: %x.param: %C = value_param runtime_param0
  371. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
  372. // CHECK:STDOUT: %x: %C = bind_name x, %x.param
  373. // CHECK:STDOUT: }
  374. // CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.fb7] {} {}
  375. // CHECK:STDOUT: }
  376. // CHECK:STDOUT:
  377. // CHECK:STDOUT: class @C {
  378. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  379. // CHECK:STDOUT:
  380. // CHECK:STDOUT: !members:
  381. // CHECK:STDOUT: .Self = constants.%C
  382. // CHECK:STDOUT: complete_type_witness = %complete_type
  383. // CHECK:STDOUT: }
  384. // CHECK:STDOUT:
  385. // CHECK:STDOUT: class @.1 {
  386. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  387. // CHECK:STDOUT:
  388. // CHECK:STDOUT: !members:
  389. // CHECK:STDOUT: .Self = constants.%.fb7
  390. // CHECK:STDOUT: complete_type_witness = %complete_type
  391. // CHECK:STDOUT: }
  392. // CHECK:STDOUT:
  393. // CHECK:STDOUT: fn @F1(%x.param_patt: %C);
  394. // CHECK:STDOUT:
  395. // CHECK:STDOUT: --- fail_poison_interface_without_usage.carbon
  396. // CHECK:STDOUT:
  397. // CHECK:STDOUT: constants {
  398. // CHECK:STDOUT: %I.type: type = facet_type <@I> [template]
  399. // CHECK:STDOUT: %Self.fb7: %I.type = bind_symbolic_name Self, 0 [symbolic]
  400. // CHECK:STDOUT: %F1.type: type = fn_type @F1 [template]
  401. // CHECK:STDOUT: %F1: %F1.type = struct_value () [template]
  402. // CHECK:STDOUT: %.type: type = facet_type <@.1> [template]
  403. // CHECK:STDOUT: %Self.cff: %.type = bind_symbolic_name Self, 0 [symbolic]
  404. // CHECK:STDOUT: }
  405. // CHECK:STDOUT:
  406. // CHECK:STDOUT: file {
  407. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  408. // CHECK:STDOUT: .I = %I.decl
  409. // CHECK:STDOUT: .N = %N
  410. // CHECK:STDOUT: }
  411. // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {}
  412. // CHECK:STDOUT: %N: <namespace> = namespace [template] {
  413. // CHECK:STDOUT: .F1 = %F1.decl
  414. // CHECK:STDOUT: }
  415. // CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] {
  416. // CHECK:STDOUT: %x.patt: %I.type = binding_pattern x
  417. // CHECK:STDOUT: %x.param_patt: %I.type = value_param_pattern %x.patt, runtime_param0
  418. // CHECK:STDOUT: } {
  419. // CHECK:STDOUT: %x.param: %I.type = value_param runtime_param0
  420. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type]
  421. // CHECK:STDOUT: %x: %I.type = bind_name x, %x.param
  422. // CHECK:STDOUT: }
  423. // CHECK:STDOUT: %.decl: type = interface_decl @.1 [template = constants.%.type] {} {}
  424. // CHECK:STDOUT: }
  425. // CHECK:STDOUT:
  426. // CHECK:STDOUT: interface @I {
  427. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.fb7]
  428. // CHECK:STDOUT:
  429. // CHECK:STDOUT: !members:
  430. // CHECK:STDOUT: .Self = %Self
  431. // CHECK:STDOUT: witness = ()
  432. // CHECK:STDOUT: }
  433. // CHECK:STDOUT:
  434. // CHECK:STDOUT: interface @.1 {
  435. // CHECK:STDOUT: %Self: %.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.cff]
  436. // CHECK:STDOUT:
  437. // CHECK:STDOUT: !members:
  438. // CHECK:STDOUT: .Self = %Self
  439. // CHECK:STDOUT: witness = ()
  440. // CHECK:STDOUT: }
  441. // CHECK:STDOUT:
  442. // CHECK:STDOUT: fn @F1(%x.param_patt: %I.type);
  443. // CHECK:STDOUT:
  444. // CHECK:STDOUT: --- fail_poison_namespace_without_usage.carbon
  445. // CHECK:STDOUT:
  446. // CHECK:STDOUT: constants {
  447. // CHECK:STDOUT: %C: type = class_type @C [template]
  448. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  449. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  450. // CHECK:STDOUT: %F1.type: type = fn_type @F1 [template]
  451. // CHECK:STDOUT: %F1: %F1.type = struct_value () [template]
  452. // CHECK:STDOUT: }
  453. // CHECK:STDOUT:
  454. // CHECK:STDOUT: file {
  455. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  456. // CHECK:STDOUT: .C = %C.decl
  457. // CHECK:STDOUT: .N = %N
  458. // CHECK:STDOUT: }
  459. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {}
  460. // CHECK:STDOUT: %N: <namespace> = namespace [template] {
  461. // CHECK:STDOUT: .F1 = %F1.decl
  462. // CHECK:STDOUT: }
  463. // CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] {
  464. // CHECK:STDOUT: %x.patt: %C = binding_pattern x
  465. // CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0
  466. // CHECK:STDOUT: } {
  467. // CHECK:STDOUT: %x.param: %C = value_param runtime_param0
  468. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
  469. // CHECK:STDOUT: %x: %C = bind_name x, %x.param
  470. // CHECK:STDOUT: }
  471. // CHECK:STDOUT: %.loc17: <namespace> = namespace [template] {}
  472. // CHECK:STDOUT: }
  473. // CHECK:STDOUT:
  474. // CHECK:STDOUT: class @C {
  475. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  476. // CHECK:STDOUT:
  477. // CHECK:STDOUT: !members:
  478. // CHECK:STDOUT: .Self = constants.%C
  479. // CHECK:STDOUT: complete_type_witness = %complete_type
  480. // CHECK:STDOUT: }
  481. // CHECK:STDOUT:
  482. // CHECK:STDOUT: fn @F1(%x.param_patt: %C);
  483. // CHECK:STDOUT:
  484. // CHECK:STDOUT: --- fail_poison_member_without_usage.carbon
  485. // CHECK:STDOUT:
  486. // CHECK:STDOUT: constants {
  487. // CHECK:STDOUT: %C1: type = class_type @C1 [template]
  488. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  489. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  490. // CHECK:STDOUT: %D: type = class_type @D [template]
  491. // CHECK:STDOUT: %F1.type: type = fn_type @F1 [template]
  492. // CHECK:STDOUT: %F1: %F1.type = struct_value () [template]
  493. // CHECK:STDOUT: %C2: type = class_type @C2 [template]
  494. // CHECK:STDOUT: %D.elem: type = unbound_element_type %D, %C2 [template]
  495. // CHECK:STDOUT: %struct_type.C1: type = struct_type {.C1: %C2} [template]
  496. // CHECK:STDOUT: %complete_type.b44: <witness> = complete_type_witness %struct_type.C1 [template]
  497. // CHECK:STDOUT: }
  498. // CHECK:STDOUT:
  499. // CHECK:STDOUT: file {
  500. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  501. // CHECK:STDOUT: .C1 = %C1.decl
  502. // CHECK:STDOUT: .D = %D.decl
  503. // CHECK:STDOUT: }
  504. // CHECK:STDOUT: %C1.decl: type = class_decl @C1 [template = constants.%C1] {} {}
  505. // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {}
  506. // CHECK:STDOUT: }
  507. // CHECK:STDOUT:
  508. // CHECK:STDOUT: class @C1 {
  509. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  510. // CHECK:STDOUT:
  511. // CHECK:STDOUT: !members:
  512. // CHECK:STDOUT: .Self = constants.%C1
  513. // CHECK:STDOUT: complete_type_witness = %complete_type
  514. // CHECK:STDOUT: }
  515. // CHECK:STDOUT:
  516. // CHECK:STDOUT: class @D {
  517. // CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] {
  518. // CHECK:STDOUT: %x.patt: %C1 = binding_pattern x
  519. // CHECK:STDOUT: %x.param_patt: %C1 = value_param_pattern %x.patt, runtime_param0
  520. // CHECK:STDOUT: } {
  521. // CHECK:STDOUT: %x.param: %C1 = value_param runtime_param0
  522. // CHECK:STDOUT: %C1.ref: type = name_ref C1, file.%C1.decl [template = constants.%C1]
  523. // CHECK:STDOUT: %x: %C1 = bind_name x, %x.param
  524. // CHECK:STDOUT: }
  525. // CHECK:STDOUT: %C2.decl: type = class_decl @C2 [template = constants.%C2] {} {}
  526. // CHECK:STDOUT: %.loc18: %D.elem = field_decl C1, element0 [template]
  527. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.C1 [template = constants.%complete_type.b44]
  528. // CHECK:STDOUT:
  529. // CHECK:STDOUT: !members:
  530. // CHECK:STDOUT: .Self = constants.%D
  531. // CHECK:STDOUT: .F1 = %F1.decl
  532. // CHECK:STDOUT: .C2 = %C2.decl
  533. // CHECK:STDOUT: complete_type_witness = %complete_type
  534. // CHECK:STDOUT: }
  535. // CHECK:STDOUT:
  536. // CHECK:STDOUT: class @C2 {
  537. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  538. // CHECK:STDOUT:
  539. // CHECK:STDOUT: !members:
  540. // CHECK:STDOUT: .Self = constants.%C2
  541. // CHECK:STDOUT: complete_type_witness = %complete_type
  542. // CHECK:STDOUT: }
  543. // CHECK:STDOUT:
  544. // CHECK:STDOUT: fn @F1(%x.param_patt: %C1);
  545. // CHECK:STDOUT:
  546. // CHECK:STDOUT: --- fail_poison_function_without_usage.carbon
  547. // CHECK:STDOUT:
  548. // CHECK:STDOUT: constants {
  549. // CHECK:STDOUT: %C: type = class_type @C [template]
  550. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  551. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  552. // CHECK:STDOUT: %F1.type: type = fn_type @F1 [template]
  553. // CHECK:STDOUT: %F1: %F1.type = struct_value () [template]
  554. // CHECK:STDOUT: %.type: type = fn_type @.1 [template]
  555. // CHECK:STDOUT: %.236: %.type = struct_value () [template]
  556. // CHECK:STDOUT: }
  557. // CHECK:STDOUT:
  558. // CHECK:STDOUT: file {
  559. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  560. // CHECK:STDOUT: .C = %C.decl
  561. // CHECK:STDOUT: .N = %N
  562. // CHECK:STDOUT: }
  563. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {}
  564. // CHECK:STDOUT: %N: <namespace> = namespace [template] {
  565. // CHECK:STDOUT: .F1 = %F1.decl
  566. // CHECK:STDOUT: }
  567. // CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] {
  568. // CHECK:STDOUT: %x.patt: %C = binding_pattern x
  569. // CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0
  570. // CHECK:STDOUT: } {
  571. // CHECK:STDOUT: %x.param: %C = value_param runtime_param0
  572. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
  573. // CHECK:STDOUT: %x: %C = bind_name x, %x.param
  574. // CHECK:STDOUT: }
  575. // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.236] {} {}
  576. // CHECK:STDOUT: }
  577. // CHECK:STDOUT:
  578. // CHECK:STDOUT: class @C {
  579. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  580. // CHECK:STDOUT:
  581. // CHECK:STDOUT: !members:
  582. // CHECK:STDOUT: .Self = constants.%C
  583. // CHECK:STDOUT: complete_type_witness = %complete_type
  584. // CHECK:STDOUT: }
  585. // CHECK:STDOUT:
  586. // CHECK:STDOUT: fn @F1(%x.param_patt: %C);
  587. // CHECK:STDOUT:
  588. // CHECK:STDOUT: fn @.1();
  589. // CHECK:STDOUT:
  590. // CHECK:STDOUT: --- fail_use_undefined_poisoned_name.carbon
  591. // CHECK:STDOUT:
  592. // CHECK:STDOUT: constants {
  593. // CHECK:STDOUT: %C: type = class_type @C [template]
  594. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  595. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  596. // CHECK:STDOUT: %F1.type: type = fn_type @F1 [template]
  597. // CHECK:STDOUT: %F1: %F1.type = struct_value () [template]
  598. // CHECK:STDOUT: %F2.type: type = fn_type @F2 [template]
  599. // CHECK:STDOUT: %F2: %F2.type = struct_value () [template]
  600. // CHECK:STDOUT: }
  601. // CHECK:STDOUT:
  602. // CHECK:STDOUT: file {
  603. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  604. // CHECK:STDOUT: .C = %C.decl
  605. // CHECK:STDOUT: .N = %N
  606. // CHECK:STDOUT: }
  607. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {}
  608. // CHECK:STDOUT: %N: <namespace> = namespace [template] {
  609. // CHECK:STDOUT: .F1 = %F1.decl
  610. // CHECK:STDOUT: .F2 = %F2.decl
  611. // CHECK:STDOUT: }
  612. // CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] {
  613. // CHECK:STDOUT: %return.patt: %C = return_slot_pattern
  614. // CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param0
  615. // CHECK:STDOUT: } {
  616. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
  617. // CHECK:STDOUT: %return.param: ref %C = out_param runtime_param0
  618. // CHECK:STDOUT: %return: ref %C = return_slot %return.param
  619. // CHECK:STDOUT: }
  620. // CHECK:STDOUT: %F2.decl: %F2.type = fn_decl @F2 [template = constants.%F2] {
  621. // CHECK:STDOUT: %return.patt: <error> = return_slot_pattern
  622. // CHECK:STDOUT: %return.param_patt: <error> = out_param_pattern %return.patt, runtime_param0
  623. // CHECK:STDOUT: } {
  624. // CHECK:STDOUT: %N.ref: <namespace> = name_ref N, file.%N [template = file.%N]
  625. // CHECK:STDOUT: %C.ref: <error> = name_ref C, <error> [template = <error>]
  626. // CHECK:STDOUT: %return.param: ref <error> = out_param runtime_param0
  627. // CHECK:STDOUT: %return: ref <error> = return_slot %return.param
  628. // CHECK:STDOUT: }
  629. // CHECK:STDOUT: }
  630. // CHECK:STDOUT:
  631. // CHECK:STDOUT: class @C {
  632. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  633. // CHECK:STDOUT:
  634. // CHECK:STDOUT: !members:
  635. // CHECK:STDOUT: .Self = constants.%C
  636. // CHECK:STDOUT: complete_type_witness = %complete_type
  637. // CHECK:STDOUT: }
  638. // CHECK:STDOUT:
  639. // CHECK:STDOUT: fn @F1() -> %C;
  640. // CHECK:STDOUT:
  641. // CHECK:STDOUT: fn @F2() -> <error>;
  642. // CHECK:STDOUT:
  643. // CHECK:STDOUT: --- fail_poison_with_usage.carbon
  644. // CHECK:STDOUT:
  645. // CHECK:STDOUT: constants {
  646. // CHECK:STDOUT: %C: type = class_type @C [template]
  647. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  648. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  649. // CHECK:STDOUT: %F1.type: type = fn_type @F1 [template]
  650. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  651. // CHECK:STDOUT: %F1: %F1.type = struct_value () [template]
  652. // CHECK:STDOUT: %.fb7: type = class_type @.1 [template]
  653. // CHECK:STDOUT: %F2.type: type = fn_type @F2 [template]
  654. // CHECK:STDOUT: %F2: %F2.type = struct_value () [template]
  655. // CHECK:STDOUT: }
  656. // CHECK:STDOUT:
  657. // CHECK:STDOUT: file {
  658. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  659. // CHECK:STDOUT: .C = %C.decl
  660. // CHECK:STDOUT: .N = %N
  661. // CHECK:STDOUT: }
  662. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {}
  663. // CHECK:STDOUT: %N: <namespace> = namespace [template] {
  664. // CHECK:STDOUT: .F1 = %F1.decl
  665. // CHECK:STDOUT: .F2 = %F2.decl
  666. // CHECK:STDOUT: }
  667. // CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] {
  668. // CHECK:STDOUT: %x.patt: %C = binding_pattern x
  669. // CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0
  670. // CHECK:STDOUT: } {
  671. // CHECK:STDOUT: %x.param: %C = value_param runtime_param0
  672. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
  673. // CHECK:STDOUT: %x: %C = bind_name x, %x.param
  674. // CHECK:STDOUT: }
  675. // CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.fb7] {} {}
  676. // CHECK:STDOUT: %F2.decl: %F2.type = fn_decl @F2 [template = constants.%F2] {
  677. // CHECK:STDOUT: %x.patt: %C = binding_pattern x
  678. // CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0
  679. // CHECK:STDOUT: } {
  680. // CHECK:STDOUT: %x.param: %C = value_param runtime_param0
  681. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
  682. // CHECK:STDOUT: %x: %C = bind_name x, %x.param
  683. // CHECK:STDOUT: }
  684. // CHECK:STDOUT: }
  685. // CHECK:STDOUT:
  686. // CHECK:STDOUT: class @C {
  687. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  688. // CHECK:STDOUT:
  689. // CHECK:STDOUT: !members:
  690. // CHECK:STDOUT: .Self = constants.%C
  691. // CHECK:STDOUT: complete_type_witness = %complete_type
  692. // CHECK:STDOUT: }
  693. // CHECK:STDOUT:
  694. // CHECK:STDOUT: class @.1 {
  695. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  696. // CHECK:STDOUT:
  697. // CHECK:STDOUT: !members:
  698. // CHECK:STDOUT: .Self = constants.%.fb7
  699. // CHECK:STDOUT: complete_type_witness = %complete_type
  700. // CHECK:STDOUT: }
  701. // CHECK:STDOUT:
  702. // CHECK:STDOUT: fn @F1(%x.param_patt: %C);
  703. // CHECK:STDOUT:
  704. // CHECK:STDOUT: fn @F2(%x.param_patt: %C) {
  705. // CHECK:STDOUT: !entry:
  706. // CHECK:STDOUT: %N.ref: <namespace> = name_ref N, file.%N [template = file.%N]
  707. // CHECK:STDOUT: %F1.ref: %F1.type = name_ref F1, file.%F1.decl [template = constants.%F1]
  708. // CHECK:STDOUT: %x.ref: %C = name_ref x, %x
  709. // CHECK:STDOUT: %F1.call: init %empty_tuple.type = call %F1.ref(%x.ref)
  710. // CHECK:STDOUT: return
  711. // CHECK:STDOUT: }
  712. // CHECK:STDOUT:
  713. // CHECK:STDOUT: --- fail_poison_multiple_scopes.carbon
  714. // CHECK:STDOUT:
  715. // CHECK:STDOUT: constants {
  716. // CHECK:STDOUT: %C: type = class_type @C [template]
  717. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  718. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  719. // CHECK:STDOUT: %D1: type = class_type @D1 [template]
  720. // CHECK:STDOUT: %D2.type: type = facet_type <@D2> [template]
  721. // CHECK:STDOUT: %Self.7cc: %D2.type = bind_symbolic_name Self, 0 [symbolic]
  722. // CHECK:STDOUT: %D3.cb3: type = class_type @D3 [template]
  723. // CHECK:STDOUT: %D3.4cd: type = class_type @D3, @D3(%Self.7cc) [symbolic]
  724. // CHECK:STDOUT: %F.type: type = fn_type @F, @D3(%Self.7cc) [symbolic]
  725. // CHECK:STDOUT: %F: %F.type = struct_value () [symbolic]
  726. // CHECK:STDOUT: %.a85: type = class_type @.1 [template]
  727. // CHECK:STDOUT: %.f6a: type = class_type @.1, @.1(%Self.7cc) [symbolic]
  728. // CHECK:STDOUT: %.eee: type = class_type @.2 [template]
  729. // CHECK:STDOUT: %.175: type = class_type @.2, @.2(%Self.7cc) [symbolic]
  730. // CHECK:STDOUT: %.700: type = class_type @.3 [template]
  731. // CHECK:STDOUT: %.1c0: type = class_type @.4 [template]
  732. // CHECK:STDOUT: %.type: type = facet_type <@.6> [template]
  733. // CHECK:STDOUT: %Self.d82: %.type = bind_symbolic_name Self, 0 [symbolic]
  734. // CHECK:STDOUT: %.4b5: type = class_type @.5 [template]
  735. // CHECK:STDOUT: }
  736. // CHECK:STDOUT:
  737. // CHECK:STDOUT: file {
  738. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  739. // CHECK:STDOUT: .C = %C.decl
  740. // CHECK:STDOUT: .N1 = %N1
  741. // CHECK:STDOUT: }
  742. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {}
  743. // CHECK:STDOUT: %N1: <namespace> = namespace [template] {
  744. // CHECK:STDOUT: .N2 = %N2
  745. // CHECK:STDOUT: }
  746. // CHECK:STDOUT: %N2: <namespace> = namespace [template] {
  747. // CHECK:STDOUT: .N3 = %N3
  748. // CHECK:STDOUT: }
  749. // CHECK:STDOUT: %N3: <namespace> = namespace [template] {
  750. // CHECK:STDOUT: .D1 = %D1.decl
  751. // CHECK:STDOUT: }
  752. // CHECK:STDOUT: %D1.decl: type = class_decl @D1 [template = constants.%D1] {} {}
  753. // CHECK:STDOUT: %.decl.loc49: type = class_decl @.4 [template = constants.%.1c0] {} {}
  754. // CHECK:STDOUT: %.decl.loc56: type = interface_decl @.6 [template = constants.%.type] {} {}
  755. // CHECK:STDOUT: %.decl.loc62: type = class_decl @.5 [template = constants.%.4b5] {} {}
  756. // CHECK:STDOUT: }
  757. // CHECK:STDOUT:
  758. // CHECK:STDOUT: interface @D2 {
  759. // CHECK:STDOUT: %Self: %D2.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.7cc]
  760. // CHECK:STDOUT: %D3.decl: type = class_decl @D3 [template = constants.%D3.cb3] {} {}
  761. // CHECK:STDOUT: %.decl: type = class_decl @.2 [template = constants.%.eee] {} {}
  762. // CHECK:STDOUT:
  763. // CHECK:STDOUT: !members:
  764. // CHECK:STDOUT: .Self = %Self
  765. // CHECK:STDOUT: .D3 = %D3.decl
  766. // CHECK:STDOUT: witness = ()
  767. // CHECK:STDOUT: }
  768. // CHECK:STDOUT:
  769. // CHECK:STDOUT: interface @.6 {
  770. // CHECK:STDOUT: %Self: %.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.d82]
  771. // CHECK:STDOUT:
  772. // CHECK:STDOUT: !members:
  773. // CHECK:STDOUT: .Self = %Self
  774. // CHECK:STDOUT: witness = ()
  775. // CHECK:STDOUT: }
  776. // CHECK:STDOUT:
  777. // CHECK:STDOUT: class @C {
  778. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  779. // CHECK:STDOUT:
  780. // CHECK:STDOUT: !members:
  781. // CHECK:STDOUT: .Self = constants.%C
  782. // CHECK:STDOUT: complete_type_witness = %complete_type
  783. // CHECK:STDOUT: }
  784. // CHECK:STDOUT:
  785. // CHECK:STDOUT: class @D1 {
  786. // CHECK:STDOUT: %D2.decl: type = interface_decl @D2 [template = constants.%D2.type] {} {}
  787. // CHECK:STDOUT: %.decl: type = class_decl @.3 [template = constants.%.700] {} {}
  788. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  789. // CHECK:STDOUT:
  790. // CHECK:STDOUT: !members:
  791. // CHECK:STDOUT: .Self = constants.%D1
  792. // CHECK:STDOUT: .D2 = %D2.decl
  793. // CHECK:STDOUT: complete_type_witness = %complete_type
  794. // CHECK:STDOUT: }
  795. // CHECK:STDOUT:
  796. // CHECK:STDOUT: generic class @D3(@D2.%Self: %D2.type) {
  797. // CHECK:STDOUT: !definition:
  798. // CHECK:STDOUT: %Self: %D2.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.7cc)]
  799. // CHECK:STDOUT: %F.type: type = fn_type @F, @D3(%Self) [symbolic = %F.type (constants.%F.type)]
  800. // CHECK:STDOUT: %F: @D3.%F.type (%F.type) = struct_value () [symbolic = %F (constants.%F)]
  801. // CHECK:STDOUT:
  802. // CHECK:STDOUT: class {
  803. // CHECK:STDOUT: %F.decl: @D3.%F.type (%F.type) = fn_decl @F [symbolic = @D3.%F (constants.%F)] {
  804. // CHECK:STDOUT: %x.patt: %C = binding_pattern x
  805. // CHECK:STDOUT: %x.param_patt: %C = value_param_pattern %x.patt, runtime_param0
  806. // CHECK:STDOUT: } {
  807. // CHECK:STDOUT: %x.param: %C = value_param runtime_param0
  808. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
  809. // CHECK:STDOUT: %x: %C = bind_name x, %x.param
  810. // CHECK:STDOUT: }
  811. // CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.a85] {} {}
  812. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  813. // CHECK:STDOUT:
  814. // CHECK:STDOUT: !members:
  815. // CHECK:STDOUT: .Self = constants.%D3.4cd
  816. // CHECK:STDOUT: .F = %F.decl
  817. // CHECK:STDOUT: complete_type_witness = %complete_type
  818. // CHECK:STDOUT: }
  819. // CHECK:STDOUT: }
  820. // CHECK:STDOUT:
  821. // CHECK:STDOUT: generic class @.1(@D2.%Self: %D2.type) {
  822. // CHECK:STDOUT: !definition:
  823. // CHECK:STDOUT:
  824. // CHECK:STDOUT: class {
  825. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  826. // CHECK:STDOUT:
  827. // CHECK:STDOUT: !members:
  828. // CHECK:STDOUT: .Self = constants.%.f6a
  829. // CHECK:STDOUT: complete_type_witness = %complete_type
  830. // CHECK:STDOUT: }
  831. // CHECK:STDOUT: }
  832. // CHECK:STDOUT:
  833. // CHECK:STDOUT: generic class @.2(@D2.%Self: %D2.type) {
  834. // CHECK:STDOUT: !definition:
  835. // CHECK:STDOUT:
  836. // CHECK:STDOUT: class {
  837. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  838. // CHECK:STDOUT:
  839. // CHECK:STDOUT: !members:
  840. // CHECK:STDOUT: .Self = constants.%.175
  841. // CHECK:STDOUT: complete_type_witness = %complete_type
  842. // CHECK:STDOUT: }
  843. // CHECK:STDOUT: }
  844. // CHECK:STDOUT:
  845. // CHECK:STDOUT: class @.3 {
  846. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  847. // CHECK:STDOUT:
  848. // CHECK:STDOUT: !members:
  849. // CHECK:STDOUT: .Self = constants.%.700
  850. // CHECK:STDOUT: complete_type_witness = %complete_type
  851. // CHECK:STDOUT: }
  852. // CHECK:STDOUT:
  853. // CHECK:STDOUT: class @.4 {
  854. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  855. // CHECK:STDOUT:
  856. // CHECK:STDOUT: !members:
  857. // CHECK:STDOUT: .Self = constants.%.1c0
  858. // CHECK:STDOUT: complete_type_witness = %complete_type
  859. // CHECK:STDOUT: }
  860. // CHECK:STDOUT:
  861. // CHECK:STDOUT: class @.5 {
  862. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  863. // CHECK:STDOUT:
  864. // CHECK:STDOUT: !members:
  865. // CHECK:STDOUT: .Self = constants.%.4b5
  866. // CHECK:STDOUT: complete_type_witness = %complete_type
  867. // CHECK:STDOUT: }
  868. // CHECK:STDOUT:
  869. // CHECK:STDOUT: generic fn @F(@D2.%Self: %D2.type) {
  870. // CHECK:STDOUT:
  871. // CHECK:STDOUT: fn(%x.param_patt: %C);
  872. // CHECK:STDOUT: }
  873. // CHECK:STDOUT:
  874. // CHECK:STDOUT: specific @D3(constants.%Self.7cc) {}
  875. // CHECK:STDOUT:
  876. // CHECK:STDOUT: specific @F(constants.%Self.7cc) {}
  877. // CHECK:STDOUT:
  878. // CHECK:STDOUT: specific @.1(constants.%Self.7cc) {}
  879. // CHECK:STDOUT:
  880. // CHECK:STDOUT: specific @D3(%Self) {}
  881. // CHECK:STDOUT:
  882. // CHECK:STDOUT: specific @.2(constants.%Self.7cc) {}
  883. // CHECK:STDOUT:
  884. // CHECK:STDOUT: --- fail_alias.carbon
  885. // CHECK:STDOUT:
  886. // CHECK:STDOUT: constants {
  887. // CHECK:STDOUT: %C: type = class_type @C [template]
  888. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  889. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  890. // CHECK:STDOUT: }
  891. // CHECK:STDOUT:
  892. // CHECK:STDOUT: file {
  893. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  894. // CHECK:STDOUT: .C = %C.decl
  895. // CHECK:STDOUT: .N = %N
  896. // CHECK:STDOUT: }
  897. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {}
  898. // CHECK:STDOUT: %N: <namespace> = namespace [template] {}
  899. // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C]
  900. // CHECK:STDOUT: %.loc12: type = bind_alias <invalid>, %C.decl [template = constants.%C]
  901. // CHECK:STDOUT: }
  902. // CHECK:STDOUT:
  903. // CHECK:STDOUT: class @C {
  904. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  905. // CHECK:STDOUT:
  906. // CHECK:STDOUT: !members:
  907. // CHECK:STDOUT: .Self = constants.%C
  908. // CHECK:STDOUT: complete_type_witness = %complete_type
  909. // CHECK:STDOUT: }
  910. // CHECK:STDOUT:
  911. // CHECK:STDOUT: --- ignored_poison_in_import.carbon
  912. // CHECK:STDOUT:
  913. // CHECK:STDOUT: constants {
  914. // CHECK:STDOUT: %C: type = class_type @C [template]
  915. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  916. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  917. // CHECK:STDOUT: }
  918. // CHECK:STDOUT:
  919. // CHECK:STDOUT: imports {
  920. // CHECK:STDOUT: %import_ref.85d = import_ref Main//poison, C, unloaded
  921. // CHECK:STDOUT: %import_ref.a98: <namespace> = import_ref Main//poison, N, loaded
  922. // CHECK:STDOUT: %N: <namespace> = namespace %import_ref.a98, [template] {
  923. // CHECK:STDOUT: .F1 = %import_ref.204
  924. // CHECK:STDOUT: .C = file.%C.decl
  925. // CHECK:STDOUT: }
  926. // CHECK:STDOUT: }
  927. // CHECK:STDOUT:
  928. // CHECK:STDOUT: file {
  929. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  930. // CHECK:STDOUT: .C = imports.%import_ref.85d
  931. // CHECK:STDOUT: .N = imports.%N
  932. // CHECK:STDOUT: }
  933. // CHECK:STDOUT: %default.import = import <invalid>
  934. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {}
  935. // CHECK:STDOUT: }
  936. // CHECK:STDOUT:
  937. // CHECK:STDOUT: class @C {
  938. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  939. // CHECK:STDOUT:
  940. // CHECK:STDOUT: !members:
  941. // CHECK:STDOUT: .Self = constants.%C
  942. // CHECK:STDOUT: complete_type_witness = %complete_type
  943. // CHECK:STDOUT: }
  944. // CHECK:STDOUT:
  945. // CHECK:STDOUT: --- poison.impl.carbon
  946. // CHECK:STDOUT:
  947. // CHECK:STDOUT: constants {
  948. // CHECK:STDOUT: %C: type = class_type @C [template]
  949. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  950. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  951. // CHECK:STDOUT: }
  952. // CHECK:STDOUT:
  953. // CHECK:STDOUT: imports {
  954. // CHECK:STDOUT: %import_ref.85d = import_ref Main//poison, C, unloaded
  955. // CHECK:STDOUT: %import_ref.a98: <namespace> = import_ref Main//poison, N, loaded
  956. // CHECK:STDOUT: %N: <namespace> = namespace %import_ref.a98, [template] {
  957. // CHECK:STDOUT: .F1 = %import_ref.204
  958. // CHECK:STDOUT: .C = file.%C.decl
  959. // CHECK:STDOUT: }
  960. // CHECK:STDOUT: }
  961. // CHECK:STDOUT:
  962. // CHECK:STDOUT: file {
  963. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  964. // CHECK:STDOUT: .C = imports.%import_ref.85d
  965. // CHECK:STDOUT: .N = imports.%N
  966. // CHECK:STDOUT: }
  967. // CHECK:STDOUT: %default.import.loc2_6.1 = import <invalid>
  968. // CHECK:STDOUT: %default.import.loc2_6.2 = import <invalid>
  969. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {}
  970. // CHECK:STDOUT: }
  971. // CHECK:STDOUT:
  972. // CHECK:STDOUT: class @C {
  973. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  974. // CHECK:STDOUT:
  975. // CHECK:STDOUT: !members:
  976. // CHECK:STDOUT: .Self = constants.%C
  977. // CHECK:STDOUT: complete_type_witness = %complete_type
  978. // CHECK:STDOUT: }
  979. // CHECK:STDOUT:
  980. // CHECK:STDOUT: --- using_poisoned_name_in_impl.carbon
  981. // CHECK:STDOUT:
  982. // CHECK:STDOUT: constants {
  983. // CHECK:STDOUT: %C.type: type = facet_type <@C> [template]
  984. // CHECK:STDOUT: %Self: %C.type = bind_symbolic_name Self, 0 [symbolic]
  985. // CHECK:STDOUT: %F1.type: type = fn_type @F1 [template]
  986. // CHECK:STDOUT: %F1: %F1.type = struct_value () [template]
  987. // CHECK:STDOUT: %X: type = class_type @X [template]
  988. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness () [template]
  989. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  990. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  991. // CHECK:STDOUT: }
  992. // CHECK:STDOUT:
  993. // CHECK:STDOUT: file {
  994. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  995. // CHECK:STDOUT: .C = %C.decl
  996. // CHECK:STDOUT: .N = %N
  997. // CHECK:STDOUT: }
  998. // CHECK:STDOUT: %C.decl: type = interface_decl @C [template = constants.%C.type] {} {}
  999. // CHECK:STDOUT: %N: <namespace> = namespace [template] {
  1000. // CHECK:STDOUT: .F1 = %F1.decl
  1001. // CHECK:STDOUT: .X = %X.decl
  1002. // CHECK:STDOUT: }
  1003. // CHECK:STDOUT: %F1.decl: %F1.type = fn_decl @F1 [template = constants.%F1] {
  1004. // CHECK:STDOUT: %x.patt: %C.type = binding_pattern x
  1005. // CHECK:STDOUT: %x.param_patt: %C.type = value_param_pattern %x.patt, runtime_param0
  1006. // CHECK:STDOUT: } {
  1007. // CHECK:STDOUT: %x.param: %C.type = value_param runtime_param0
  1008. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C.type]
  1009. // CHECK:STDOUT: %x: %C.type = bind_name x, %x.param
  1010. // CHECK:STDOUT: }
  1011. // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} {}
  1012. // CHECK:STDOUT: }
  1013. // CHECK:STDOUT:
  1014. // CHECK:STDOUT: interface @C {
  1015. // CHECK:STDOUT: %Self: %C.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1016. // CHECK:STDOUT:
  1017. // CHECK:STDOUT: !members:
  1018. // CHECK:STDOUT: .Self = %Self
  1019. // CHECK:STDOUT: witness = ()
  1020. // CHECK:STDOUT: }
  1021. // CHECK:STDOUT:
  1022. // CHECK:STDOUT: impl @impl: %Self.ref as %C.ref {
  1023. // CHECK:STDOUT: !members:
  1024. // CHECK:STDOUT: witness = @X.%impl_witness
  1025. // CHECK:STDOUT: }
  1026. // CHECK:STDOUT:
  1027. // CHECK:STDOUT: class @X {
  1028. // CHECK:STDOUT: impl_decl @impl [template] {} {
  1029. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%X [template = constants.%X]
  1030. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C.type]
  1031. // CHECK:STDOUT: }
  1032. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness () [template = constants.%impl_witness]
  1033. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  1034. // CHECK:STDOUT:
  1035. // CHECK:STDOUT: !members:
  1036. // CHECK:STDOUT: .Self = constants.%X
  1037. // CHECK:STDOUT: extend @impl.%C.ref
  1038. // CHECK:STDOUT: complete_type_witness = %complete_type
  1039. // CHECK:STDOUT: }
  1040. // CHECK:STDOUT:
  1041. // CHECK:STDOUT: fn @F1(%x.param_patt: %C.type);
  1042. // CHECK:STDOUT:
  1043. // CHECK:STDOUT: --- fail_using_poisoned_name_in_impl_outside_class.carbon
  1044. // CHECK:STDOUT:
  1045. // CHECK:STDOUT: constants {
  1046. // CHECK:STDOUT: %A.type: type = facet_type <@A> [template]
  1047. // CHECK:STDOUT: %Self: %A.type = bind_symbolic_name Self, 0 [symbolic]
  1048. // CHECK:STDOUT: %B.type: type = fn_type @B [template]
  1049. // CHECK:STDOUT: %B: %B.type = struct_value () [template]
  1050. // CHECK:STDOUT: %B.assoc_type: type = assoc_entity_type %A.type, %B.type [template]
  1051. // CHECK:STDOUT: %assoc0: %B.assoc_type = assoc_entity element0, @A.%B.decl [template]
  1052. // CHECK:STDOUT: %X: type = class_type @X [template]
  1053. // CHECK:STDOUT: }
  1054. // CHECK:STDOUT:
  1055. // CHECK:STDOUT: file {}
  1056. // CHECK:STDOUT:
  1057. // CHECK:STDOUT: interface @A {
  1058. // CHECK:STDOUT: %Self: %A.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  1059. // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} {}
  1060. // CHECK:STDOUT: %assoc0: %B.assoc_type = assoc_entity element0, %B.decl [template = constants.%assoc0]
  1061. // CHECK:STDOUT:
  1062. // CHECK:STDOUT: !members:
  1063. // CHECK:STDOUT: .Self = %Self
  1064. // CHECK:STDOUT: .B = %assoc0
  1065. // CHECK:STDOUT: witness = (%B.decl)
  1066. // CHECK:STDOUT: }
  1067. // CHECK:STDOUT:
  1068. // CHECK:STDOUT: impl @impl: <unexpected>.inst26.loc8_15 as <unexpected>.inst27.loc8_18;
  1069. // CHECK:STDOUT:
  1070. // CHECK:STDOUT: class @X {
  1071. // CHECK:STDOUT: !members:
  1072. // CHECK:STDOUT: .Self = constants.%X
  1073. // CHECK:STDOUT: extend <unexpected>.inst27.loc8_18
  1074. // CHECK:STDOUT: complete_type_witness = invalid
  1075. // CHECK:STDOUT: }
  1076. // CHECK:STDOUT:
  1077. // CHECK:STDOUT: generic fn @B(@A.%Self: %A.type) {
  1078. // CHECK:STDOUT:
  1079. // CHECK:STDOUT: fn();
  1080. // CHECK:STDOUT: }
  1081. // CHECK:STDOUT:
  1082. // CHECK:STDOUT: fn @F();
  1083. // CHECK:STDOUT:
  1084. // CHECK:STDOUT: specific @B(constants.%Self) {}
  1085. // CHECK:STDOUT:
  1086. // CHECK:STDOUT: --- fail_no_poison_when_lookup_fails.carbon
  1087. // CHECK:STDOUT:
  1088. // CHECK:STDOUT: constants {
  1089. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  1090. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  1091. // CHECK:STDOUT: %C.f79: type = class_type @C.1 [template]
  1092. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  1093. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  1094. // CHECK:STDOUT: %C.9f4: type = class_type @C.2 [template]
  1095. // CHECK:STDOUT: }
  1096. // CHECK:STDOUT:
  1097. // CHECK:STDOUT: file {
  1098. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1099. // CHECK:STDOUT: .N = %N
  1100. // CHECK:STDOUT: .C = %C.decl.loc12
  1101. // CHECK:STDOUT: }
  1102. // CHECK:STDOUT: %N: <namespace> = namespace [template] {
  1103. // CHECK:STDOUT: .F = %F.decl
  1104. // CHECK:STDOUT: .C = %C.decl.loc13
  1105. // CHECK:STDOUT: }
  1106. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
  1107. // CHECK:STDOUT: %x.patt: <error> = binding_pattern x
  1108. // CHECK:STDOUT: %x.param_patt: <error> = value_param_pattern %x.patt, runtime_param0
  1109. // CHECK:STDOUT: } {
  1110. // CHECK:STDOUT: %x.param: <error> = value_param runtime_param0
  1111. // CHECK:STDOUT: %C.ref: <error> = name_ref C, <error> [template = <error>]
  1112. // CHECK:STDOUT: %x: <error> = bind_name x, %x.param
  1113. // CHECK:STDOUT: }
  1114. // CHECK:STDOUT: %C.decl.loc12: type = class_decl @C.1 [template = constants.%C.f79] {} {}
  1115. // CHECK:STDOUT: %C.decl.loc13: type = class_decl @C.2 [template = constants.%C.9f4] {} {}
  1116. // CHECK:STDOUT: }
  1117. // CHECK:STDOUT:
  1118. // CHECK:STDOUT: class @C.1 {
  1119. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  1120. // CHECK:STDOUT:
  1121. // CHECK:STDOUT: !members:
  1122. // CHECK:STDOUT: .Self = constants.%C.f79
  1123. // CHECK:STDOUT: complete_type_witness = %complete_type
  1124. // CHECK:STDOUT: }
  1125. // CHECK:STDOUT:
  1126. // CHECK:STDOUT: class @C.2 {
  1127. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  1128. // CHECK:STDOUT:
  1129. // CHECK:STDOUT: !members:
  1130. // CHECK:STDOUT: .Self = constants.%C.9f4
  1131. // CHECK:STDOUT: complete_type_witness = %complete_type
  1132. // CHECK:STDOUT: }
  1133. // CHECK:STDOUT:
  1134. // CHECK:STDOUT: fn @F(%x.param_patt: <error>);
  1135. // CHECK:STDOUT: