name_poisoning.carbon 53 KB

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