syntactic_merge.carbon 59 KB

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