syntactic_merge.carbon 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
  6. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  7. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  8. //
  9. // AUTOUPDATE
  10. // TIP: To test this file alone, run:
  11. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/syntactic_merge.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/syntactic_merge.carbon
  14. // --- basic.carbon
  15. library "[[@TEST_NAME]]";
  16. class C {}
  17. alias D = C;
  18. class Foo(a:! C);
  19. class Foo(a:! C) {}
  20. class Bar(a:! D);
  21. class Bar(a:! D) {}
  22. // --- spacing.carbon
  23. library "[[@TEST_NAME]]";
  24. class C {}
  25. class Foo [ ] ( a :! C );
  26. class Foo[](a:! C) {}
  27. // --- fail_parens.carbon
  28. library "[[@TEST_NAME]]";
  29. class C {}
  30. class Foo(a:! C);
  31. // CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:15: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers]
  32. // CHECK:STDERR: class Foo(a:! (C)) {}
  33. // CHECK:STDERR: ^
  34. // CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:15: note: comparing with previous declaration here [RedeclParamSyntaxPrevious]
  35. // CHECK:STDERR: class Foo(a:! C);
  36. // CHECK:STDERR: ^
  37. // CHECK:STDERR:
  38. class Foo(a:! (C)) {}
  39. // --- todo_fail_raw_identifier.carbon
  40. library "[[@TEST_NAME]]";
  41. class C {}
  42. class Foo(a:! C);
  43. class Foo(a:! r#C) {}
  44. // --- two_file.carbon
  45. library "[[@TEST_NAME]]";
  46. class C {}
  47. alias D = C;
  48. class Foo(a:! C);
  49. class Bar(a:! D);
  50. // --- two_file.impl.carbon
  51. impl library "[[@TEST_NAME]]";
  52. class Foo(a:! C) {}
  53. class Bar(a:! D) {}
  54. // --- fail_name_mismatch.carbon
  55. library "[[@TEST_NAME]]";
  56. class C {}
  57. alias D = C;
  58. class Foo(a:! C);
  59. // CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:11: error: redeclaration differs at parameter 1 [RedeclParamDiffers]
  60. // CHECK:STDERR: class Foo(b:! D) {}
  61. // CHECK:STDERR: ^
  62. // CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:11: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
  63. // CHECK:STDERR: class Foo(a:! C);
  64. // CHECK:STDERR: ^
  65. // CHECK:STDERR:
  66. class Foo(b:! D) {}
  67. // --- fail_alias.carbon
  68. library "[[@TEST_NAME]]";
  69. class C {}
  70. alias D = C;
  71. class Foo(a:! C);
  72. // CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:15: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers]
  73. // CHECK:STDERR: class Foo(a:! D) {}
  74. // CHECK:STDERR: ^
  75. // CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:15: note: comparing with previous declaration here [RedeclParamSyntaxPrevious]
  76. // CHECK:STDERR: class Foo(a:! C);
  77. // CHECK:STDERR: ^
  78. // CHECK:STDERR:
  79. class Foo(a:! D) {}
  80. // --- fail_deduced_alias.carbon
  81. library "[[@TEST_NAME]]";
  82. class C {}
  83. alias D = C;
  84. class Foo[a:! C]();
  85. // CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:15: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers]
  86. // CHECK:STDERR: class Foo[a:! D]() {}
  87. // CHECK:STDERR: ^
  88. // CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:15: note: comparing with previous declaration here [RedeclParamSyntaxPrevious]
  89. // CHECK:STDERR: class Foo[a:! C]();
  90. // CHECK:STDERR: ^
  91. // CHECK:STDERR:
  92. class Foo[a:! D]() {}
  93. // --- alias_two_file.carbon
  94. library "[[@TEST_NAME]]";
  95. class C {}
  96. class Foo(a:! C);
  97. // --- todo_fail_alias_two_file.impl.carbon
  98. impl library "[[@TEST_NAME]]";
  99. alias D = C;
  100. class Foo(a:! D) {}
  101. // --- fail_repeat_const.carbon
  102. library "[[@TEST_NAME]]";
  103. class C {}
  104. class Foo(a:! const C);
  105. // CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+11]]:15: warning: `const` applied repeatedly to the same type has no additional effect [RepeatedConst]
  106. // CHECK:STDERR: class Foo(a:! const (const C)) {}
  107. // CHECK:STDERR: ^~~~~~~~~~~~~~~
  108. // CHECK:STDERR:
  109. // CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+7]]:21: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers]
  110. // CHECK:STDERR: class Foo(a:! const (const C)) {}
  111. // CHECK:STDERR: ^
  112. // CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:21: note: comparing with previous declaration here [RedeclParamSyntaxPrevious]
  113. // CHECK:STDERR: class Foo(a:! const C);
  114. // CHECK:STDERR: ^
  115. // CHECK:STDERR:
  116. class Foo(a:! const (const C)) {}
  117. // --- fail_self_type.carbon
  118. library "[[@TEST_NAME]]";
  119. base class Base {
  120. var a: ();
  121. fn F[addr self: Self*]();
  122. }
  123. // CHECK:STDERR: fail_self_type.carbon:[[@LINE+7]]:22: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers]
  124. // CHECK:STDERR: fn Base.F[addr self: Base*]() {
  125. // CHECK:STDERR: ^~~~
  126. // CHECK:STDERR: fail_self_type.carbon:[[@LINE-6]]:19: note: comparing with previous declaration here [RedeclParamSyntaxPrevious]
  127. // CHECK:STDERR: fn F[addr self: Self*]();
  128. // CHECK:STDERR: ^~~~
  129. // CHECK:STDERR:
  130. fn Base.F[addr self: Base*]() {
  131. (*self).a = ();
  132. }
  133. // CHECK:STDOUT: --- basic.carbon
  134. // CHECK:STDOUT:
  135. // CHECK:STDOUT: constants {
  136. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  137. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  138. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  139. // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic]
  140. // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
  141. // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [concrete]
  142. // CHECK:STDOUT: %Foo.generic: %Foo.type = struct_value () [concrete]
  143. // CHECK:STDOUT: %Foo: type = class_type @Foo, @Foo(%a) [symbolic]
  144. // CHECK:STDOUT: %Bar.type: type = generic_class_type @Bar [concrete]
  145. // CHECK:STDOUT: %Bar.generic: %Bar.type = struct_value () [concrete]
  146. // CHECK:STDOUT: %Bar: type = class_type @Bar, @Bar(%a) [symbolic]
  147. // CHECK:STDOUT: }
  148. // CHECK:STDOUT:
  149. // CHECK:STDOUT: file {
  150. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  151. // CHECK:STDOUT: .C = %C.decl
  152. // CHECK:STDOUT: .D = %D
  153. // CHECK:STDOUT: .Foo = %Foo.decl.loc7
  154. // CHECK:STDOUT: .Bar = %Bar.decl.loc10
  155. // CHECK:STDOUT: }
  156. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  157. // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C]
  158. // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [concrete = constants.%C]
  159. // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = class_decl @Foo [concrete = constants.%Foo.generic] {
  160. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  161. // CHECK:STDOUT: } {
  162. // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [concrete = constants.%C]
  163. // CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_11.1 (constants.%a)]
  164. // CHECK:STDOUT: }
  165. // CHECK:STDOUT: %Foo.decl.loc8: %Foo.type = class_decl @Foo [concrete = constants.%Foo.generic] {
  166. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  167. // CHECK:STDOUT: } {
  168. // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [concrete = constants.%C]
  169. // CHECK:STDOUT: %a.loc8: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_11.1 (constants.%a)]
  170. // CHECK:STDOUT: }
  171. // CHECK:STDOUT: %Bar.decl.loc10: %Bar.type = class_decl @Bar [concrete = constants.%Bar.generic] {
  172. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  173. // CHECK:STDOUT: } {
  174. // CHECK:STDOUT: %D.ref.loc10: type = name_ref D, file.%D [concrete = constants.%C]
  175. // CHECK:STDOUT: %a.loc10_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc10_11.1 (constants.%a)]
  176. // CHECK:STDOUT: }
  177. // CHECK:STDOUT: %Bar.decl.loc11: %Bar.type = class_decl @Bar [concrete = constants.%Bar.generic] {
  178. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  179. // CHECK:STDOUT: } {
  180. // CHECK:STDOUT: %D.ref.loc11: type = name_ref D, file.%D [concrete = constants.%C]
  181. // CHECK:STDOUT: %a.loc11: %C = bind_symbolic_name a, 0 [symbolic = %a.loc10_11.1 (constants.%a)]
  182. // CHECK:STDOUT: }
  183. // CHECK:STDOUT: }
  184. // CHECK:STDOUT:
  185. // CHECK:STDOUT: class @C {
  186. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  187. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  188. // CHECK:STDOUT: complete_type_witness = %complete_type
  189. // CHECK:STDOUT:
  190. // CHECK:STDOUT: !members:
  191. // CHECK:STDOUT: .Self = constants.%C
  192. // CHECK:STDOUT: }
  193. // CHECK:STDOUT:
  194. // CHECK:STDOUT: generic class @Foo(%a.loc7_11.2: %C) {
  195. // CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_11.1 (constants.%a)]
  196. // CHECK:STDOUT:
  197. // CHECK:STDOUT: !definition:
  198. // CHECK:STDOUT:
  199. // CHECK:STDOUT: class {
  200. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  201. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  202. // CHECK:STDOUT: complete_type_witness = %complete_type
  203. // CHECK:STDOUT:
  204. // CHECK:STDOUT: !members:
  205. // CHECK:STDOUT: .Self = constants.%Foo
  206. // CHECK:STDOUT: }
  207. // CHECK:STDOUT: }
  208. // CHECK:STDOUT:
  209. // CHECK:STDOUT: generic class @Bar(%a.loc10_11.2: %C) {
  210. // CHECK:STDOUT: %a.loc10_11.1: %C = bind_symbolic_name a, 0 [symbolic = %a.loc10_11.1 (constants.%a)]
  211. // CHECK:STDOUT:
  212. // CHECK:STDOUT: !definition:
  213. // CHECK:STDOUT:
  214. // CHECK:STDOUT: class {
  215. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  216. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  217. // CHECK:STDOUT: complete_type_witness = %complete_type
  218. // CHECK:STDOUT:
  219. // CHECK:STDOUT: !members:
  220. // CHECK:STDOUT: .Self = constants.%Bar
  221. // CHECK:STDOUT: }
  222. // CHECK:STDOUT: }
  223. // CHECK:STDOUT:
  224. // CHECK:STDOUT: specific @Foo(constants.%a) {
  225. // CHECK:STDOUT: %a.loc7_11.1 => constants.%a
  226. // CHECK:STDOUT: }
  227. // CHECK:STDOUT:
  228. // CHECK:STDOUT: specific @Bar(constants.%a) {
  229. // CHECK:STDOUT: %a.loc10_11.1 => constants.%a
  230. // CHECK:STDOUT: }
  231. // CHECK:STDOUT:
  232. // CHECK:STDOUT: --- spacing.carbon
  233. // CHECK:STDOUT:
  234. // CHECK:STDOUT: constants {
  235. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  236. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  237. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  238. // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic]
  239. // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
  240. // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [concrete]
  241. // CHECK:STDOUT: %Foo.generic: %Foo.type = struct_value () [concrete]
  242. // CHECK:STDOUT: %Foo: type = class_type @Foo, @Foo(%a) [symbolic]
  243. // CHECK:STDOUT: }
  244. // CHECK:STDOUT:
  245. // CHECK:STDOUT: file {
  246. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  247. // CHECK:STDOUT: .C = %C.decl
  248. // CHECK:STDOUT: .Foo = %Foo.decl.loc6
  249. // CHECK:STDOUT: }
  250. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  251. // CHECK:STDOUT: %Foo.decl.loc6: %Foo.type = class_decl @Foo [concrete = constants.%Foo.generic] {
  252. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  253. // CHECK:STDOUT: } {
  254. // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [concrete = constants.%C]
  255. // CHECK:STDOUT: %a.loc6_17.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc6_17.1 (constants.%a)]
  256. // CHECK:STDOUT: }
  257. // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = class_decl @Foo [concrete = constants.%Foo.generic] {
  258. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  259. // CHECK:STDOUT: } {
  260. // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [concrete = constants.%C]
  261. // CHECK:STDOUT: %a.loc7: %C = bind_symbolic_name a, 0 [symbolic = %a.loc6_17.1 (constants.%a)]
  262. // CHECK:STDOUT: }
  263. // CHECK:STDOUT: }
  264. // CHECK:STDOUT:
  265. // CHECK:STDOUT: class @C {
  266. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  267. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  268. // CHECK:STDOUT: complete_type_witness = %complete_type
  269. // CHECK:STDOUT:
  270. // CHECK:STDOUT: !members:
  271. // CHECK:STDOUT: .Self = constants.%C
  272. // CHECK:STDOUT: }
  273. // CHECK:STDOUT:
  274. // CHECK:STDOUT: generic class @Foo(%a.loc6_17.2: %C) {
  275. // CHECK:STDOUT: %a.loc6_17.1: %C = bind_symbolic_name a, 0 [symbolic = %a.loc6_17.1 (constants.%a)]
  276. // CHECK:STDOUT:
  277. // CHECK:STDOUT: !definition:
  278. // CHECK:STDOUT:
  279. // CHECK:STDOUT: class {
  280. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  281. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  282. // CHECK:STDOUT: complete_type_witness = %complete_type
  283. // CHECK:STDOUT:
  284. // CHECK:STDOUT: !members:
  285. // CHECK:STDOUT: .Self = constants.%Foo
  286. // CHECK:STDOUT: }
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: specific @Foo(constants.%a) {
  290. // CHECK:STDOUT: %a.loc6_17.1 => constants.%a
  291. // CHECK:STDOUT: }
  292. // CHECK:STDOUT:
  293. // CHECK:STDOUT: --- fail_parens.carbon
  294. // CHECK:STDOUT:
  295. // CHECK:STDOUT: constants {
  296. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  297. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  298. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  299. // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic]
  300. // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
  301. // CHECK:STDOUT: %Foo.type.39e446.1: type = generic_class_type @Foo.loc6 [concrete]
  302. // CHECK:STDOUT: %Foo.generic.80461b.1: %Foo.type.39e446.1 = struct_value () [concrete]
  303. // CHECK:STDOUT: %Foo.type.39e446.2: type = generic_class_type @Foo.loc14 [concrete]
  304. // CHECK:STDOUT: %Foo.generic.80461b.2: %Foo.type.39e446.2 = struct_value () [concrete]
  305. // CHECK:STDOUT: %Foo.67ab7c.2: type = class_type @Foo.loc14, @Foo.loc14(%a) [symbolic]
  306. // CHECK:STDOUT: }
  307. // CHECK:STDOUT:
  308. // CHECK:STDOUT: file {
  309. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  310. // CHECK:STDOUT: .C = %C.decl
  311. // CHECK:STDOUT: .Foo = %Foo.decl.loc6
  312. // CHECK:STDOUT: }
  313. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  314. // CHECK:STDOUT: %Foo.decl.loc6: %Foo.type.39e446.1 = class_decl @Foo.loc6 [concrete = constants.%Foo.generic.80461b.1] {
  315. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  316. // CHECK:STDOUT: } {
  317. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  318. // CHECK:STDOUT: %a.loc6_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc6_11.1 (constants.%a)]
  319. // CHECK:STDOUT: }
  320. // CHECK:STDOUT: %Foo.decl.loc14: %Foo.type.39e446.2 = class_decl @Foo.loc14 [concrete = constants.%Foo.generic.80461b.2] {
  321. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  322. // CHECK:STDOUT: } {
  323. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  324. // CHECK:STDOUT: %a.loc14_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc14_11.1 (constants.%a)]
  325. // CHECK:STDOUT: }
  326. // CHECK:STDOUT: }
  327. // CHECK:STDOUT:
  328. // CHECK:STDOUT: class @C {
  329. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  330. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  331. // CHECK:STDOUT: complete_type_witness = %complete_type
  332. // CHECK:STDOUT:
  333. // CHECK:STDOUT: !members:
  334. // CHECK:STDOUT: .Self = constants.%C
  335. // CHECK:STDOUT: }
  336. // CHECK:STDOUT:
  337. // CHECK:STDOUT: generic class @Foo.loc6(%a.loc6_11.2: %C) {
  338. // CHECK:STDOUT: %a.loc6_11.1: %C = bind_symbolic_name a, 0 [symbolic = %a.loc6_11.1 (constants.%a)]
  339. // CHECK:STDOUT:
  340. // CHECK:STDOUT: class;
  341. // CHECK:STDOUT: }
  342. // CHECK:STDOUT:
  343. // CHECK:STDOUT: generic class @Foo.loc14(%a.loc14_11.2: %C) {
  344. // CHECK:STDOUT: %a.loc14_11.1: %C = bind_symbolic_name a, 0 [symbolic = %a.loc14_11.1 (constants.%a)]
  345. // CHECK:STDOUT:
  346. // CHECK:STDOUT: !definition:
  347. // CHECK:STDOUT:
  348. // CHECK:STDOUT: class {
  349. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  350. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  351. // CHECK:STDOUT: complete_type_witness = %complete_type
  352. // CHECK:STDOUT:
  353. // CHECK:STDOUT: !members:
  354. // CHECK:STDOUT: .Self = constants.%Foo.67ab7c.2
  355. // CHECK:STDOUT: }
  356. // CHECK:STDOUT: }
  357. // CHECK:STDOUT:
  358. // CHECK:STDOUT: specific @Foo.loc6(constants.%a) {
  359. // CHECK:STDOUT: %a.loc6_11.1 => constants.%a
  360. // CHECK:STDOUT: }
  361. // CHECK:STDOUT:
  362. // CHECK:STDOUT: specific @Foo.loc14(constants.%a) {
  363. // CHECK:STDOUT: %a.loc14_11.1 => constants.%a
  364. // CHECK:STDOUT: }
  365. // CHECK:STDOUT:
  366. // CHECK:STDOUT: --- todo_fail_raw_identifier.carbon
  367. // CHECK:STDOUT:
  368. // CHECK:STDOUT: constants {
  369. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  370. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  371. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  372. // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic]
  373. // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
  374. // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [concrete]
  375. // CHECK:STDOUT: %Foo.generic: %Foo.type = struct_value () [concrete]
  376. // CHECK:STDOUT: %Foo: type = class_type @Foo, @Foo(%a) [symbolic]
  377. // CHECK:STDOUT: }
  378. // CHECK:STDOUT:
  379. // CHECK:STDOUT: file {
  380. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  381. // CHECK:STDOUT: .C = %C.decl
  382. // CHECK:STDOUT: .Foo = %Foo.decl.loc6
  383. // CHECK:STDOUT: }
  384. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  385. // CHECK:STDOUT: %Foo.decl.loc6: %Foo.type = class_decl @Foo [concrete = constants.%Foo.generic] {
  386. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  387. // CHECK:STDOUT: } {
  388. // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, file.%C.decl [concrete = constants.%C]
  389. // CHECK:STDOUT: %a.loc6_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc6_11.1 (constants.%a)]
  390. // CHECK:STDOUT: }
  391. // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type = class_decl @Foo [concrete = constants.%Foo.generic] {
  392. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  393. // CHECK:STDOUT: } {
  394. // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, file.%C.decl [concrete = constants.%C]
  395. // CHECK:STDOUT: %a.loc7: %C = bind_symbolic_name a, 0 [symbolic = %a.loc6_11.1 (constants.%a)]
  396. // CHECK:STDOUT: }
  397. // CHECK:STDOUT: }
  398. // CHECK:STDOUT:
  399. // CHECK:STDOUT: class @C {
  400. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  401. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  402. // CHECK:STDOUT: complete_type_witness = %complete_type
  403. // CHECK:STDOUT:
  404. // CHECK:STDOUT: !members:
  405. // CHECK:STDOUT: .Self = constants.%C
  406. // CHECK:STDOUT: }
  407. // CHECK:STDOUT:
  408. // CHECK:STDOUT: generic class @Foo(%a.loc6_11.2: %C) {
  409. // CHECK:STDOUT: %a.loc6_11.1: %C = bind_symbolic_name a, 0 [symbolic = %a.loc6_11.1 (constants.%a)]
  410. // CHECK:STDOUT:
  411. // CHECK:STDOUT: !definition:
  412. // CHECK:STDOUT:
  413. // CHECK:STDOUT: class {
  414. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  415. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  416. // CHECK:STDOUT: complete_type_witness = %complete_type
  417. // CHECK:STDOUT:
  418. // CHECK:STDOUT: !members:
  419. // CHECK:STDOUT: .Self = constants.%Foo
  420. // CHECK:STDOUT: }
  421. // CHECK:STDOUT: }
  422. // CHECK:STDOUT:
  423. // CHECK:STDOUT: specific @Foo(constants.%a) {
  424. // CHECK:STDOUT: %a.loc6_11.1 => constants.%a
  425. // CHECK:STDOUT: }
  426. // CHECK:STDOUT:
  427. // CHECK:STDOUT: --- two_file.carbon
  428. // CHECK:STDOUT:
  429. // CHECK:STDOUT: constants {
  430. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  431. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  432. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  433. // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic]
  434. // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
  435. // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [concrete]
  436. // CHECK:STDOUT: %Foo.generic: %Foo.type = struct_value () [concrete]
  437. // CHECK:STDOUT: %Bar.type: type = generic_class_type @Bar [concrete]
  438. // CHECK:STDOUT: %Bar.generic: %Bar.type = struct_value () [concrete]
  439. // CHECK:STDOUT: }
  440. // CHECK:STDOUT:
  441. // CHECK:STDOUT: file {
  442. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  443. // CHECK:STDOUT: .C = %C.decl
  444. // CHECK:STDOUT: .D = %D
  445. // CHECK:STDOUT: .Foo = %Foo.decl
  446. // CHECK:STDOUT: .Bar = %Bar.decl
  447. // CHECK:STDOUT: }
  448. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  449. // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C]
  450. // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [concrete = constants.%C]
  451. // CHECK:STDOUT: %Foo.decl: %Foo.type = class_decl @Foo [concrete = constants.%Foo.generic] {
  452. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  453. // CHECK:STDOUT: } {
  454. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  455. // CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_11.1 (constants.%a)]
  456. // CHECK:STDOUT: }
  457. // CHECK:STDOUT: %Bar.decl: %Bar.type = class_decl @Bar [concrete = constants.%Bar.generic] {
  458. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  459. // CHECK:STDOUT: } {
  460. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [concrete = constants.%C]
  461. // CHECK:STDOUT: %a.loc8_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc8_11.1 (constants.%a)]
  462. // CHECK:STDOUT: }
  463. // CHECK:STDOUT: }
  464. // CHECK:STDOUT:
  465. // CHECK:STDOUT: class @C {
  466. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  467. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  468. // CHECK:STDOUT: complete_type_witness = %complete_type
  469. // CHECK:STDOUT:
  470. // CHECK:STDOUT: !members:
  471. // CHECK:STDOUT: .Self = constants.%C
  472. // CHECK:STDOUT: }
  473. // CHECK:STDOUT:
  474. // CHECK:STDOUT: generic class @Foo(%a.loc7_11.2: %C) {
  475. // CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_11.1 (constants.%a)]
  476. // CHECK:STDOUT:
  477. // CHECK:STDOUT: class;
  478. // CHECK:STDOUT: }
  479. // CHECK:STDOUT:
  480. // CHECK:STDOUT: generic class @Bar(%a.loc8_11.2: %C) {
  481. // CHECK:STDOUT: %a.loc8_11.1: %C = bind_symbolic_name a, 0 [symbolic = %a.loc8_11.1 (constants.%a)]
  482. // CHECK:STDOUT:
  483. // CHECK:STDOUT: class;
  484. // CHECK:STDOUT: }
  485. // CHECK:STDOUT:
  486. // CHECK:STDOUT: specific @Foo(constants.%a) {
  487. // CHECK:STDOUT: %a.loc7_11.1 => constants.%a
  488. // CHECK:STDOUT: }
  489. // CHECK:STDOUT:
  490. // CHECK:STDOUT: specific @Bar(constants.%a) {
  491. // CHECK:STDOUT: %a.loc8_11.1 => constants.%a
  492. // CHECK:STDOUT: }
  493. // CHECK:STDOUT:
  494. // CHECK:STDOUT: --- two_file.impl.carbon
  495. // CHECK:STDOUT:
  496. // CHECK:STDOUT: constants {
  497. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  498. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  499. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  500. // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic]
  501. // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
  502. // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [concrete]
  503. // CHECK:STDOUT: %Foo.generic: %Foo.type = struct_value () [concrete]
  504. // CHECK:STDOUT: %Foo: type = class_type @Foo, @Foo(%a) [symbolic]
  505. // CHECK:STDOUT: %Bar.type: type = generic_class_type @Bar [concrete]
  506. // CHECK:STDOUT: %Bar.generic: %Bar.type = struct_value () [concrete]
  507. // CHECK:STDOUT: %Bar: type = class_type @Bar, @Bar(%a) [symbolic]
  508. // CHECK:STDOUT: }
  509. // CHECK:STDOUT:
  510. // CHECK:STDOUT: imports {
  511. // CHECK:STDOUT: %Main.C: type = import_ref Main//two_file, C, loaded [concrete = constants.%C]
  512. // CHECK:STDOUT: %Main.D: type = import_ref Main//two_file, D, loaded [concrete = constants.%C]
  513. // CHECK:STDOUT: %Main.import_ref.8f2: <witness> = import_ref Main//two_file, loc4_10, loaded [concrete = constants.%complete_type]
  514. // CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//two_file, inst16 [no loc], unloaded
  515. // CHECK:STDOUT: %Main.import_ref.f97b44.1: %C = import_ref Main//two_file, loc7_11, loaded [symbolic = @Foo.%a.1 (constants.%a)]
  516. // CHECK:STDOUT: %Main.import_ref.f97b44.2: %C = import_ref Main//two_file, loc8_11, loaded [symbolic = @Bar.%a.1 (constants.%a)]
  517. // CHECK:STDOUT: }
  518. // CHECK:STDOUT:
  519. // CHECK:STDOUT: file {
  520. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  521. // CHECK:STDOUT: .C = imports.%Main.C
  522. // CHECK:STDOUT: .D = imports.%Main.D
  523. // CHECK:STDOUT: .Foo = %Foo.decl
  524. // CHECK:STDOUT: .Bar = %Bar.decl
  525. // CHECK:STDOUT: }
  526. // CHECK:STDOUT: %default.import.loc2_24.1 = import <none>
  527. // CHECK:STDOUT: %default.import.loc2_24.2 = import <none>
  528. // CHECK:STDOUT: %Foo.decl: %Foo.type = class_decl @Foo [concrete = constants.%Foo.generic] {
  529. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  530. // CHECK:STDOUT: } {
  531. // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
  532. // CHECK:STDOUT: %a.loc4: %C = bind_symbolic_name a, 0 [symbolic = %a.1 (constants.%a)]
  533. // CHECK:STDOUT: }
  534. // CHECK:STDOUT: %Bar.decl: %Bar.type = class_decl @Bar [concrete = constants.%Bar.generic] {
  535. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  536. // CHECK:STDOUT: } {
  537. // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%Main.D [concrete = constants.%C]
  538. // CHECK:STDOUT: %a.loc5: %C = bind_symbolic_name a, 0 [symbolic = %a.1 (constants.%a)]
  539. // CHECK:STDOUT: }
  540. // CHECK:STDOUT: }
  541. // CHECK:STDOUT:
  542. // CHECK:STDOUT: class @C [from "two_file.carbon"] {
  543. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f2
  544. // CHECK:STDOUT:
  545. // CHECK:STDOUT: !members:
  546. // CHECK:STDOUT: .Self = imports.%Main.import_ref.2c4
  547. // CHECK:STDOUT: }
  548. // CHECK:STDOUT:
  549. // CHECK:STDOUT: generic class @Foo(imports.%Main.import_ref.f97b44.1: %C) {
  550. // CHECK:STDOUT: %a.1: %C = bind_symbolic_name a, 0 [symbolic = %a.1 (constants.%a)]
  551. // CHECK:STDOUT:
  552. // CHECK:STDOUT: !definition:
  553. // CHECK:STDOUT:
  554. // CHECK:STDOUT: class {
  555. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  556. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  557. // CHECK:STDOUT: complete_type_witness = %complete_type
  558. // CHECK:STDOUT:
  559. // CHECK:STDOUT: !members:
  560. // CHECK:STDOUT: .Self = constants.%Foo
  561. // CHECK:STDOUT: }
  562. // CHECK:STDOUT: }
  563. // CHECK:STDOUT:
  564. // CHECK:STDOUT: generic class @Bar(imports.%Main.import_ref.f97b44.2: %C) {
  565. // CHECK:STDOUT: %a.1: %C = bind_symbolic_name a, 0 [symbolic = %a.1 (constants.%a)]
  566. // CHECK:STDOUT:
  567. // CHECK:STDOUT: !definition:
  568. // CHECK:STDOUT:
  569. // CHECK:STDOUT: class {
  570. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  571. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  572. // CHECK:STDOUT: complete_type_witness = %complete_type
  573. // CHECK:STDOUT:
  574. // CHECK:STDOUT: !members:
  575. // CHECK:STDOUT: .Self = constants.%Bar
  576. // CHECK:STDOUT: }
  577. // CHECK:STDOUT: }
  578. // CHECK:STDOUT:
  579. // CHECK:STDOUT: specific @Foo(constants.%a) {
  580. // CHECK:STDOUT: %a.1 => constants.%a
  581. // CHECK:STDOUT: }
  582. // CHECK:STDOUT:
  583. // CHECK:STDOUT: specific @Bar(constants.%a) {
  584. // CHECK:STDOUT: %a.1 => constants.%a
  585. // CHECK:STDOUT: }
  586. // CHECK:STDOUT:
  587. // CHECK:STDOUT: --- fail_name_mismatch.carbon
  588. // CHECK:STDOUT:
  589. // CHECK:STDOUT: constants {
  590. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  591. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  592. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  593. // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic]
  594. // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
  595. // CHECK:STDOUT: %Foo.type.39e446.1: type = generic_class_type @Foo.loc7 [concrete]
  596. // CHECK:STDOUT: %Foo.generic.80461b.1: %Foo.type.39e446.1 = struct_value () [concrete]
  597. // CHECK:STDOUT: %b: %C = bind_symbolic_name b, 0 [symbolic]
  598. // CHECK:STDOUT: %Foo.type.39e446.2: type = generic_class_type @Foo.loc15 [concrete]
  599. // CHECK:STDOUT: %Foo.generic.80461b.2: %Foo.type.39e446.2 = struct_value () [concrete]
  600. // CHECK:STDOUT: %Foo.67ab7c.2: type = class_type @Foo.loc15, @Foo.loc15(%b) [symbolic]
  601. // CHECK:STDOUT: }
  602. // CHECK:STDOUT:
  603. // CHECK:STDOUT: file {
  604. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  605. // CHECK:STDOUT: .C = %C.decl
  606. // CHECK:STDOUT: .D = %D
  607. // CHECK:STDOUT: .Foo = %Foo.decl.loc7
  608. // CHECK:STDOUT: }
  609. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  610. // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C]
  611. // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [concrete = constants.%C]
  612. // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type.39e446.1 = class_decl @Foo.loc7 [concrete = constants.%Foo.generic.80461b.1] {
  613. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  614. // CHECK:STDOUT: } {
  615. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  616. // CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_11.1 (constants.%a)]
  617. // CHECK:STDOUT: }
  618. // CHECK:STDOUT: %Foo.decl.loc15: %Foo.type.39e446.2 = class_decl @Foo.loc15 [concrete = constants.%Foo.generic.80461b.2] {
  619. // CHECK:STDOUT: %b.patt: %pattern_type = symbolic_binding_pattern b, 0 [concrete]
  620. // CHECK:STDOUT: } {
  621. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [concrete = constants.%C]
  622. // CHECK:STDOUT: %b.loc15_11.2: %C = bind_symbolic_name b, 0 [symbolic = %b.loc15_11.1 (constants.%b)]
  623. // CHECK:STDOUT: }
  624. // CHECK:STDOUT: }
  625. // CHECK:STDOUT:
  626. // CHECK:STDOUT: class @C {
  627. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  628. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  629. // CHECK:STDOUT: complete_type_witness = %complete_type
  630. // CHECK:STDOUT:
  631. // CHECK:STDOUT: !members:
  632. // CHECK:STDOUT: .Self = constants.%C
  633. // CHECK:STDOUT: }
  634. // CHECK:STDOUT:
  635. // CHECK:STDOUT: generic class @Foo.loc7(%a.loc7_11.2: %C) {
  636. // CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_11.1 (constants.%a)]
  637. // CHECK:STDOUT:
  638. // CHECK:STDOUT: class;
  639. // CHECK:STDOUT: }
  640. // CHECK:STDOUT:
  641. // CHECK:STDOUT: generic class @Foo.loc15(%b.loc15_11.2: %C) {
  642. // CHECK:STDOUT: %b.loc15_11.1: %C = bind_symbolic_name b, 0 [symbolic = %b.loc15_11.1 (constants.%b)]
  643. // CHECK:STDOUT:
  644. // CHECK:STDOUT: !definition:
  645. // CHECK:STDOUT:
  646. // CHECK:STDOUT: class {
  647. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  648. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  649. // CHECK:STDOUT: complete_type_witness = %complete_type
  650. // CHECK:STDOUT:
  651. // CHECK:STDOUT: !members:
  652. // CHECK:STDOUT: .Self = constants.%Foo.67ab7c.2
  653. // CHECK:STDOUT: }
  654. // CHECK:STDOUT: }
  655. // CHECK:STDOUT:
  656. // CHECK:STDOUT: specific @Foo.loc7(constants.%a) {
  657. // CHECK:STDOUT: %a.loc7_11.1 => constants.%a
  658. // CHECK:STDOUT: }
  659. // CHECK:STDOUT:
  660. // CHECK:STDOUT: specific @Foo.loc15(constants.%b) {
  661. // CHECK:STDOUT: %b.loc15_11.1 => constants.%b
  662. // CHECK:STDOUT: }
  663. // CHECK:STDOUT:
  664. // CHECK:STDOUT: --- fail_alias.carbon
  665. // CHECK:STDOUT:
  666. // CHECK:STDOUT: constants {
  667. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  668. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  669. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  670. // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic]
  671. // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
  672. // CHECK:STDOUT: %Foo.type.39e446.1: type = generic_class_type @Foo.loc7 [concrete]
  673. // CHECK:STDOUT: %Foo.generic.80461b.1: %Foo.type.39e446.1 = struct_value () [concrete]
  674. // CHECK:STDOUT: %Foo.type.39e446.2: type = generic_class_type @Foo.loc15 [concrete]
  675. // CHECK:STDOUT: %Foo.generic.80461b.2: %Foo.type.39e446.2 = struct_value () [concrete]
  676. // CHECK:STDOUT: %Foo.67ab7c.2: type = class_type @Foo.loc15, @Foo.loc15(%a) [symbolic]
  677. // CHECK:STDOUT: }
  678. // CHECK:STDOUT:
  679. // CHECK:STDOUT: file {
  680. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  681. // CHECK:STDOUT: .C = %C.decl
  682. // CHECK:STDOUT: .D = %D
  683. // CHECK:STDOUT: .Foo = %Foo.decl.loc7
  684. // CHECK:STDOUT: }
  685. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  686. // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C]
  687. // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [concrete = constants.%C]
  688. // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type.39e446.1 = class_decl @Foo.loc7 [concrete = constants.%Foo.generic.80461b.1] {
  689. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  690. // CHECK:STDOUT: } {
  691. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  692. // CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_11.1 (constants.%a)]
  693. // CHECK:STDOUT: }
  694. // CHECK:STDOUT: %Foo.decl.loc15: %Foo.type.39e446.2 = class_decl @Foo.loc15 [concrete = constants.%Foo.generic.80461b.2] {
  695. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  696. // CHECK:STDOUT: } {
  697. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [concrete = constants.%C]
  698. // CHECK:STDOUT: %a.loc15_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc15_11.1 (constants.%a)]
  699. // CHECK:STDOUT: }
  700. // CHECK:STDOUT: }
  701. // CHECK:STDOUT:
  702. // CHECK:STDOUT: class @C {
  703. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  704. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  705. // CHECK:STDOUT: complete_type_witness = %complete_type
  706. // CHECK:STDOUT:
  707. // CHECK:STDOUT: !members:
  708. // CHECK:STDOUT: .Self = constants.%C
  709. // CHECK:STDOUT: }
  710. // CHECK:STDOUT:
  711. // CHECK:STDOUT: generic class @Foo.loc7(%a.loc7_11.2: %C) {
  712. // CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_11.1 (constants.%a)]
  713. // CHECK:STDOUT:
  714. // CHECK:STDOUT: class;
  715. // CHECK:STDOUT: }
  716. // CHECK:STDOUT:
  717. // CHECK:STDOUT: generic class @Foo.loc15(%a.loc15_11.2: %C) {
  718. // CHECK:STDOUT: %a.loc15_11.1: %C = bind_symbolic_name a, 0 [symbolic = %a.loc15_11.1 (constants.%a)]
  719. // CHECK:STDOUT:
  720. // CHECK:STDOUT: !definition:
  721. // CHECK:STDOUT:
  722. // CHECK:STDOUT: class {
  723. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  724. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  725. // CHECK:STDOUT: complete_type_witness = %complete_type
  726. // CHECK:STDOUT:
  727. // CHECK:STDOUT: !members:
  728. // CHECK:STDOUT: .Self = constants.%Foo.67ab7c.2
  729. // CHECK:STDOUT: }
  730. // CHECK:STDOUT: }
  731. // CHECK:STDOUT:
  732. // CHECK:STDOUT: specific @Foo.loc7(constants.%a) {
  733. // CHECK:STDOUT: %a.loc7_11.1 => constants.%a
  734. // CHECK:STDOUT: }
  735. // CHECK:STDOUT:
  736. // CHECK:STDOUT: specific @Foo.loc15(constants.%a) {
  737. // CHECK:STDOUT: %a.loc15_11.1 => constants.%a
  738. // CHECK:STDOUT: }
  739. // CHECK:STDOUT:
  740. // CHECK:STDOUT: --- fail_deduced_alias.carbon
  741. // CHECK:STDOUT:
  742. // CHECK:STDOUT: constants {
  743. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  744. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  745. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  746. // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic]
  747. // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
  748. // CHECK:STDOUT: %Foo.type.39e446.1: type = generic_class_type @Foo.loc7 [concrete]
  749. // CHECK:STDOUT: %Foo.generic.80461b.1: %Foo.type.39e446.1 = struct_value () [concrete]
  750. // CHECK:STDOUT: %Foo.type.39e446.2: type = generic_class_type @Foo.loc15 [concrete]
  751. // CHECK:STDOUT: %Foo.generic.80461b.2: %Foo.type.39e446.2 = struct_value () [concrete]
  752. // CHECK:STDOUT: %Foo.67ab7c.2: type = class_type @Foo.loc15, @Foo.loc15(%a) [symbolic]
  753. // CHECK:STDOUT: }
  754. // CHECK:STDOUT:
  755. // CHECK:STDOUT: file {
  756. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  757. // CHECK:STDOUT: .C = %C.decl
  758. // CHECK:STDOUT: .D = %D
  759. // CHECK:STDOUT: .Foo = %Foo.decl.loc7
  760. // CHECK:STDOUT: }
  761. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  762. // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C]
  763. // CHECK:STDOUT: %D: type = bind_alias D, %C.decl [concrete = constants.%C]
  764. // CHECK:STDOUT: %Foo.decl.loc7: %Foo.type.39e446.1 = class_decl @Foo.loc7 [concrete = constants.%Foo.generic.80461b.1] {
  765. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  766. // CHECK:STDOUT: } {
  767. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  768. // CHECK:STDOUT: %a.loc7_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_11.1 (constants.%a)]
  769. // CHECK:STDOUT: }
  770. // CHECK:STDOUT: %Foo.decl.loc15: %Foo.type.39e446.2 = class_decl @Foo.loc15 [concrete = constants.%Foo.generic.80461b.2] {
  771. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  772. // CHECK:STDOUT: } {
  773. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [concrete = constants.%C]
  774. // CHECK:STDOUT: %a.loc15_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc15_11.1 (constants.%a)]
  775. // CHECK:STDOUT: }
  776. // CHECK:STDOUT: }
  777. // CHECK:STDOUT:
  778. // CHECK:STDOUT: class @C {
  779. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  780. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  781. // CHECK:STDOUT: complete_type_witness = %complete_type
  782. // CHECK:STDOUT:
  783. // CHECK:STDOUT: !members:
  784. // CHECK:STDOUT: .Self = constants.%C
  785. // CHECK:STDOUT: }
  786. // CHECK:STDOUT:
  787. // CHECK:STDOUT: generic class @Foo.loc7(%a.loc7_11.2: %C) {
  788. // CHECK:STDOUT: %a.loc7_11.1: %C = bind_symbolic_name a, 0 [symbolic = %a.loc7_11.1 (constants.%a)]
  789. // CHECK:STDOUT:
  790. // CHECK:STDOUT: class;
  791. // CHECK:STDOUT: }
  792. // CHECK:STDOUT:
  793. // CHECK:STDOUT: generic class @Foo.loc15(%a.loc15_11.2: %C) {
  794. // CHECK:STDOUT: %a.loc15_11.1: %C = bind_symbolic_name a, 0 [symbolic = %a.loc15_11.1 (constants.%a)]
  795. // CHECK:STDOUT:
  796. // CHECK:STDOUT: !definition:
  797. // CHECK:STDOUT:
  798. // CHECK:STDOUT: class {
  799. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  800. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  801. // CHECK:STDOUT: complete_type_witness = %complete_type
  802. // CHECK:STDOUT:
  803. // CHECK:STDOUT: !members:
  804. // CHECK:STDOUT: .Self = constants.%Foo.67ab7c.2
  805. // CHECK:STDOUT: }
  806. // CHECK:STDOUT: }
  807. // CHECK:STDOUT:
  808. // CHECK:STDOUT: specific @Foo.loc7(constants.%a) {
  809. // CHECK:STDOUT: %a.loc7_11.1 => constants.%a
  810. // CHECK:STDOUT: }
  811. // CHECK:STDOUT:
  812. // CHECK:STDOUT: specific @Foo.loc15(constants.%a) {
  813. // CHECK:STDOUT: %a.loc15_11.1 => constants.%a
  814. // CHECK:STDOUT: }
  815. // CHECK:STDOUT:
  816. // CHECK:STDOUT: --- alias_two_file.carbon
  817. // CHECK:STDOUT:
  818. // CHECK:STDOUT: constants {
  819. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  820. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  821. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  822. // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic]
  823. // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
  824. // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [concrete]
  825. // CHECK:STDOUT: %Foo.generic: %Foo.type = struct_value () [concrete]
  826. // CHECK:STDOUT: }
  827. // CHECK:STDOUT:
  828. // CHECK:STDOUT: file {
  829. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  830. // CHECK:STDOUT: .C = %C.decl
  831. // CHECK:STDOUT: .Foo = %Foo.decl
  832. // CHECK:STDOUT: }
  833. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  834. // CHECK:STDOUT: %Foo.decl: %Foo.type = class_decl @Foo [concrete = constants.%Foo.generic] {
  835. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  836. // CHECK:STDOUT: } {
  837. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  838. // CHECK:STDOUT: %a.loc6_11.2: %C = bind_symbolic_name a, 0 [symbolic = %a.loc6_11.1 (constants.%a)]
  839. // CHECK:STDOUT: }
  840. // CHECK:STDOUT: }
  841. // CHECK:STDOUT:
  842. // CHECK:STDOUT: class @C {
  843. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  844. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  845. // CHECK:STDOUT: complete_type_witness = %complete_type
  846. // CHECK:STDOUT:
  847. // CHECK:STDOUT: !members:
  848. // CHECK:STDOUT: .Self = constants.%C
  849. // CHECK:STDOUT: }
  850. // CHECK:STDOUT:
  851. // CHECK:STDOUT: generic class @Foo(%a.loc6_11.2: %C) {
  852. // CHECK:STDOUT: %a.loc6_11.1: %C = bind_symbolic_name a, 0 [symbolic = %a.loc6_11.1 (constants.%a)]
  853. // CHECK:STDOUT:
  854. // CHECK:STDOUT: class;
  855. // CHECK:STDOUT: }
  856. // CHECK:STDOUT:
  857. // CHECK:STDOUT: specific @Foo(constants.%a) {
  858. // CHECK:STDOUT: %a.loc6_11.1 => constants.%a
  859. // CHECK:STDOUT: }
  860. // CHECK:STDOUT:
  861. // CHECK:STDOUT: --- todo_fail_alias_two_file.impl.carbon
  862. // CHECK:STDOUT:
  863. // CHECK:STDOUT: constants {
  864. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  865. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  866. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  867. // CHECK:STDOUT: %a: %C = bind_symbolic_name a, 0 [symbolic]
  868. // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
  869. // CHECK:STDOUT: %Foo.type: type = generic_class_type @Foo [concrete]
  870. // CHECK:STDOUT: %Foo.generic: %Foo.type = struct_value () [concrete]
  871. // CHECK:STDOUT: %Foo: type = class_type @Foo, @Foo(%a) [symbolic]
  872. // CHECK:STDOUT: }
  873. // CHECK:STDOUT:
  874. // CHECK:STDOUT: imports {
  875. // CHECK:STDOUT: %Main.C: type = import_ref Main//alias_two_file, C, loaded [concrete = constants.%C]
  876. // CHECK:STDOUT: %Main.import_ref.8f2: <witness> = import_ref Main//alias_two_file, loc4_10, loaded [concrete = constants.%complete_type]
  877. // CHECK:STDOUT: %Main.import_ref.2c4 = import_ref Main//alias_two_file, inst16 [no loc], unloaded
  878. // CHECK:STDOUT: %Main.import_ref.f97: %C = import_ref Main//alias_two_file, loc6_11, loaded [symbolic = @Foo.%a.1 (constants.%a)]
  879. // CHECK:STDOUT: }
  880. // CHECK:STDOUT:
  881. // CHECK:STDOUT: file {
  882. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  883. // CHECK:STDOUT: .C = imports.%Main.C
  884. // CHECK:STDOUT: .Foo = %Foo.decl
  885. // CHECK:STDOUT: .D = %D
  886. // CHECK:STDOUT: }
  887. // CHECK:STDOUT: %default.import.loc2_30.1 = import <none>
  888. // CHECK:STDOUT: %default.import.loc2_30.2 = import <none>
  889. // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
  890. // CHECK:STDOUT: %D: type = bind_alias D, imports.%Main.C [concrete = constants.%C]
  891. // CHECK:STDOUT: %Foo.decl: %Foo.type = class_decl @Foo [concrete = constants.%Foo.generic] {
  892. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  893. // CHECK:STDOUT: } {
  894. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [concrete = constants.%C]
  895. // CHECK:STDOUT: %a.loc6: %C = bind_symbolic_name a, 0 [symbolic = %a.1 (constants.%a)]
  896. // CHECK:STDOUT: }
  897. // CHECK:STDOUT: }
  898. // CHECK:STDOUT:
  899. // CHECK:STDOUT: class @C [from "alias_two_file.carbon"] {
  900. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f2
  901. // CHECK:STDOUT:
  902. // CHECK:STDOUT: !members:
  903. // CHECK:STDOUT: .Self = imports.%Main.import_ref.2c4
  904. // CHECK:STDOUT: }
  905. // CHECK:STDOUT:
  906. // CHECK:STDOUT: generic class @Foo(imports.%Main.import_ref.f97: %C) {
  907. // CHECK:STDOUT: %a.1: %C = bind_symbolic_name a, 0 [symbolic = %a.1 (constants.%a)]
  908. // CHECK:STDOUT:
  909. // CHECK:STDOUT: !definition:
  910. // CHECK:STDOUT:
  911. // CHECK:STDOUT: class {
  912. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  913. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  914. // CHECK:STDOUT: complete_type_witness = %complete_type
  915. // CHECK:STDOUT:
  916. // CHECK:STDOUT: !members:
  917. // CHECK:STDOUT: .Self = constants.%Foo
  918. // CHECK:STDOUT: }
  919. // CHECK:STDOUT: }
  920. // CHECK:STDOUT:
  921. // CHECK:STDOUT: specific @Foo(constants.%a) {
  922. // CHECK:STDOUT: %a.1 => constants.%a
  923. // CHECK:STDOUT: }
  924. // CHECK:STDOUT:
  925. // CHECK:STDOUT: --- fail_repeat_const.carbon
  926. // CHECK:STDOUT:
  927. // CHECK:STDOUT: constants {
  928. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  929. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  930. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  931. // CHECK:STDOUT: %const: type = const_type %C [concrete]
  932. // CHECK:STDOUT: %a: %const = bind_symbolic_name a, 0 [symbolic]
  933. // CHECK:STDOUT: %pattern_type: type = pattern_type %const [concrete]
  934. // CHECK:STDOUT: %Foo.type.39e446.1: type = generic_class_type @Foo.loc6 [concrete]
  935. // CHECK:STDOUT: %Foo.generic.80461b.1: %Foo.type.39e446.1 = struct_value () [concrete]
  936. // CHECK:STDOUT: %Foo.type.39e446.2: type = generic_class_type @Foo.loc18 [concrete]
  937. // CHECK:STDOUT: %Foo.generic.80461b.2: %Foo.type.39e446.2 = struct_value () [concrete]
  938. // CHECK:STDOUT: %Foo.1a4f0e.2: type = class_type @Foo.loc18, @Foo.loc18(%a) [symbolic]
  939. // CHECK:STDOUT: }
  940. // CHECK:STDOUT:
  941. // CHECK:STDOUT: file {
  942. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  943. // CHECK:STDOUT: .C = %C.decl
  944. // CHECK:STDOUT: .Foo = %Foo.decl.loc6
  945. // CHECK:STDOUT: }
  946. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  947. // CHECK:STDOUT: %Foo.decl.loc6: %Foo.type.39e446.1 = class_decl @Foo.loc6 [concrete = constants.%Foo.generic.80461b.1] {
  948. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  949. // CHECK:STDOUT: } {
  950. // CHECK:STDOUT: %.loc6: type = splice_block %const [concrete = constants.%const] {
  951. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  952. // CHECK:STDOUT: %const: type = const_type %C.ref [concrete = constants.%const]
  953. // CHECK:STDOUT: }
  954. // CHECK:STDOUT: %a.loc6_11.2: %const = bind_symbolic_name a, 0 [symbolic = %a.loc6_11.1 (constants.%a)]
  955. // CHECK:STDOUT: }
  956. // CHECK:STDOUT: %Foo.decl.loc18: %Foo.type.39e446.2 = class_decl @Foo.loc18 [concrete = constants.%Foo.generic.80461b.2] {
  957. // CHECK:STDOUT: %a.patt: %pattern_type = symbolic_binding_pattern a, 0 [concrete]
  958. // CHECK:STDOUT: } {
  959. // CHECK:STDOUT: %.loc18: type = splice_block %const.loc18_15 [concrete = constants.%const] {
  960. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  961. // CHECK:STDOUT: %const.loc18_22: type = const_type %C.ref [concrete = constants.%const]
  962. // CHECK:STDOUT: %const.loc18_15: type = const_type %const.loc18_22 [concrete = constants.%const]
  963. // CHECK:STDOUT: }
  964. // CHECK:STDOUT: %a.loc18_11.2: %const = bind_symbolic_name a, 0 [symbolic = %a.loc18_11.1 (constants.%a)]
  965. // CHECK:STDOUT: }
  966. // CHECK:STDOUT: }
  967. // CHECK:STDOUT:
  968. // CHECK:STDOUT: class @C {
  969. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  970. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  971. // CHECK:STDOUT: complete_type_witness = %complete_type
  972. // CHECK:STDOUT:
  973. // CHECK:STDOUT: !members:
  974. // CHECK:STDOUT: .Self = constants.%C
  975. // CHECK:STDOUT: }
  976. // CHECK:STDOUT:
  977. // CHECK:STDOUT: generic class @Foo.loc6(%a.loc6_11.2: %const) {
  978. // CHECK:STDOUT: %a.loc6_11.1: %const = bind_symbolic_name a, 0 [symbolic = %a.loc6_11.1 (constants.%a)]
  979. // CHECK:STDOUT:
  980. // CHECK:STDOUT: class;
  981. // CHECK:STDOUT: }
  982. // CHECK:STDOUT:
  983. // CHECK:STDOUT: generic class @Foo.loc18(%a.loc18_11.2: %const) {
  984. // CHECK:STDOUT: %a.loc18_11.1: %const = bind_symbolic_name a, 0 [symbolic = %a.loc18_11.1 (constants.%a)]
  985. // CHECK:STDOUT:
  986. // CHECK:STDOUT: !definition:
  987. // CHECK:STDOUT:
  988. // CHECK:STDOUT: class {
  989. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  990. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  991. // CHECK:STDOUT: complete_type_witness = %complete_type
  992. // CHECK:STDOUT:
  993. // CHECK:STDOUT: !members:
  994. // CHECK:STDOUT: .Self = constants.%Foo.1a4f0e.2
  995. // CHECK:STDOUT: }
  996. // CHECK:STDOUT: }
  997. // CHECK:STDOUT:
  998. // CHECK:STDOUT: specific @Foo.loc6(constants.%a) {
  999. // CHECK:STDOUT: %a.loc6_11.1 => constants.%a
  1000. // CHECK:STDOUT: }
  1001. // CHECK:STDOUT:
  1002. // CHECK:STDOUT: specific @Foo.loc18(constants.%a) {
  1003. // CHECK:STDOUT: %a.loc18_11.1 => constants.%a
  1004. // CHECK:STDOUT: }
  1005. // CHECK:STDOUT:
  1006. // CHECK:STDOUT: --- fail_self_type.carbon
  1007. // CHECK:STDOUT:
  1008. // CHECK:STDOUT: constants {
  1009. // CHECK:STDOUT: %Base: type = class_type @Base [concrete]
  1010. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1011. // CHECK:STDOUT: %Base.elem: type = unbound_element_type %Base, %empty_tuple.type [concrete]
  1012. // CHECK:STDOUT: %ptr.11f: type = ptr_type %Base [concrete]
  1013. // CHECK:STDOUT: %pattern_type.1b9: type = pattern_type %ptr.11f [concrete]
  1014. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  1015. // CHECK:STDOUT: %F.type.7c6384.1: type = fn_type @F.loc7 [concrete]
  1016. // CHECK:STDOUT: %F.d17bbc.1: %F.type.7c6384.1 = struct_value () [concrete]
  1017. // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_tuple.type} [concrete]
  1018. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.a [concrete]
  1019. // CHECK:STDOUT: %F.type.7c6384.2: type = fn_type @F.loc17 [concrete]
  1020. // CHECK:STDOUT: %F.d17bbc.2: %F.type.7c6384.2 = struct_value () [concrete]
  1021. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  1022. // CHECK:STDOUT: }
  1023. // CHECK:STDOUT:
  1024. // CHECK:STDOUT: file {
  1025. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1026. // CHECK:STDOUT: .Base = %Base.decl
  1027. // CHECK:STDOUT: }
  1028. // CHECK:STDOUT: %Base.decl: type = class_decl @Base [concrete = constants.%Base] {} {}
  1029. // CHECK:STDOUT: %F.decl: %F.type.7c6384.2 = fn_decl @F.loc17 [concrete = constants.%F.d17bbc.2] {
  1030. // CHECK:STDOUT: %self.patt: %pattern_type.1b9 = binding_pattern self [concrete]
  1031. // CHECK:STDOUT: %self.param_patt: %pattern_type.1b9 = value_param_pattern %self.patt, call_param0 [concrete]
  1032. // CHECK:STDOUT: %.loc17_11: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  1033. // CHECK:STDOUT: } {
  1034. // CHECK:STDOUT: %self.param: %ptr.11f = value_param call_param0
  1035. // CHECK:STDOUT: %.loc17_26: type = splice_block %ptr [concrete = constants.%ptr.11f] {
  1036. // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [concrete = constants.%Base]
  1037. // CHECK:STDOUT: %ptr: type = ptr_type %Base.ref [concrete = constants.%ptr.11f]
  1038. // CHECK:STDOUT: }
  1039. // CHECK:STDOUT: %self: %ptr.11f = bind_name self, %self.param
  1040. // CHECK:STDOUT: }
  1041. // CHECK:STDOUT: }
  1042. // CHECK:STDOUT:
  1043. // CHECK:STDOUT: class @Base {
  1044. // CHECK:STDOUT: %.loc5_11.1: %empty_tuple.type = tuple_literal ()
  1045. // CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  1046. // CHECK:STDOUT: %.loc5_8: %Base.elem = field_decl a, element0 [concrete]
  1047. // CHECK:STDOUT: %F.decl: %F.type.7c6384.1 = fn_decl @F.loc7 [concrete = constants.%F.d17bbc.1] {
  1048. // CHECK:STDOUT: %self.patt: %pattern_type.1b9 = binding_pattern self [concrete]
  1049. // CHECK:STDOUT: %self.param_patt: %pattern_type.1b9 = value_param_pattern %self.patt, call_param0 [concrete]
  1050. // CHECK:STDOUT: %.loc7_8: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  1051. // CHECK:STDOUT: } {
  1052. // CHECK:STDOUT: %self.param: %ptr.11f = value_param call_param0
  1053. // CHECK:STDOUT: %.loc7_23: type = splice_block %ptr [concrete = constants.%ptr.11f] {
  1054. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [concrete = constants.%Base]
  1055. // CHECK:STDOUT: %ptr: type = ptr_type %Self.ref [concrete = constants.%ptr.11f]
  1056. // CHECK:STDOUT: }
  1057. // CHECK:STDOUT: %self: %ptr.11f = bind_name self, %self.param
  1058. // CHECK:STDOUT: }
  1059. // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_tuple.type} [concrete = constants.%struct_type.a]
  1060. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.a [concrete = constants.%complete_type]
  1061. // CHECK:STDOUT: complete_type_witness = %complete_type
  1062. // CHECK:STDOUT:
  1063. // CHECK:STDOUT: !members:
  1064. // CHECK:STDOUT: .Self = constants.%Base
  1065. // CHECK:STDOUT: .a = %.loc5_8
  1066. // CHECK:STDOUT: .F = %F.decl
  1067. // CHECK:STDOUT: .Base = <poisoned>
  1068. // CHECK:STDOUT: }
  1069. // CHECK:STDOUT:
  1070. // CHECK:STDOUT: fn @F.loc7(%self.param: %ptr.11f);
  1071. // CHECK:STDOUT:
  1072. // CHECK:STDOUT: fn @F.loc17(%self.param: %ptr.11f) {
  1073. // CHECK:STDOUT: !entry:
  1074. // CHECK:STDOUT: %self.ref: %ptr.11f = name_ref self, %self
  1075. // CHECK:STDOUT: %.loc18_4: ref %Base = deref %self.ref
  1076. // CHECK:STDOUT: %a.ref: %Base.elem = name_ref a, @Base.%.loc5_8 [concrete = @Base.%.loc5_8]
  1077. // CHECK:STDOUT: %.loc18_10: ref %empty_tuple.type = class_element_access %.loc18_4, element0
  1078. // CHECK:STDOUT: %.loc18_16.1: %empty_tuple.type = tuple_literal ()
  1079. // CHECK:STDOUT: %.loc18_16.2: init %empty_tuple.type = tuple_init () to %.loc18_10 [concrete = constants.%empty_tuple]
  1080. // CHECK:STDOUT: %.loc18_13: init %empty_tuple.type = converted %.loc18_16.1, %.loc18_16.2 [concrete = constants.%empty_tuple]
  1081. // CHECK:STDOUT: assign %.loc18_10, %.loc18_13
  1082. // CHECK:STDOUT: return
  1083. // CHECK:STDOUT: }
  1084. // CHECK:STDOUT: