tuple_pattern.carbon 34 KB

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