syntactic_merge.carbon 59 KB

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