tuple_pattern.carbon 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  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. // INCLUDE-FILE: toolchain/testing/min_prelude/destroy.carbon
  6. // EXTRA-ARGS: --custom-core
  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/tuple/min_prelude/tuple_pattern.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/min_prelude/tuple_pattern.carbon
  13. // --- basic.carbon
  14. library "[[@TEST_NAME]]";
  15. fn F() {
  16. let (x: {}, y: {}) = ({}, {});
  17. var (a: {}, b: {});
  18. var (c: {}, d: {}) = ({}, {});
  19. }
  20. // --- variable.carbon
  21. library "[[@TEST_NAME]]";
  22. fn F() {
  23. var tuple: ({}, {}) = ({}, {});
  24. var (x: {}, y: {}) = tuple;
  25. }
  26. fn G() {
  27. let tuple: ({}, {}) = ({}, {});
  28. var (x: {}, y: {}) = tuple;
  29. }
  30. fn MakeTuple() -> ({}, {});
  31. fn H() {
  32. var (x: {}, y: {}) = MakeTuple();
  33. }
  34. // --- nested.carbon
  35. library "[[@TEST_NAME]]";
  36. fn F() {
  37. let (x: {}, (y: {}, z: {})) = ({}, ({}, {}));
  38. }
  39. // --- package_scope.carbon
  40. library "[[@TEST_NAME]]";
  41. let (x: {}, y: {}) = ({}, {});
  42. // --- fail_in_interface.carbon
  43. library "[[@TEST_NAME]]";
  44. interface I {
  45. // CHECK:STDERR: fail_in_interface.carbon:[[@LINE+4]]:7: error: pattern in associated constant declaration must be a single `:!` binding [ExpectedSymbolicBindingInAssociatedConstant]
  46. // CHECK:STDERR: let (x: {}, y: {});
  47. // CHECK:STDERR: ^~~~~~~~~~~~~~
  48. // CHECK:STDERR:
  49. let (x: {}, y: {});
  50. }
  51. // --- fail_in_class.carbon
  52. library "[[@TEST_NAME]]";
  53. class C {
  54. // CHECK:STDERR: fail_in_class.carbon:[[@LINE+8]]:7: error: expected identifier in field declaration [ExpectedFieldIdentifier]
  55. // CHECK:STDERR: var (x: {}, y: {});
  56. // CHECK:STDERR: ^
  57. // CHECK:STDERR:
  58. // CHECK:STDERR: fail_in_class.carbon:[[@LINE+4]]:3: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
  59. // CHECK:STDERR: var (x: {}, y: {});
  60. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
  61. // CHECK:STDERR:
  62. var (x: {}, y: {});
  63. }
  64. // --- fail_initializer_mismatch.carbon
  65. library "[[@TEST_NAME]]";
  66. // CHECK:STDERR: fail_initializer_mismatch.carbon:[[@LINE+4]]:5: error: tuple pattern expects 2 elements, but tuple literal has 1 [TuplePatternSizeDoesntMatchLiteral]
  67. // CHECK:STDERR: let (x: {}, y: {}) = ({},);
  68. // CHECK:STDERR: ^~~~~~~~~~~~~~
  69. // CHECK:STDERR:
  70. let (x: {}, y: {}) = ({},);
  71. // CHECK:STDERR: fail_initializer_mismatch.carbon:[[@LINE+4]]:5: error: tuple pattern expects 2 elements, but tuple literal has 3 [TuplePatternSizeDoesntMatchLiteral]
  72. // CHECK:STDERR: let (a: {}, b: {}) = ({}, {}, {});
  73. // CHECK:STDERR: ^~~~~~~~~~~~~~
  74. // CHECK:STDERR:
  75. let (a: {}, b: {}) = ({}, {}, {});
  76. // CHECK:STDOUT: --- basic.carbon
  77. // CHECK:STDOUT:
  78. // CHECK:STDOUT: constants {
  79. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  80. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  81. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  82. // CHECK:STDOUT: %tuple.type.b6b: type = tuple_type (%empty_struct_type, %empty_struct_type) [concrete]
  83. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  84. // CHECK:STDOUT: %tuple: %tuple.type.b6b = tuple_value (%empty_struct, %empty_struct) [concrete]
  85. // CHECK:STDOUT: }
  86. // CHECK:STDOUT:
  87. // CHECK:STDOUT: imports {
  88. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  89. // CHECK:STDOUT: import Core//prelude
  90. // CHECK:STDOUT: }
  91. // CHECK:STDOUT: }
  92. // CHECK:STDOUT:
  93. // CHECK:STDOUT: file {
  94. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  95. // CHECK:STDOUT: .Core = imports.%Core
  96. // CHECK:STDOUT: .F = %F.decl
  97. // CHECK:STDOUT: }
  98. // CHECK:STDOUT: %Core.import = import Core
  99. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  100. // CHECK:STDOUT: }
  101. // CHECK:STDOUT:
  102. // CHECK:STDOUT: fn @F() {
  103. // CHECK:STDOUT: !entry:
  104. // CHECK:STDOUT: name_binding_decl {
  105. // CHECK:STDOUT: %x.patt: %empty_struct_type = binding_pattern x
  106. // CHECK:STDOUT: %y.patt: %empty_struct_type = binding_pattern y
  107. // CHECK:STDOUT: %.loc5_20: %tuple.type.b6b = tuple_pattern (%x.patt, %y.patt)
  108. // CHECK:STDOUT: }
  109. // CHECK:STDOUT: %.loc5_26.1: %empty_struct_type = struct_literal ()
  110. // CHECK:STDOUT: %.loc5_30.1: %empty_struct_type = struct_literal ()
  111. // CHECK:STDOUT: %.loc5_31: %tuple.type.b6b = tuple_literal (%.loc5_26.1, %.loc5_30.1)
  112. // CHECK:STDOUT: %.loc5_12.1: type = splice_block %.loc5_12.3 [concrete = constants.%empty_struct_type] {
  113. // CHECK:STDOUT: %.loc5_12.2: %empty_struct_type = struct_literal ()
  114. // CHECK:STDOUT: %.loc5_12.3: type = converted %.loc5_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  115. // CHECK:STDOUT: }
  116. // CHECK:STDOUT: %empty_struct.loc5_26: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
  117. // CHECK:STDOUT: %.loc5_26.2: %empty_struct_type = converted %.loc5_26.1, %empty_struct.loc5_26 [concrete = constants.%empty_struct]
  118. // CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %.loc5_26.2
  119. // CHECK:STDOUT: %.loc5_19.1: type = splice_block %.loc5_19.3 [concrete = constants.%empty_struct_type] {
  120. // CHECK:STDOUT: %.loc5_19.2: %empty_struct_type = struct_literal ()
  121. // CHECK:STDOUT: %.loc5_19.3: type = converted %.loc5_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  122. // CHECK:STDOUT: }
  123. // CHECK:STDOUT: %empty_struct.loc5_30: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
  124. // CHECK:STDOUT: %.loc5_30.2: %empty_struct_type = converted %.loc5_30.1, %empty_struct.loc5_30 [concrete = constants.%empty_struct]
  125. // CHECK:STDOUT: %y: %empty_struct_type = bind_name y, %.loc5_30.2
  126. // CHECK:STDOUT: name_binding_decl {
  127. // CHECK:STDOUT: %a.patt: %empty_struct_type = binding_pattern a
  128. // CHECK:STDOUT: %b.patt: %empty_struct_type = binding_pattern b
  129. // CHECK:STDOUT: %.loc6_20: %tuple.type.b6b = tuple_pattern (%a.patt, %b.patt)
  130. // CHECK:STDOUT: %.loc6_3: %tuple.type.b6b = var_pattern %.loc6_20
  131. // CHECK:STDOUT: }
  132. // CHECK:STDOUT: %.var.loc6: ref %tuple.type.b6b = var <none>
  133. // CHECK:STDOUT: %tuple.elem0.loc6: ref %empty_struct_type = tuple_access %.var.loc6, element0
  134. // CHECK:STDOUT: %tuple.elem1.loc6: ref %empty_struct_type = tuple_access %.var.loc6, element1
  135. // CHECK:STDOUT: %.loc6_12.1: type = splice_block %.loc6_12.3 [concrete = constants.%empty_struct_type] {
  136. // CHECK:STDOUT: %.loc6_12.2: %empty_struct_type = struct_literal ()
  137. // CHECK:STDOUT: %.loc6_12.3: type = converted %.loc6_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  138. // CHECK:STDOUT: }
  139. // CHECK:STDOUT: %a: ref %empty_struct_type = bind_name a, %tuple.elem0.loc6
  140. // CHECK:STDOUT: %.loc6_19.1: type = splice_block %.loc6_19.3 [concrete = constants.%empty_struct_type] {
  141. // CHECK:STDOUT: %.loc6_19.2: %empty_struct_type = struct_literal ()
  142. // CHECK:STDOUT: %.loc6_19.3: type = converted %.loc6_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  143. // CHECK:STDOUT: }
  144. // CHECK:STDOUT: %b: ref %empty_struct_type = bind_name b, %tuple.elem1.loc6
  145. // CHECK:STDOUT: name_binding_decl {
  146. // CHECK:STDOUT: %c.patt: %empty_struct_type = binding_pattern c
  147. // CHECK:STDOUT: %d.patt: %empty_struct_type = binding_pattern d
  148. // CHECK:STDOUT: %.loc7_20: %tuple.type.b6b = tuple_pattern (%c.patt, %d.patt)
  149. // CHECK:STDOUT: %.loc7_3.1: %tuple.type.b6b = var_pattern %.loc7_20
  150. // CHECK:STDOUT: }
  151. // CHECK:STDOUT: %.var.loc7: ref %tuple.type.b6b = var <none>
  152. // CHECK:STDOUT: %.loc7_26.1: %empty_struct_type = struct_literal ()
  153. // CHECK:STDOUT: %.loc7_30.1: %empty_struct_type = struct_literal ()
  154. // CHECK:STDOUT: %.loc7_31.1: %tuple.type.b6b = tuple_literal (%.loc7_26.1, %.loc7_30.1)
  155. // CHECK:STDOUT: %tuple.elem0.loc7_31: ref %empty_struct_type = tuple_access %.var.loc7, element0
  156. // CHECK:STDOUT: %.loc7_26.2: init %empty_struct_type = struct_init () to %tuple.elem0.loc7_31 [concrete = constants.%empty_struct]
  157. // CHECK:STDOUT: %.loc7_31.2: init %empty_struct_type = converted %.loc7_26.1, %.loc7_26.2 [concrete = constants.%empty_struct]
  158. // CHECK:STDOUT: %tuple.elem1.loc7_31: ref %empty_struct_type = tuple_access %.var.loc7, element1
  159. // CHECK:STDOUT: %.loc7_30.2: init %empty_struct_type = struct_init () to %tuple.elem1.loc7_31 [concrete = constants.%empty_struct]
  160. // CHECK:STDOUT: %.loc7_31.3: init %empty_struct_type = converted %.loc7_30.1, %.loc7_30.2 [concrete = constants.%empty_struct]
  161. // CHECK:STDOUT: %.loc7_31.4: init %tuple.type.b6b = tuple_init (%.loc7_31.2, %.loc7_31.3) to %.var.loc7 [concrete = constants.%tuple]
  162. // CHECK:STDOUT: %.loc7_3.2: init %tuple.type.b6b = converted %.loc7_31.1, %.loc7_31.4 [concrete = constants.%tuple]
  163. // CHECK:STDOUT: assign %.var.loc7, %.loc7_3.2
  164. // CHECK:STDOUT: %tuple.elem0.loc7_3: ref %empty_struct_type = tuple_access %.var.loc7, element0
  165. // CHECK:STDOUT: %tuple.elem1.loc7_3: ref %empty_struct_type = tuple_access %.var.loc7, element1
  166. // CHECK:STDOUT: %.loc7_12.1: type = splice_block %.loc7_12.3 [concrete = constants.%empty_struct_type] {
  167. // CHECK:STDOUT: %.loc7_12.2: %empty_struct_type = struct_literal ()
  168. // CHECK:STDOUT: %.loc7_12.3: type = converted %.loc7_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  169. // CHECK:STDOUT: }
  170. // CHECK:STDOUT: %c: ref %empty_struct_type = bind_name c, %tuple.elem0.loc7_3
  171. // CHECK:STDOUT: %.loc7_19.1: type = splice_block %.loc7_19.3 [concrete = constants.%empty_struct_type] {
  172. // CHECK:STDOUT: %.loc7_19.2: %empty_struct_type = struct_literal ()
  173. // CHECK:STDOUT: %.loc7_19.3: type = converted %.loc7_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  174. // CHECK:STDOUT: }
  175. // CHECK:STDOUT: %d: ref %empty_struct_type = bind_name d, %tuple.elem1.loc7_3
  176. // CHECK:STDOUT: return
  177. // CHECK:STDOUT: }
  178. // CHECK:STDOUT:
  179. // CHECK:STDOUT: --- variable.carbon
  180. // CHECK:STDOUT:
  181. // CHECK:STDOUT: constants {
  182. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  183. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  184. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  185. // CHECK:STDOUT: %tuple.type.b6b: type = tuple_type (%empty_struct_type, %empty_struct_type) [concrete]
  186. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  187. // CHECK:STDOUT: %tuple: %tuple.type.b6b = tuple_value (%empty_struct, %empty_struct) [concrete]
  188. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  189. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  190. // CHECK:STDOUT: %MakeTuple.type: type = fn_type @MakeTuple [concrete]
  191. // CHECK:STDOUT: %MakeTuple: %MakeTuple.type = struct_value () [concrete]
  192. // CHECK:STDOUT: %H.type: type = fn_type @H [concrete]
  193. // CHECK:STDOUT: %H: %H.type = struct_value () [concrete]
  194. // CHECK:STDOUT: }
  195. // CHECK:STDOUT:
  196. // CHECK:STDOUT: imports {
  197. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  198. // CHECK:STDOUT: import Core//prelude
  199. // CHECK:STDOUT: }
  200. // CHECK:STDOUT: }
  201. // CHECK:STDOUT:
  202. // CHECK:STDOUT: file {
  203. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  204. // CHECK:STDOUT: .Core = imports.%Core
  205. // CHECK:STDOUT: .F = %F.decl
  206. // CHECK:STDOUT: .G = %G.decl
  207. // CHECK:STDOUT: .MakeTuple = %MakeTuple.decl
  208. // CHECK:STDOUT: .H = %H.decl
  209. // CHECK:STDOUT: }
  210. // CHECK:STDOUT: %Core.import = import Core
  211. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  212. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {}
  213. // CHECK:STDOUT: %MakeTuple.decl: %MakeTuple.type = fn_decl @MakeTuple [concrete = constants.%MakeTuple] {
  214. // CHECK:STDOUT: %return.patt: %tuple.type.b6b = return_slot_pattern
  215. // CHECK:STDOUT: %return.param_patt: %tuple.type.b6b = out_param_pattern %return.patt, call_param0
  216. // CHECK:STDOUT: } {
  217. // CHECK:STDOUT: %.loc14_21: %empty_struct_type = struct_literal ()
  218. // CHECK:STDOUT: %.loc14_25: %empty_struct_type = struct_literal ()
  219. // CHECK:STDOUT: %.loc14_26.1: %tuple.type.b6b = tuple_literal (%.loc14_21, %.loc14_25)
  220. // CHECK:STDOUT: %.loc14_26.2: type = converted %.loc14_21, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  221. // CHECK:STDOUT: %.loc14_26.3: type = converted %.loc14_25, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  222. // CHECK:STDOUT: %.loc14_26.4: type = converted %.loc14_26.1, constants.%tuple.type.b6b [concrete = constants.%tuple.type.b6b]
  223. // CHECK:STDOUT: %return.param: ref %tuple.type.b6b = out_param call_param0
  224. // CHECK:STDOUT: %return: ref %tuple.type.b6b = return_slot %return.param
  225. // CHECK:STDOUT: }
  226. // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [concrete = constants.%H] {} {}
  227. // CHECK:STDOUT: }
  228. // CHECK:STDOUT:
  229. // CHECK:STDOUT: fn @F() {
  230. // CHECK:STDOUT: !entry:
  231. // CHECK:STDOUT: name_binding_decl {
  232. // CHECK:STDOUT: %tuple.patt: %tuple.type.b6b = binding_pattern tuple
  233. // CHECK:STDOUT: %.loc5_3.1: %tuple.type.b6b = var_pattern %tuple.patt
  234. // CHECK:STDOUT: }
  235. // CHECK:STDOUT: %tuple.var: ref %tuple.type.b6b = var tuple
  236. // CHECK:STDOUT: %.loc5_27.1: %empty_struct_type = struct_literal ()
  237. // CHECK:STDOUT: %.loc5_31.1: %empty_struct_type = struct_literal ()
  238. // CHECK:STDOUT: %.loc5_32.1: %tuple.type.b6b = tuple_literal (%.loc5_27.1, %.loc5_31.1)
  239. // CHECK:STDOUT: %tuple.elem0.loc5: ref %empty_struct_type = tuple_access %tuple.var, element0
  240. // CHECK:STDOUT: %.loc5_27.2: init %empty_struct_type = struct_init () to %tuple.elem0.loc5 [concrete = constants.%empty_struct]
  241. // CHECK:STDOUT: %.loc5_32.2: init %empty_struct_type = converted %.loc5_27.1, %.loc5_27.2 [concrete = constants.%empty_struct]
  242. // CHECK:STDOUT: %tuple.elem1.loc5: ref %empty_struct_type = tuple_access %tuple.var, element1
  243. // CHECK:STDOUT: %.loc5_31.2: init %empty_struct_type = struct_init () to %tuple.elem1.loc5 [concrete = constants.%empty_struct]
  244. // CHECK:STDOUT: %.loc5_32.3: init %empty_struct_type = converted %.loc5_31.1, %.loc5_31.2 [concrete = constants.%empty_struct]
  245. // CHECK:STDOUT: %.loc5_32.4: init %tuple.type.b6b = tuple_init (%.loc5_32.2, %.loc5_32.3) to %tuple.var [concrete = constants.%tuple]
  246. // CHECK:STDOUT: %.loc5_3.2: init %tuple.type.b6b = converted %.loc5_32.1, %.loc5_32.4 [concrete = constants.%tuple]
  247. // CHECK:STDOUT: assign %tuple.var, %.loc5_3.2
  248. // CHECK:STDOUT: %.loc5_21.1: type = splice_block %.loc5_21.5 [concrete = constants.%tuple.type.b6b] {
  249. // CHECK:STDOUT: %.loc5_16: %empty_struct_type = struct_literal ()
  250. // CHECK:STDOUT: %.loc5_20: %empty_struct_type = struct_literal ()
  251. // CHECK:STDOUT: %.loc5_21.2: %tuple.type.b6b = tuple_literal (%.loc5_16, %.loc5_20)
  252. // CHECK:STDOUT: %.loc5_21.3: type = converted %.loc5_16, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  253. // CHECK:STDOUT: %.loc5_21.4: type = converted %.loc5_20, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  254. // CHECK:STDOUT: %.loc5_21.5: type = converted %.loc5_21.2, constants.%tuple.type.b6b [concrete = constants.%tuple.type.b6b]
  255. // CHECK:STDOUT: }
  256. // CHECK:STDOUT: %tuple: ref %tuple.type.b6b = bind_name tuple, %tuple.var
  257. // CHECK:STDOUT: name_binding_decl {
  258. // CHECK:STDOUT: %x.patt: %empty_struct_type = binding_pattern x
  259. // CHECK:STDOUT: %y.patt: %empty_struct_type = binding_pattern y
  260. // CHECK:STDOUT: %.loc6_20: %tuple.type.b6b = tuple_pattern (%x.patt, %y.patt)
  261. // CHECK:STDOUT: %.loc6_3.1: %tuple.type.b6b = var_pattern %.loc6_20
  262. // CHECK:STDOUT: }
  263. // CHECK:STDOUT: %.var: ref %tuple.type.b6b = var <none>
  264. // CHECK:STDOUT: %tuple.ref: ref %tuple.type.b6b = name_ref tuple, %tuple
  265. // CHECK:STDOUT: %tuple.elem0.loc6_24.1: ref %empty_struct_type = tuple_access %tuple.ref, element0
  266. // CHECK:STDOUT: %tuple.elem0.loc6_24.2: ref %empty_struct_type = tuple_access %.var, element0
  267. // CHECK:STDOUT: %.loc6_24.1: init %empty_struct_type = struct_init () to %tuple.elem0.loc6_24.2 [concrete = constants.%empty_struct]
  268. // CHECK:STDOUT: %.loc6_24.2: init %empty_struct_type = converted %tuple.elem0.loc6_24.1, %.loc6_24.1 [concrete = constants.%empty_struct]
  269. // CHECK:STDOUT: %tuple.elem1.loc6_24.1: ref %empty_struct_type = tuple_access %tuple.ref, element1
  270. // CHECK:STDOUT: %tuple.elem1.loc6_24.2: ref %empty_struct_type = tuple_access %.var, element1
  271. // CHECK:STDOUT: %.loc6_24.3: init %empty_struct_type = struct_init () to %tuple.elem1.loc6_24.2 [concrete = constants.%empty_struct]
  272. // CHECK:STDOUT: %.loc6_24.4: init %empty_struct_type = converted %tuple.elem1.loc6_24.1, %.loc6_24.3 [concrete = constants.%empty_struct]
  273. // CHECK:STDOUT: %.loc6_24.5: init %tuple.type.b6b = tuple_init (%.loc6_24.2, %.loc6_24.4) to %.var [concrete = constants.%tuple]
  274. // CHECK:STDOUT: %.loc6_3.2: init %tuple.type.b6b = converted %tuple.ref, %.loc6_24.5 [concrete = constants.%tuple]
  275. // CHECK:STDOUT: assign %.var, %.loc6_3.2
  276. // CHECK:STDOUT: %tuple.elem0.loc6_3: ref %empty_struct_type = tuple_access %.var, element0
  277. // CHECK:STDOUT: %tuple.elem1.loc6_3: ref %empty_struct_type = tuple_access %.var, element1
  278. // CHECK:STDOUT: %.loc6_12.1: type = splice_block %.loc6_12.3 [concrete = constants.%empty_struct_type] {
  279. // CHECK:STDOUT: %.loc6_12.2: %empty_struct_type = struct_literal ()
  280. // CHECK:STDOUT: %.loc6_12.3: type = converted %.loc6_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  281. // CHECK:STDOUT: }
  282. // CHECK:STDOUT: %x: ref %empty_struct_type = bind_name x, %tuple.elem0.loc6_3
  283. // CHECK:STDOUT: %.loc6_19.1: type = splice_block %.loc6_19.3 [concrete = constants.%empty_struct_type] {
  284. // CHECK:STDOUT: %.loc6_19.2: %empty_struct_type = struct_literal ()
  285. // CHECK:STDOUT: %.loc6_19.3: type = converted %.loc6_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  286. // CHECK:STDOUT: }
  287. // CHECK:STDOUT: %y: ref %empty_struct_type = bind_name y, %tuple.elem1.loc6_3
  288. // CHECK:STDOUT: return
  289. // CHECK:STDOUT: }
  290. // CHECK:STDOUT:
  291. // CHECK:STDOUT: fn @G() {
  292. // CHECK:STDOUT: !entry:
  293. // CHECK:STDOUT: name_binding_decl {
  294. // CHECK:STDOUT: %tuple.patt: %tuple.type.b6b = binding_pattern tuple
  295. // CHECK:STDOUT: }
  296. // CHECK:STDOUT: %.loc10_27: %empty_struct_type = struct_literal ()
  297. // CHECK:STDOUT: %.loc10_31: %empty_struct_type = struct_literal ()
  298. // CHECK:STDOUT: %.loc10_32.1: %tuple.type.b6b = tuple_literal (%.loc10_27, %.loc10_31)
  299. // CHECK:STDOUT: %.loc10_21.1: type = splice_block %.loc10_21.5 [concrete = constants.%tuple.type.b6b] {
  300. // CHECK:STDOUT: %.loc10_16: %empty_struct_type = struct_literal ()
  301. // CHECK:STDOUT: %.loc10_20: %empty_struct_type = struct_literal ()
  302. // CHECK:STDOUT: %.loc10_21.2: %tuple.type.b6b = tuple_literal (%.loc10_16, %.loc10_20)
  303. // CHECK:STDOUT: %.loc10_21.3: type = converted %.loc10_16, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  304. // CHECK:STDOUT: %.loc10_21.4: type = converted %.loc10_20, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  305. // CHECK:STDOUT: %.loc10_21.5: type = converted %.loc10_21.2, constants.%tuple.type.b6b [concrete = constants.%tuple.type.b6b]
  306. // CHECK:STDOUT: }
  307. // CHECK:STDOUT: %empty_struct.loc10_27: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
  308. // CHECK:STDOUT: %.loc10_32.2: %empty_struct_type = converted %.loc10_27, %empty_struct.loc10_27 [concrete = constants.%empty_struct]
  309. // CHECK:STDOUT: %empty_struct.loc10_31: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
  310. // CHECK:STDOUT: %.loc10_32.3: %empty_struct_type = converted %.loc10_31, %empty_struct.loc10_31 [concrete = constants.%empty_struct]
  311. // CHECK:STDOUT: %tuple.loc10_32: %tuple.type.b6b = tuple_value (%.loc10_32.2, %.loc10_32.3) [concrete = constants.%tuple]
  312. // CHECK:STDOUT: %.loc10_32.4: %tuple.type.b6b = converted %.loc10_32.1, %tuple.loc10_32 [concrete = constants.%tuple]
  313. // CHECK:STDOUT: %tuple.loc10_7: %tuple.type.b6b = bind_name tuple, %.loc10_32.4
  314. // CHECK:STDOUT: name_binding_decl {
  315. // CHECK:STDOUT: %x.patt: %empty_struct_type = binding_pattern x
  316. // CHECK:STDOUT: %y.patt: %empty_struct_type = binding_pattern y
  317. // CHECK:STDOUT: %.loc11_20: %tuple.type.b6b = tuple_pattern (%x.patt, %y.patt)
  318. // CHECK:STDOUT: %.loc11_3.1: %tuple.type.b6b = var_pattern %.loc11_20
  319. // CHECK:STDOUT: }
  320. // CHECK:STDOUT: %.var: ref %tuple.type.b6b = var <none>
  321. // CHECK:STDOUT: %tuple.ref: %tuple.type.b6b = name_ref tuple, %tuple.loc10_7
  322. // CHECK:STDOUT: %tuple.elem0.loc11_24.1: %empty_struct_type = tuple_access %tuple.ref, element0
  323. // CHECK:STDOUT: %tuple.elem0.loc11_24.2: ref %empty_struct_type = tuple_access %.var, element0
  324. // CHECK:STDOUT: %.loc11_24.1: init %empty_struct_type = struct_init () to %tuple.elem0.loc11_24.2 [concrete = constants.%empty_struct]
  325. // CHECK:STDOUT: %.loc11_24.2: init %empty_struct_type = converted %tuple.elem0.loc11_24.1, %.loc11_24.1 [concrete = constants.%empty_struct]
  326. // CHECK:STDOUT: %tuple.elem1.loc11_24.1: %empty_struct_type = tuple_access %tuple.ref, element1
  327. // CHECK:STDOUT: %tuple.elem1.loc11_24.2: ref %empty_struct_type = tuple_access %.var, element1
  328. // CHECK:STDOUT: %.loc11_24.3: init %empty_struct_type = struct_init () to %tuple.elem1.loc11_24.2 [concrete = constants.%empty_struct]
  329. // CHECK:STDOUT: %.loc11_24.4: init %empty_struct_type = converted %tuple.elem1.loc11_24.1, %.loc11_24.3 [concrete = constants.%empty_struct]
  330. // CHECK:STDOUT: %.loc11_24.5: init %tuple.type.b6b = tuple_init (%.loc11_24.2, %.loc11_24.4) to %.var [concrete = constants.%tuple]
  331. // CHECK:STDOUT: %.loc11_3.2: init %tuple.type.b6b = converted %tuple.ref, %.loc11_24.5 [concrete = constants.%tuple]
  332. // CHECK:STDOUT: assign %.var, %.loc11_3.2
  333. // CHECK:STDOUT: %tuple.elem0.loc11_3: ref %empty_struct_type = tuple_access %.var, element0
  334. // CHECK:STDOUT: %tuple.elem1.loc11_3: ref %empty_struct_type = tuple_access %.var, element1
  335. // CHECK:STDOUT: %.loc11_12.1: type = splice_block %.loc11_12.3 [concrete = constants.%empty_struct_type] {
  336. // CHECK:STDOUT: %.loc11_12.2: %empty_struct_type = struct_literal ()
  337. // CHECK:STDOUT: %.loc11_12.3: type = converted %.loc11_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  338. // CHECK:STDOUT: }
  339. // CHECK:STDOUT: %x: ref %empty_struct_type = bind_name x, %tuple.elem0.loc11_3
  340. // CHECK:STDOUT: %.loc11_19.1: type = splice_block %.loc11_19.3 [concrete = constants.%empty_struct_type] {
  341. // CHECK:STDOUT: %.loc11_19.2: %empty_struct_type = struct_literal ()
  342. // CHECK:STDOUT: %.loc11_19.3: type = converted %.loc11_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  343. // CHECK:STDOUT: }
  344. // CHECK:STDOUT: %y: ref %empty_struct_type = bind_name y, %tuple.elem1.loc11_3
  345. // CHECK:STDOUT: return
  346. // CHECK:STDOUT: }
  347. // CHECK:STDOUT:
  348. // CHECK:STDOUT: fn @MakeTuple() -> %return.param: %tuple.type.b6b;
  349. // CHECK:STDOUT:
  350. // CHECK:STDOUT: fn @H() {
  351. // CHECK:STDOUT: !entry:
  352. // CHECK:STDOUT: name_binding_decl {
  353. // CHECK:STDOUT: %x.patt: %empty_struct_type = binding_pattern x
  354. // CHECK:STDOUT: %y.patt: %empty_struct_type = binding_pattern y
  355. // CHECK:STDOUT: %.loc17_20: %tuple.type.b6b = tuple_pattern (%x.patt, %y.patt)
  356. // CHECK:STDOUT: %.loc17_3.1: %tuple.type.b6b = var_pattern %.loc17_20
  357. // CHECK:STDOUT: }
  358. // CHECK:STDOUT: %.var: ref %tuple.type.b6b = var <none>
  359. // CHECK:STDOUT: %MakeTuple.ref: %MakeTuple.type = name_ref MakeTuple, file.%MakeTuple.decl [concrete = constants.%MakeTuple]
  360. // CHECK:STDOUT: %.loc17_3.2: ref %tuple.type.b6b = splice_block %.var {}
  361. // CHECK:STDOUT: %MakeTuple.call: init %tuple.type.b6b = call %MakeTuple.ref() to %.loc17_3.2
  362. // CHECK:STDOUT: assign %.var, %MakeTuple.call
  363. // CHECK:STDOUT: %tuple.elem0: ref %empty_struct_type = tuple_access %.var, element0
  364. // CHECK:STDOUT: %tuple.elem1: ref %empty_struct_type = tuple_access %.var, element1
  365. // CHECK:STDOUT: %.loc17_12.1: type = splice_block %.loc17_12.3 [concrete = constants.%empty_struct_type] {
  366. // CHECK:STDOUT: %.loc17_12.2: %empty_struct_type = struct_literal ()
  367. // CHECK:STDOUT: %.loc17_12.3: type = converted %.loc17_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  368. // CHECK:STDOUT: }
  369. // CHECK:STDOUT: %x: ref %empty_struct_type = bind_name x, %tuple.elem0
  370. // CHECK:STDOUT: %.loc17_19.1: type = splice_block %.loc17_19.3 [concrete = constants.%empty_struct_type] {
  371. // CHECK:STDOUT: %.loc17_19.2: %empty_struct_type = struct_literal ()
  372. // CHECK:STDOUT: %.loc17_19.3: type = converted %.loc17_19.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  373. // CHECK:STDOUT: }
  374. // CHECK:STDOUT: %y: ref %empty_struct_type = bind_name y, %tuple.elem1
  375. // CHECK:STDOUT: return
  376. // CHECK:STDOUT: }
  377. // CHECK:STDOUT:
  378. // CHECK:STDOUT: --- nested.carbon
  379. // CHECK:STDOUT:
  380. // CHECK:STDOUT: constants {
  381. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  382. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  383. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  384. // CHECK:STDOUT: %tuple.type.b6b: type = tuple_type (%empty_struct_type, %empty_struct_type) [concrete]
  385. // CHECK:STDOUT: %tuple.type.6ca: type = tuple_type (%empty_struct_type, %tuple.type.b6b) [concrete]
  386. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  387. // CHECK:STDOUT: }
  388. // CHECK:STDOUT:
  389. // CHECK:STDOUT: imports {
  390. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  391. // CHECK:STDOUT: import Core//prelude
  392. // CHECK:STDOUT: }
  393. // CHECK:STDOUT: }
  394. // CHECK:STDOUT:
  395. // CHECK:STDOUT: file {
  396. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  397. // CHECK:STDOUT: .Core = imports.%Core
  398. // CHECK:STDOUT: .F = %F.decl
  399. // CHECK:STDOUT: }
  400. // CHECK:STDOUT: %Core.import = import Core
  401. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  402. // CHECK:STDOUT: }
  403. // CHECK:STDOUT:
  404. // CHECK:STDOUT: fn @F() {
  405. // CHECK:STDOUT: !entry:
  406. // CHECK:STDOUT: name_binding_decl {
  407. // CHECK:STDOUT: %x.patt: %empty_struct_type = binding_pattern x
  408. // CHECK:STDOUT: %y.patt: %empty_struct_type = binding_pattern y
  409. // CHECK:STDOUT: %z.patt: %empty_struct_type = binding_pattern z
  410. // CHECK:STDOUT: %.loc5_28: %tuple.type.b6b = tuple_pattern (%y.patt, %z.patt)
  411. // CHECK:STDOUT: %.loc5_29: %tuple.type.6ca = tuple_pattern (%x.patt, %.loc5_28)
  412. // CHECK:STDOUT: }
  413. // CHECK:STDOUT: %.loc5_35.1: %empty_struct_type = struct_literal ()
  414. // CHECK:STDOUT: %.loc5_40.1: %empty_struct_type = struct_literal ()
  415. // CHECK:STDOUT: %.loc5_44.1: %empty_struct_type = struct_literal ()
  416. // CHECK:STDOUT: %.loc5_45: %tuple.type.b6b = tuple_literal (%.loc5_40.1, %.loc5_44.1)
  417. // CHECK:STDOUT: %.loc5_46: %tuple.type.6ca = tuple_literal (%.loc5_35.1, %.loc5_45)
  418. // CHECK:STDOUT: %.loc5_12.1: type = splice_block %.loc5_12.3 [concrete = constants.%empty_struct_type] {
  419. // CHECK:STDOUT: %.loc5_12.2: %empty_struct_type = struct_literal ()
  420. // CHECK:STDOUT: %.loc5_12.3: type = converted %.loc5_12.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  421. // CHECK:STDOUT: }
  422. // CHECK:STDOUT: %empty_struct.loc5_35: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
  423. // CHECK:STDOUT: %.loc5_35.2: %empty_struct_type = converted %.loc5_35.1, %empty_struct.loc5_35 [concrete = constants.%empty_struct]
  424. // CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %.loc5_35.2
  425. // CHECK:STDOUT: %.loc5_20.1: type = splice_block %.loc5_20.3 [concrete = constants.%empty_struct_type] {
  426. // CHECK:STDOUT: %.loc5_20.2: %empty_struct_type = struct_literal ()
  427. // CHECK:STDOUT: %.loc5_20.3: type = converted %.loc5_20.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  428. // CHECK:STDOUT: }
  429. // CHECK:STDOUT: %empty_struct.loc5_40: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
  430. // CHECK:STDOUT: %.loc5_40.2: %empty_struct_type = converted %.loc5_40.1, %empty_struct.loc5_40 [concrete = constants.%empty_struct]
  431. // CHECK:STDOUT: %y: %empty_struct_type = bind_name y, %.loc5_40.2
  432. // CHECK:STDOUT: %.loc5_27.1: type = splice_block %.loc5_27.3 [concrete = constants.%empty_struct_type] {
  433. // CHECK:STDOUT: %.loc5_27.2: %empty_struct_type = struct_literal ()
  434. // CHECK:STDOUT: %.loc5_27.3: type = converted %.loc5_27.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  435. // CHECK:STDOUT: }
  436. // CHECK:STDOUT: %empty_struct.loc5_44: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
  437. // CHECK:STDOUT: %.loc5_44.2: %empty_struct_type = converted %.loc5_44.1, %empty_struct.loc5_44 [concrete = constants.%empty_struct]
  438. // CHECK:STDOUT: %z: %empty_struct_type = bind_name z, %.loc5_44.2
  439. // CHECK:STDOUT: return
  440. // CHECK:STDOUT: }
  441. // CHECK:STDOUT:
  442. // CHECK:STDOUT: --- package_scope.carbon
  443. // CHECK:STDOUT:
  444. // CHECK:STDOUT: constants {
  445. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  446. // CHECK:STDOUT: %tuple.type: type = tuple_type (%empty_struct_type, %empty_struct_type) [concrete]
  447. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  448. // CHECK:STDOUT: }
  449. // CHECK:STDOUT:
  450. // CHECK:STDOUT: imports {
  451. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  452. // CHECK:STDOUT: import Core//prelude
  453. // CHECK:STDOUT: }
  454. // CHECK:STDOUT: }
  455. // CHECK:STDOUT:
  456. // CHECK:STDOUT: file {
  457. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  458. // CHECK:STDOUT: .Core = imports.%Core
  459. // CHECK:STDOUT: .x = %x
  460. // CHECK:STDOUT: .y = %y
  461. // CHECK:STDOUT: }
  462. // CHECK:STDOUT: %Core.import = import Core
  463. // CHECK:STDOUT: name_binding_decl {
  464. // CHECK:STDOUT: %x.patt: %empty_struct_type = binding_pattern x
  465. // CHECK:STDOUT: %y.patt: %empty_struct_type = binding_pattern y
  466. // CHECK:STDOUT: %.loc4_18: %tuple.type = tuple_pattern (%x.patt, %y.patt)
  467. // CHECK:STDOUT: }
  468. // CHECK:STDOUT: %.loc4_10.1: type = splice_block %.loc4_10.3 [concrete = constants.%empty_struct_type] {
  469. // CHECK:STDOUT: %.loc4_10.2: %empty_struct_type = struct_literal ()
  470. // CHECK:STDOUT: %.loc4_10.3: type = converted %.loc4_10.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  471. // CHECK:STDOUT: }
  472. // CHECK:STDOUT: %empty_struct.loc4_24: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
  473. // CHECK:STDOUT: %.loc4_24: %empty_struct_type = converted @__global_init.%.loc4_24, %empty_struct.loc4_24 [concrete = constants.%empty_struct]
  474. // CHECK:STDOUT: %x: %empty_struct_type = bind_name x, %.loc4_24
  475. // CHECK:STDOUT: %.loc4_17.1: type = splice_block %.loc4_17.3 [concrete = constants.%empty_struct_type] {
  476. // CHECK:STDOUT: %.loc4_17.2: %empty_struct_type = struct_literal ()
  477. // CHECK:STDOUT: %.loc4_17.3: type = converted %.loc4_17.2, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  478. // CHECK:STDOUT: }
  479. // CHECK:STDOUT: %empty_struct.loc4_28: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
  480. // CHECK:STDOUT: %.loc4_28: %empty_struct_type = converted @__global_init.%.loc4_28, %empty_struct.loc4_28 [concrete = constants.%empty_struct]
  481. // CHECK:STDOUT: %y: %empty_struct_type = bind_name y, %.loc4_28
  482. // CHECK:STDOUT: }
  483. // CHECK:STDOUT:
  484. // CHECK:STDOUT: fn @__global_init() {
  485. // CHECK:STDOUT: !entry:
  486. // CHECK:STDOUT: %.loc4_24: %empty_struct_type = struct_literal ()
  487. // CHECK:STDOUT: %.loc4_28: %empty_struct_type = struct_literal ()
  488. // CHECK:STDOUT: %.loc4_29: %tuple.type = tuple_literal (%.loc4_24, %.loc4_28)
  489. // CHECK:STDOUT: return
  490. // CHECK:STDOUT: }
  491. // CHECK:STDOUT:
  492. // CHECK:STDOUT: --- fail_in_interface.carbon
  493. // CHECK:STDOUT:
  494. // CHECK:STDOUT: constants {
  495. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  496. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  497. // CHECK:STDOUT: }
  498. // CHECK:STDOUT:
  499. // CHECK:STDOUT: imports {
  500. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  501. // CHECK:STDOUT: import Core//prelude
  502. // CHECK:STDOUT: }
  503. // CHECK:STDOUT: }
  504. // CHECK:STDOUT:
  505. // CHECK:STDOUT: file {
  506. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  507. // CHECK:STDOUT: .Core = imports.%Core
  508. // CHECK:STDOUT: .I = %I.decl
  509. // CHECK:STDOUT: }
  510. // CHECK:STDOUT: %Core.import = import Core
  511. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  512. // CHECK:STDOUT: }
  513. // CHECK:STDOUT:
  514. // CHECK:STDOUT: interface @I {
  515. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  516. // CHECK:STDOUT:
  517. // CHECK:STDOUT: !members:
  518. // CHECK:STDOUT: .Self = %Self
  519. // CHECK:STDOUT: .x = <unexpected>.inst25.loc9_8
  520. // CHECK:STDOUT: .y = <unexpected>.inst29.loc9_15
  521. // CHECK:STDOUT: has_error
  522. // CHECK:STDOUT: witness = ()
  523. // CHECK:STDOUT: }
  524. // CHECK:STDOUT:
  525. // CHECK:STDOUT: --- fail_in_class.carbon
  526. // CHECK:STDOUT:
  527. // CHECK:STDOUT: constants {
  528. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  529. // CHECK:STDOUT: }
  530. // CHECK:STDOUT:
  531. // CHECK:STDOUT: file {}
  532. // CHECK:STDOUT:
  533. // CHECK:STDOUT: class @C {
  534. // CHECK:STDOUT: complete_type_witness = invalid
  535. // CHECK:STDOUT:
  536. // CHECK:STDOUT: !members:
  537. // CHECK:STDOUT: .Self = constants.%C
  538. // CHECK:STDOUT: }
  539. // CHECK:STDOUT:
  540. // CHECK:STDOUT: --- fail_initializer_mismatch.carbon
  541. // CHECK:STDOUT:
  542. // CHECK:STDOUT: constants {
  543. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  544. // CHECK:STDOUT: %tuple.type.b6b: type = tuple_type (%empty_struct_type, %empty_struct_type) [concrete]
  545. // CHECK:STDOUT: %tuple.type.572: type = tuple_type (%empty_struct_type) [concrete]
  546. // CHECK:STDOUT: %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  547. // CHECK:STDOUT: }
  548. // CHECK:STDOUT:
  549. // CHECK:STDOUT: imports {
  550. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  551. // CHECK:STDOUT: import Core//prelude
  552. // CHECK:STDOUT: }
  553. // CHECK:STDOUT: }
  554. // CHECK:STDOUT:
  555. // CHECK:STDOUT: file {
  556. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  557. // CHECK:STDOUT: .Core = imports.%Core
  558. // CHECK:STDOUT: .x = <unexpected>.inst21.loc8_6
  559. // CHECK:STDOUT: .y = <unexpected>.inst25.loc8_13
  560. // CHECK:STDOUT: .a = <unexpected>.inst35.loc14_6
  561. // CHECK:STDOUT: .b = <unexpected>.inst39.loc14_13
  562. // CHECK:STDOUT: }
  563. // CHECK:STDOUT: %Core.import = import Core
  564. // CHECK:STDOUT: name_binding_decl {
  565. // CHECK:STDOUT: %x.patt: %empty_struct_type = binding_pattern x
  566. // CHECK:STDOUT: %y.patt: %empty_struct_type = binding_pattern y
  567. // CHECK:STDOUT: %.loc8: %tuple.type.b6b = tuple_pattern (%x.patt, %y.patt)
  568. // CHECK:STDOUT: }
  569. // CHECK:STDOUT: name_binding_decl {
  570. // CHECK:STDOUT: %a.patt: %empty_struct_type = binding_pattern a
  571. // CHECK:STDOUT: %b.patt: %empty_struct_type = binding_pattern b
  572. // CHECK:STDOUT: %.loc14: %tuple.type.b6b = tuple_pattern (%a.patt, %b.patt)
  573. // CHECK:STDOUT: }
  574. // CHECK:STDOUT: }
  575. // CHECK:STDOUT:
  576. // CHECK:STDOUT: fn @__global_init() {
  577. // CHECK:STDOUT: !entry:
  578. // CHECK:STDOUT: %.loc8_24: %empty_struct_type = struct_literal ()
  579. // CHECK:STDOUT: %.loc8_26: %tuple.type.572 = tuple_literal (%.loc8_24)
  580. // CHECK:STDOUT: %.loc14_24: %empty_struct_type = struct_literal ()
  581. // CHECK:STDOUT: %.loc14_28: %empty_struct_type = struct_literal ()
  582. // CHECK:STDOUT: %.loc14_32: %empty_struct_type = struct_literal ()
  583. // CHECK:STDOUT: %.loc14_33: %tuple.type.8d4 = tuple_literal (%.loc14_24, %.loc14_28, %.loc14_32)
  584. // CHECK:STDOUT: return
  585. // CHECK:STDOUT: }
  586. // CHECK:STDOUT:
  587. // CHECK:STDOUT: --- include_files/destroy.carbon
  588. // CHECK:STDOUT:
  589. // CHECK:STDOUT: file {
  590. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {}
  591. // CHECK:STDOUT: }
  592. // CHECK:STDOUT: