syntactic_merge.carbon 55 KB

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