syntactic_merge.carbon 50 KB

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