syntactic_merge.carbon 55 KB

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