import.carbon 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  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/struct/import.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/import.carbon
  10. // --- implicit.carbon
  11. package Implicit;
  12. var a_ref: {.a: i32} = {.a = 0};
  13. var b_ref: {.a: {.b: i32, .c: (i32,)}, .d: i32} =
  14. {.a = {.b = 0, .c = (0,)}, .d = 0};
  15. class C(S:! {.a: i32, .b: i32}) {}
  16. fn F() -> C({.a = 1, .b = 2});
  17. // --- implicit.impl.carbon
  18. impl package Implicit;
  19. var a: {.a: i32} = a_ref;
  20. var b: {.a: {.b: i32, .c: (i32,)}, .d: i32} = b_ref;
  21. var c: C({.a = 1, .b = 2}) = F();
  22. // --- fail_bad_type.impl.carbon
  23. impl package Implicit;
  24. // CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+8]]:14: error: missing value for field `a` in struct initialization [StructInitMissingFieldInLiteral]
  25. // CHECK:STDERR: var c_bad: C({.c = 1, .d = 2}) = F();
  26. // CHECK:STDERR: ^~~~~~~~~~~~~~~~
  27. // CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE-4]]:6: in import [InImport]
  28. // CHECK:STDERR: implicit.carbon:8:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  29. // CHECK:STDERR: class C(S:! {.a: i32, .b: i32}) {}
  30. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  31. // CHECK:STDERR:
  32. var c_bad: C({.c = 1, .d = 2}) = F();
  33. // --- fail_bad_value.impl.carbon
  34. impl package Implicit;
  35. // CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C({.a = 1, .b = 2})` to `C({.a = 3, .b = 4})` [ImplicitAsConversionFailure]
  36. // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F();
  37. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  38. // CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C({.a = 1, .b = 2})` does not implement interface `Core.ImplicitAs(C({.a = 3, .b = 4}))` [MissingImplInMemberAccessNote]
  39. // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F();
  40. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  41. var c_bad: C({.a = 3, .b = 4}) = F();
  42. // CHECK:STDOUT: --- implicit.carbon
  43. // CHECK:STDOUT:
  44. // CHECK:STDOUT: constants {
  45. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  46. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  47. // CHECK:STDOUT: %struct_type.a.7cc: type = struct_type {.a: %i32} [template]
  48. // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template]
  49. // CHECK:STDOUT: %struct_type.a.a6c: type = struct_type {.a: Core.IntLiteral} [template]
  50. // CHECK:STDOUT: %Convert.type.cd1: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
  51. // CHECK:STDOUT: %impl_witness.5b0: <witness> = impl_witness (imports.%import_ref.723), @impl.1(%int_32) [template]
  52. // CHECK:STDOUT: %Convert.type.466: type = fn_type @Convert.2, @impl.1(%int_32) [template]
  53. // CHECK:STDOUT: %Convert.925: %Convert.type.466 = struct_value () [template]
  54. // CHECK:STDOUT: %Convert.bound.b41: <bound method> = bound_method %int_0.5c6, %Convert.925 [template]
  55. // CHECK:STDOUT: %Convert.specific_fn.c35: <specific function> = specific_function %Convert.bound.b41, @Convert.2(%int_32) [template]
  56. // CHECK:STDOUT: %int_0.f61: %i32 = int_value 0 [template]
  57. // CHECK:STDOUT: %struct.96f: %struct_type.a.7cc = struct_value (%int_0.f61) [template]
  58. // CHECK:STDOUT: %tuple.type.0e4: type = tuple_type (%i32) [template]
  59. // CHECK:STDOUT: %struct_type.b.c.879: type = struct_type {.b: %i32, .c: %tuple.type.0e4} [template]
  60. // CHECK:STDOUT: %struct_type.a.d.1e9: type = struct_type {.a: %struct_type.b.c.879, .d: %i32} [template]
  61. // CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [template]
  62. // CHECK:STDOUT: %struct_type.b.c.9af: type = struct_type {.b: Core.IntLiteral, .c: %tuple.type.985} [template]
  63. // CHECK:STDOUT: %struct_type.a.d.b82: type = struct_type {.a: %struct_type.b.c.9af, .d: Core.IntLiteral} [template]
  64. // CHECK:STDOUT: %tuple: %tuple.type.0e4 = tuple_value (%int_0.f61) [template]
  65. // CHECK:STDOUT: %struct.d06: %struct_type.b.c.879 = struct_value (%int_0.f61, %tuple) [template]
  66. // CHECK:STDOUT: %struct.34f: %struct_type.a.d.1e9 = struct_value (%struct.d06, %int_0.f61) [template]
  67. // CHECK:STDOUT: %struct_type.a.b.3de: type = struct_type {.a: %i32, .b: %i32} [template]
  68. // CHECK:STDOUT: %S: %struct_type.a.b.3de = bind_symbolic_name S, 0 [symbolic]
  69. // CHECK:STDOUT: %S.patt: %struct_type.a.b.3de = symbolic_binding_pattern S, 0 [symbolic]
  70. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  71. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  72. // CHECK:STDOUT: %C.c61: type = class_type @C, @C(%S) [symbolic]
  73. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  74. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  75. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
  76. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
  77. // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template]
  78. // CHECK:STDOUT: %Convert.bound.afd: <bound method> = bound_method %int_1.5b8, %Convert.925 [template]
  79. // CHECK:STDOUT: %Convert.specific_fn.b73: <specific function> = specific_function %Convert.bound.afd, @Convert.2(%int_32) [template]
  80. // CHECK:STDOUT: %int_1.c60: %i32 = int_value 1 [template]
  81. // CHECK:STDOUT: %Convert.bound.f0b: <bound method> = bound_method %int_2.ecc, %Convert.925 [template]
  82. // CHECK:STDOUT: %Convert.specific_fn.20e: <specific function> = specific_function %Convert.bound.f0b, @Convert.2(%int_32) [template]
  83. // CHECK:STDOUT: %int_2.166: %i32 = int_value 2 [template]
  84. // CHECK:STDOUT: %struct.889: %struct_type.a.b.3de = struct_value (%int_1.c60, %int_2.166) [template]
  85. // CHECK:STDOUT: %C.61d: type = class_type @C, @C(%struct.889) [template]
  86. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  87. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  88. // CHECK:STDOUT: }
  89. // CHECK:STDOUT:
  90. // CHECK:STDOUT: imports {
  91. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  92. // CHECK:STDOUT: .Int = %import_ref.187
  93. // CHECK:STDOUT: .ImplicitAs = %import_ref.a69
  94. // CHECK:STDOUT: import Core//prelude
  95. // CHECK:STDOUT: import Core//prelude/...
  96. // CHECK:STDOUT: }
  97. // CHECK:STDOUT: }
  98. // CHECK:STDOUT:
  99. // CHECK:STDOUT: file {
  100. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  101. // CHECK:STDOUT: .Core = imports.%Core
  102. // CHECK:STDOUT: .a_ref = %a_ref
  103. // CHECK:STDOUT: .b_ref = %b_ref
  104. // CHECK:STDOUT: .C = %C.decl
  105. // CHECK:STDOUT: .F = %F.decl
  106. // CHECK:STDOUT: }
  107. // CHECK:STDOUT: %Core.import = import Core
  108. // CHECK:STDOUT: %a_ref.var: ref %struct_type.a.7cc = var a_ref
  109. // CHECK:STDOUT: %a_ref: ref %struct_type.a.7cc = bind_name a_ref, %a_ref.var
  110. // CHECK:STDOUT: %b_ref.var: ref %struct_type.a.d.1e9 = var b_ref
  111. // CHECK:STDOUT: %b_ref: ref %struct_type.a.d.1e9 = bind_name b_ref, %b_ref.var
  112. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] {
  113. // CHECK:STDOUT: %S.patt.loc8_9.1: %struct_type.a.b.3de = symbolic_binding_pattern S, 0 [symbolic = %S.patt.loc8_9.2 (constants.%S.patt)]
  114. // CHECK:STDOUT: %S.param_patt: %struct_type.a.b.3de = value_param_pattern %S.patt.loc8_9.1, runtime_param<invalid> [symbolic = %S.patt.loc8_9.2 (constants.%S.patt)]
  115. // CHECK:STDOUT: } {
  116. // CHECK:STDOUT: %S.param: %struct_type.a.b.3de = value_param runtime_param<invalid>
  117. // CHECK:STDOUT: %.loc8: type = splice_block %struct_type.a.b [template = constants.%struct_type.a.b.3de] {
  118. // CHECK:STDOUT: %int_32.loc8_18: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  119. // CHECK:STDOUT: %i32.loc8_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  120. // CHECK:STDOUT: %int_32.loc8_27: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  121. // CHECK:STDOUT: %i32.loc8_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  122. // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.3de]
  123. // CHECK:STDOUT: }
  124. // CHECK:STDOUT: %S.loc8_9.1: %struct_type.a.b.3de = bind_symbolic_name S, 0, %S.param [symbolic = %S.loc8_9.2 (constants.%S)]
  125. // CHECK:STDOUT: }
  126. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
  127. // CHECK:STDOUT: %return.patt: %C.61d = return_slot_pattern
  128. // CHECK:STDOUT: %return.param_patt: %C.61d = out_param_pattern %return.patt, runtime_param0
  129. // CHECK:STDOUT: } {
  130. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic]
  131. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
  132. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
  133. // CHECK:STDOUT: %.loc9_28.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2)
  134. // CHECK:STDOUT: %impl.elem0.loc9_28.1: %Convert.type.cd1 = impl_witness_access constants.%impl_witness.5b0, element0 [template = constants.%Convert.925]
  135. // CHECK:STDOUT: %Convert.bound.loc9_28.1: <bound method> = bound_method %int_1, %impl.elem0.loc9_28.1 [template = constants.%Convert.bound.afd]
  136. // CHECK:STDOUT: %Convert.specific_fn.loc9_28.1: <specific function> = specific_function %Convert.bound.loc9_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b73]
  137. // CHECK:STDOUT: %int.convert_checked.loc9_28.1: init %i32 = call %Convert.specific_fn.loc9_28.1(%int_1) [template = constants.%int_1.c60]
  138. // CHECK:STDOUT: %.loc9_28.2: %i32 = value_of_initializer %int.convert_checked.loc9_28.1 [template = constants.%int_1.c60]
  139. // CHECK:STDOUT: %.loc9_28.3: %i32 = converted %int_1, %.loc9_28.2 [template = constants.%int_1.c60]
  140. // CHECK:STDOUT: %impl.elem0.loc9_28.2: %Convert.type.cd1 = impl_witness_access constants.%impl_witness.5b0, element0 [template = constants.%Convert.925]
  141. // CHECK:STDOUT: %Convert.bound.loc9_28.2: <bound method> = bound_method %int_2, %impl.elem0.loc9_28.2 [template = constants.%Convert.bound.f0b]
  142. // CHECK:STDOUT: %Convert.specific_fn.loc9_28.2: <specific function> = specific_function %Convert.bound.loc9_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.20e]
  143. // CHECK:STDOUT: %int.convert_checked.loc9_28.2: init %i32 = call %Convert.specific_fn.loc9_28.2(%int_2) [template = constants.%int_2.166]
  144. // CHECK:STDOUT: %.loc9_28.4: %i32 = value_of_initializer %int.convert_checked.loc9_28.2 [template = constants.%int_2.166]
  145. // CHECK:STDOUT: %.loc9_28.5: %i32 = converted %int_2, %.loc9_28.4 [template = constants.%int_2.166]
  146. // CHECK:STDOUT: %struct: %struct_type.a.b.3de = struct_value (%.loc9_28.3, %.loc9_28.5) [template = constants.%struct.889]
  147. // CHECK:STDOUT: %.loc9_29: %struct_type.a.b.3de = converted %.loc9_28.1, %struct [template = constants.%struct.889]
  148. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%struct.889) [template = constants.%C.61d]
  149. // CHECK:STDOUT: %return.param: ref %C.61d = out_param runtime_param0
  150. // CHECK:STDOUT: %return: ref %C.61d = return_slot %return.param
  151. // CHECK:STDOUT: }
  152. // CHECK:STDOUT: }
  153. // CHECK:STDOUT:
  154. // CHECK:STDOUT: generic class @C(%S.loc8_9.1: %struct_type.a.b.3de) {
  155. // CHECK:STDOUT: %S.loc8_9.2: %struct_type.a.b.3de = bind_symbolic_name S, 0 [symbolic = %S.loc8_9.2 (constants.%S)]
  156. // CHECK:STDOUT: %S.patt.loc8_9.2: %struct_type.a.b.3de = symbolic_binding_pattern S, 0 [symbolic = %S.patt.loc8_9.2 (constants.%S.patt)]
  157. // CHECK:STDOUT:
  158. // CHECK:STDOUT: !definition:
  159. // CHECK:STDOUT:
  160. // CHECK:STDOUT: class {
  161. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  162. // CHECK:STDOUT:
  163. // CHECK:STDOUT: !members:
  164. // CHECK:STDOUT: .Self = constants.%C.c61
  165. // CHECK:STDOUT: complete_type_witness = %complete_type
  166. // CHECK:STDOUT: }
  167. // CHECK:STDOUT: }
  168. // CHECK:STDOUT:
  169. // CHECK:STDOUT: fn @F() -> %C.61d;
  170. // CHECK:STDOUT:
  171. // CHECK:STDOUT: fn @__global_init() {
  172. // CHECK:STDOUT: !entry:
  173. // CHECK:STDOUT: %int_0.loc4: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
  174. // CHECK:STDOUT: %.loc4_31.1: %struct_type.a.a6c = struct_literal (%int_0.loc4)
  175. // CHECK:STDOUT: %impl.elem0.loc4: %Convert.type.cd1 = impl_witness_access constants.%impl_witness.5b0, element0 [template = constants.%Convert.925]
  176. // CHECK:STDOUT: %Convert.bound.loc4: <bound method> = bound_method %int_0.loc4, %impl.elem0.loc4 [template = constants.%Convert.bound.b41]
  177. // CHECK:STDOUT: %Convert.specific_fn.loc4: <specific function> = specific_function %Convert.bound.loc4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.c35]
  178. // CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %Convert.specific_fn.loc4(%int_0.loc4) [template = constants.%int_0.f61]
  179. // CHECK:STDOUT: %.loc4_31.2: init %i32 = converted %int_0.loc4, %int.convert_checked.loc4 [template = constants.%int_0.f61]
  180. // CHECK:STDOUT: %.loc4_31.3: init %struct_type.a.7cc = struct_init (%.loc4_31.2) to file.%a_ref.var [template = constants.%struct.96f]
  181. // CHECK:STDOUT: %.loc4_32: init %struct_type.a.7cc = converted %.loc4_31.1, %.loc4_31.3 [template = constants.%struct.96f]
  182. // CHECK:STDOUT: assign file.%a_ref.var, %.loc4_32
  183. // CHECK:STDOUT: %int_0.loc6_17: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
  184. // CHECK:STDOUT: %int_0.loc6_26: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
  185. // CHECK:STDOUT: %.loc6_28.1: %tuple.type.985 = tuple_literal (%int_0.loc6_26)
  186. // CHECK:STDOUT: %.loc6_29.1: %struct_type.b.c.9af = struct_literal (%int_0.loc6_17, %.loc6_28.1)
  187. // CHECK:STDOUT: %int_0.loc6_37: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
  188. // CHECK:STDOUT: %.loc6_38.1: %struct_type.a.d.b82 = struct_literal (%.loc6_29.1, %int_0.loc6_37)
  189. // CHECK:STDOUT: %impl.elem0.loc6_29: %Convert.type.cd1 = impl_witness_access constants.%impl_witness.5b0, element0 [template = constants.%Convert.925]
  190. // CHECK:STDOUT: %Convert.bound.loc6_29: <bound method> = bound_method %int_0.loc6_17, %impl.elem0.loc6_29 [template = constants.%Convert.bound.b41]
  191. // CHECK:STDOUT: %Convert.specific_fn.loc6_29: <specific function> = specific_function %Convert.bound.loc6_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.c35]
  192. // CHECK:STDOUT: %int.convert_checked.loc6_29: init %i32 = call %Convert.specific_fn.loc6_29(%int_0.loc6_17) [template = constants.%int_0.f61]
  193. // CHECK:STDOUT: %.loc6_29.2: init %i32 = converted %int_0.loc6_17, %int.convert_checked.loc6_29 [template = constants.%int_0.f61]
  194. // CHECK:STDOUT: %.loc6_38.2: ref %struct_type.b.c.879 = struct_access file.%b_ref.var, element0
  195. // CHECK:STDOUT: %.loc6_29.3: ref %i32 = struct_access %.loc6_38.2, element0
  196. // CHECK:STDOUT: %.loc6_29.4: init %i32 = initialize_from %.loc6_29.2 to %.loc6_29.3 [template = constants.%int_0.f61]
  197. // CHECK:STDOUT: %impl.elem0.loc6_28: %Convert.type.cd1 = impl_witness_access constants.%impl_witness.5b0, element0 [template = constants.%Convert.925]
  198. // CHECK:STDOUT: %Convert.bound.loc6_28: <bound method> = bound_method %int_0.loc6_26, %impl.elem0.loc6_28 [template = constants.%Convert.bound.b41]
  199. // CHECK:STDOUT: %Convert.specific_fn.loc6_28: <specific function> = specific_function %Convert.bound.loc6_28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.c35]
  200. // CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %Convert.specific_fn.loc6_28(%int_0.loc6_26) [template = constants.%int_0.f61]
  201. // CHECK:STDOUT: %.loc6_28.2: init %i32 = converted %int_0.loc6_26, %int.convert_checked.loc6_28 [template = constants.%int_0.f61]
  202. // CHECK:STDOUT: %.loc6_29.5: ref %tuple.type.0e4 = struct_access %.loc6_38.2, element1
  203. // CHECK:STDOUT: %.loc6_28.3: init %tuple.type.0e4 = tuple_init (%.loc6_28.2) to %.loc6_29.5 [template = constants.%tuple]
  204. // CHECK:STDOUT: %.loc6_29.6: init %tuple.type.0e4 = converted %.loc6_28.1, %.loc6_28.3 [template = constants.%tuple]
  205. // CHECK:STDOUT: %.loc6_29.7: init %tuple.type.0e4 = initialize_from %.loc6_29.6 to %.loc6_29.5 [template = constants.%tuple]
  206. // CHECK:STDOUT: %.loc6_29.8: init %struct_type.b.c.879 = struct_init (%.loc6_29.4, %.loc6_29.7) to %.loc6_38.2 [template = constants.%struct.d06]
  207. // CHECK:STDOUT: %.loc6_38.3: init %struct_type.b.c.879 = converted %.loc6_29.1, %.loc6_29.8 [template = constants.%struct.d06]
  208. // CHECK:STDOUT: %impl.elem0.loc6_38: %Convert.type.cd1 = impl_witness_access constants.%impl_witness.5b0, element0 [template = constants.%Convert.925]
  209. // CHECK:STDOUT: %Convert.bound.loc6_38: <bound method> = bound_method %int_0.loc6_37, %impl.elem0.loc6_38 [template = constants.%Convert.bound.b41]
  210. // CHECK:STDOUT: %Convert.specific_fn.loc6_38: <specific function> = specific_function %Convert.bound.loc6_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.c35]
  211. // CHECK:STDOUT: %int.convert_checked.loc6_38: init %i32 = call %Convert.specific_fn.loc6_38(%int_0.loc6_37) [template = constants.%int_0.f61]
  212. // CHECK:STDOUT: %.loc6_38.4: init %i32 = converted %int_0.loc6_37, %int.convert_checked.loc6_38 [template = constants.%int_0.f61]
  213. // CHECK:STDOUT: %.loc6_38.5: ref %i32 = struct_access file.%b_ref.var, element1
  214. // CHECK:STDOUT: %.loc6_38.6: init %i32 = initialize_from %.loc6_38.4 to %.loc6_38.5 [template = constants.%int_0.f61]
  215. // CHECK:STDOUT: %.loc6_38.7: init %struct_type.a.d.1e9 = struct_init (%.loc6_38.3, %.loc6_38.6) to file.%b_ref.var [template = constants.%struct.34f]
  216. // CHECK:STDOUT: %.loc6_39: init %struct_type.a.d.1e9 = converted %.loc6_38.1, %.loc6_38.7 [template = constants.%struct.34f]
  217. // CHECK:STDOUT: assign file.%b_ref.var, %.loc6_39
  218. // CHECK:STDOUT: return
  219. // CHECK:STDOUT: }
  220. // CHECK:STDOUT:
  221. // CHECK:STDOUT: specific @C(constants.%S) {
  222. // CHECK:STDOUT: %S.loc8_9.2 => constants.%S
  223. // CHECK:STDOUT: %S.patt.loc8_9.2 => constants.%S
  224. // CHECK:STDOUT: }
  225. // CHECK:STDOUT:
  226. // CHECK:STDOUT: specific @C(constants.%struct.889) {
  227. // CHECK:STDOUT: %S.loc8_9.2 => constants.%struct.889
  228. // CHECK:STDOUT: %S.patt.loc8_9.2 => constants.%struct.889
  229. // CHECK:STDOUT: }
  230. // CHECK:STDOUT:
  231. // CHECK:STDOUT: --- implicit.impl.carbon
  232. // CHECK:STDOUT:
  233. // CHECK:STDOUT: constants {
  234. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  235. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  236. // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template]
  237. // CHECK:STDOUT: %tuple.type.590: type = tuple_type (%i32) [template]
  238. // CHECK:STDOUT: %struct_type.b.c: type = struct_type {.b: %i32, .c: %tuple.type.590} [template]
  239. // CHECK:STDOUT: %struct_type.a.d.b93: type = struct_type {.a: %struct_type.b.c, .d: %i32} [template]
  240. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  241. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  242. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  243. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  244. // CHECK:STDOUT: %struct_type.a.b.29a: type = struct_type {.a: %i32, .b: %i32} [template]
  245. // CHECK:STDOUT: %S: %struct_type.a.b.29a = bind_symbolic_name S, 0 [symbolic]
  246. // CHECK:STDOUT: %S.patt: %struct_type.a.b.29a = symbolic_binding_pattern S, 0 [symbolic]
  247. // CHECK:STDOUT: %int_1.059: %i32 = int_value 1 [template]
  248. // CHECK:STDOUT: %int_2.ed9: %i32 = int_value 2 [template]
  249. // CHECK:STDOUT: %struct: %struct_type.a.b.29a = struct_value (%int_1.059, %int_2.ed9) [template]
  250. // CHECK:STDOUT: %C.c37: type = class_type @C, @C(%struct) [template]
  251. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  252. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  253. // CHECK:STDOUT: }
  254. // CHECK:STDOUT:
  255. // CHECK:STDOUT: imports {
  256. // CHECK:STDOUT: %import_ref.cd5: ref %struct_type.a = import_ref Implicit//default, a_ref, loaded
  257. // CHECK:STDOUT: %import_ref.8492: ref %struct_type.a.d.b93 = import_ref Implicit//default, b_ref, loaded
  258. // CHECK:STDOUT: %import_ref.c8a: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic]
  259. // CHECK:STDOUT: %import_ref.f0f: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F]
  260. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  261. // CHECK:STDOUT: .Int = %import_ref.d69
  262. // CHECK:STDOUT: .ImplicitAs = %import_ref.edd
  263. // CHECK:STDOUT: import Core//prelude
  264. // CHECK:STDOUT: import Core//prelude/...
  265. // CHECK:STDOUT: }
  266. // CHECK:STDOUT: %import_ref.8f2: <witness> = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.357]
  267. // CHECK:STDOUT: %import_ref.5c7 = import_ref Implicit//default, inst1061 [no loc], unloaded
  268. // CHECK:STDOUT: }
  269. // CHECK:STDOUT:
  270. // CHECK:STDOUT: file {
  271. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  272. // CHECK:STDOUT: .a_ref = imports.%import_ref.cd5
  273. // CHECK:STDOUT: .b_ref = imports.%import_ref.8492
  274. // CHECK:STDOUT: .C = imports.%import_ref.c8a
  275. // CHECK:STDOUT: .F = imports.%import_ref.f0f
  276. // CHECK:STDOUT: .Core = imports.%Core
  277. // CHECK:STDOUT: .a = %a
  278. // CHECK:STDOUT: .b = %b
  279. // CHECK:STDOUT: .c = %c
  280. // CHECK:STDOUT: }
  281. // CHECK:STDOUT: %Implicit.import = import Implicit
  282. // CHECK:STDOUT: %default.import = import <invalid>
  283. // CHECK:STDOUT: %Core.import = import Core
  284. // CHECK:STDOUT: %a.var: ref %struct_type.a = var a
  285. // CHECK:STDOUT: %a: ref %struct_type.a = bind_name a, %a.var
  286. // CHECK:STDOUT: %b.var: ref %struct_type.a.d.b93 = var b
  287. // CHECK:STDOUT: %b: ref %struct_type.a.d.b93 = bind_name b, %b.var
  288. // CHECK:STDOUT: %c.var: ref %C.c37 = var c
  289. // CHECK:STDOUT: %c: ref %C.c37 = bind_name c, %c.var
  290. // CHECK:STDOUT: }
  291. // CHECK:STDOUT:
  292. // CHECK:STDOUT: generic class @C(constants.%S: %struct_type.a.b.29a) [from "implicit.carbon"] {
  293. // CHECK:STDOUT: %S: %struct_type.a.b.29a = bind_symbolic_name S, 0 [symbolic = %S (constants.%S)]
  294. // CHECK:STDOUT: %S.patt: %struct_type.a.b.29a = symbolic_binding_pattern S, 0 [symbolic = %S.patt (constants.%S.patt)]
  295. // CHECK:STDOUT:
  296. // CHECK:STDOUT: !definition:
  297. // CHECK:STDOUT:
  298. // CHECK:STDOUT: class {
  299. // CHECK:STDOUT: !members:
  300. // CHECK:STDOUT: .Self = imports.%import_ref.5c7
  301. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.8f2
  302. // CHECK:STDOUT: }
  303. // CHECK:STDOUT: }
  304. // CHECK:STDOUT:
  305. // CHECK:STDOUT: fn @F() -> %C.c37 [from "implicit.carbon"];
  306. // CHECK:STDOUT:
  307. // CHECK:STDOUT: fn @__global_init() {
  308. // CHECK:STDOUT: !entry:
  309. // CHECK:STDOUT: %a_ref.ref: ref %struct_type.a = name_ref a_ref, imports.%import_ref.cd5
  310. // CHECK:STDOUT: %.loc4_20.1: ref %i32 = struct_access %a_ref.ref, element0
  311. // CHECK:STDOUT: %.loc4_20.2: %i32 = bind_value %.loc4_20.1
  312. // CHECK:STDOUT: %.loc4_20.3: init %struct_type.a = struct_init (%.loc4_20.2) to file.%a.var
  313. // CHECK:STDOUT: %.loc4_25: init %struct_type.a = converted %a_ref.ref, %.loc4_20.3
  314. // CHECK:STDOUT: assign file.%a.var, %.loc4_25
  315. // CHECK:STDOUT: %b_ref.ref: ref %struct_type.a.d.b93 = name_ref b_ref, imports.%import_ref.8492
  316. // CHECK:STDOUT: %.loc5_47.1: ref %struct_type.b.c = struct_access %b_ref.ref, element0
  317. // CHECK:STDOUT: %.loc5_47.2: ref %i32 = struct_access %.loc5_47.1, element0
  318. // CHECK:STDOUT: %.loc5_47.3: %i32 = bind_value %.loc5_47.2
  319. // CHECK:STDOUT: %.loc5_47.4: ref %struct_type.b.c = struct_access file.%b.var, element0
  320. // CHECK:STDOUT: %.loc5_47.5: ref %i32 = struct_access %.loc5_47.4, element0
  321. // CHECK:STDOUT: %.loc5_47.6: init %i32 = initialize_from %.loc5_47.3 to %.loc5_47.5
  322. // CHECK:STDOUT: %.loc5_47.7: ref %tuple.type.590 = struct_access %.loc5_47.1, element1
  323. // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %.loc5_47.7, element0
  324. // CHECK:STDOUT: %.loc5_47.8: %i32 = bind_value %tuple.elem0
  325. // CHECK:STDOUT: %.loc5_47.9: ref %tuple.type.590 = struct_access %.loc5_47.4, element1
  326. // CHECK:STDOUT: %.loc5_47.10: init %tuple.type.590 = tuple_init (%.loc5_47.8) to %.loc5_47.9
  327. // CHECK:STDOUT: %.loc5_47.11: init %tuple.type.590 = converted %.loc5_47.7, %.loc5_47.10
  328. // CHECK:STDOUT: %.loc5_47.12: init %tuple.type.590 = initialize_from %.loc5_47.11 to %.loc5_47.9
  329. // CHECK:STDOUT: %.loc5_47.13: init %struct_type.b.c = struct_init (%.loc5_47.6, %.loc5_47.12) to %.loc5_47.4
  330. // CHECK:STDOUT: %.loc5_47.14: init %struct_type.b.c = converted %.loc5_47.1, %.loc5_47.13
  331. // CHECK:STDOUT: %.loc5_47.15: ref %i32 = struct_access %b_ref.ref, element1
  332. // CHECK:STDOUT: %.loc5_47.16: %i32 = bind_value %.loc5_47.15
  333. // CHECK:STDOUT: %.loc5_47.17: ref %i32 = struct_access file.%b.var, element1
  334. // CHECK:STDOUT: %.loc5_47.18: init %i32 = initialize_from %.loc5_47.16 to %.loc5_47.17
  335. // CHECK:STDOUT: %.loc5_47.19: init %struct_type.a.d.b93 = struct_init (%.loc5_47.14, %.loc5_47.18) to file.%b.var
  336. // CHECK:STDOUT: %.loc5_52: init %struct_type.a.d.b93 = converted %b_ref.ref, %.loc5_47.19
  337. // CHECK:STDOUT: assign file.%b.var, %.loc5_52
  338. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.f0f [template = constants.%F]
  339. // CHECK:STDOUT: %.loc6: ref %C.c37 = splice_block file.%c.var {}
  340. // CHECK:STDOUT: %F.call: init %C.c37 = call %F.ref() to %.loc6
  341. // CHECK:STDOUT: assign file.%c.var, %F.call
  342. // CHECK:STDOUT: return
  343. // CHECK:STDOUT: }
  344. // CHECK:STDOUT:
  345. // CHECK:STDOUT: specific @C(constants.%S) {
  346. // CHECK:STDOUT: %S => constants.%S
  347. // CHECK:STDOUT: %S.patt => constants.%S
  348. // CHECK:STDOUT: }
  349. // CHECK:STDOUT:
  350. // CHECK:STDOUT: specific @C(constants.%struct) {
  351. // CHECK:STDOUT: %S => constants.%struct
  352. // CHECK:STDOUT: %S.patt => constants.%struct
  353. // CHECK:STDOUT:
  354. // CHECK:STDOUT: !definition:
  355. // CHECK:STDOUT: }
  356. // CHECK:STDOUT:
  357. // CHECK:STDOUT: --- fail_bad_type.impl.carbon
  358. // CHECK:STDOUT:
  359. // CHECK:STDOUT: constants {
  360. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  361. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  362. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  363. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  364. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  365. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  366. // CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template]
  367. // CHECK:STDOUT: %S: %struct_type.a.b = bind_symbolic_name S, 0 [symbolic]
  368. // CHECK:STDOUT: %S.patt: %struct_type.a.b = symbolic_binding_pattern S, 0 [symbolic]
  369. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  370. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  371. // CHECK:STDOUT: %int_2.ed9: %i32 = int_value 2 [template]
  372. // CHECK:STDOUT: %int_1.059: %i32 = int_value 1 [template]
  373. // CHECK:STDOUT: %struct: %struct_type.a.b = struct_value (%int_1.059, %int_2.ed9) [template]
  374. // CHECK:STDOUT: %C.c37: type = class_type @C, @C(%struct) [template]
  375. // CHECK:STDOUT: }
  376. // CHECK:STDOUT:
  377. // CHECK:STDOUT: imports {
  378. // CHECK:STDOUT: %import_ref.970 = import_ref Implicit//default, a_ref, unloaded
  379. // CHECK:STDOUT: %import_ref.dfd = import_ref Implicit//default, b_ref, unloaded
  380. // CHECK:STDOUT: %import_ref.c8a: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic]
  381. // CHECK:STDOUT: %import_ref.f0f: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F]
  382. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  383. // CHECK:STDOUT: import Core//prelude
  384. // CHECK:STDOUT: import Core//prelude/...
  385. // CHECK:STDOUT: }
  386. // CHECK:STDOUT: %import_ref.8f2: <witness> = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.357]
  387. // CHECK:STDOUT: %import_ref.5c7 = import_ref Implicit//default, inst1061 [no loc], unloaded
  388. // CHECK:STDOUT: }
  389. // CHECK:STDOUT:
  390. // CHECK:STDOUT: file {
  391. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  392. // CHECK:STDOUT: .a_ref = imports.%import_ref.970
  393. // CHECK:STDOUT: .b_ref = imports.%import_ref.dfd
  394. // CHECK:STDOUT: .C = imports.%import_ref.c8a
  395. // CHECK:STDOUT: .F = imports.%import_ref.f0f
  396. // CHECK:STDOUT: .Core = imports.%Core
  397. // CHECK:STDOUT: .c_bad = %c_bad
  398. // CHECK:STDOUT: }
  399. // CHECK:STDOUT: %Implicit.import = import Implicit
  400. // CHECK:STDOUT: %default.import = import <invalid>
  401. // CHECK:STDOUT: %Core.import = import Core
  402. // CHECK:STDOUT: %c_bad.var: ref <error> = var c_bad
  403. // CHECK:STDOUT: %c_bad: ref <error> = bind_name c_bad, %c_bad.var
  404. // CHECK:STDOUT: }
  405. // CHECK:STDOUT:
  406. // CHECK:STDOUT: generic class @C(constants.%S: %struct_type.a.b) [from "implicit.carbon"] {
  407. // CHECK:STDOUT: %S: %struct_type.a.b = bind_symbolic_name S, 0 [symbolic = %S (constants.%S)]
  408. // CHECK:STDOUT: %S.patt: %struct_type.a.b = symbolic_binding_pattern S, 0 [symbolic = %S.patt (constants.%S.patt)]
  409. // CHECK:STDOUT:
  410. // CHECK:STDOUT: !definition:
  411. // CHECK:STDOUT:
  412. // CHECK:STDOUT: class {
  413. // CHECK:STDOUT: !members:
  414. // CHECK:STDOUT: .Self = imports.%import_ref.5c7
  415. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.8f2
  416. // CHECK:STDOUT: }
  417. // CHECK:STDOUT: }
  418. // CHECK:STDOUT:
  419. // CHECK:STDOUT: fn @F() -> %C.c37 [from "implicit.carbon"];
  420. // CHECK:STDOUT:
  421. // CHECK:STDOUT: fn @__global_init() {
  422. // CHECK:STDOUT: !entry:
  423. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.f0f [template = constants.%F]
  424. // CHECK:STDOUT: %.loc11: ref %C.c37 = temporary_storage
  425. // CHECK:STDOUT: %F.call: init %C.c37 = call %F.ref() to %.loc11
  426. // CHECK:STDOUT: assign file.%c_bad.var, <error>
  427. // CHECK:STDOUT: return
  428. // CHECK:STDOUT: }
  429. // CHECK:STDOUT:
  430. // CHECK:STDOUT: specific @C(constants.%S) {
  431. // CHECK:STDOUT: %S => constants.%S
  432. // CHECK:STDOUT: %S.patt => constants.%S
  433. // CHECK:STDOUT: }
  434. // CHECK:STDOUT:
  435. // CHECK:STDOUT: specific @C(constants.%struct) {
  436. // CHECK:STDOUT: %S => constants.%struct
  437. // CHECK:STDOUT: %S.patt => constants.%struct
  438. // CHECK:STDOUT:
  439. // CHECK:STDOUT: !definition:
  440. // CHECK:STDOUT: }
  441. // CHECK:STDOUT:
  442. // CHECK:STDOUT: --- fail_bad_value.impl.carbon
  443. // CHECK:STDOUT:
  444. // CHECK:STDOUT: constants {
  445. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  446. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  447. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  448. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  449. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  450. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  451. // CHECK:STDOUT: %struct_type.a.b.29a: type = struct_type {.a: %i32, .b: %i32} [template]
  452. // CHECK:STDOUT: %S: %struct_type.a.b.29a = bind_symbolic_name S, 0 [symbolic]
  453. // CHECK:STDOUT: %S.patt: %struct_type.a.b.29a = symbolic_binding_pattern S, 0 [symbolic]
  454. // CHECK:STDOUT: %int_3.781: %i32 = int_value 3 [template]
  455. // CHECK:STDOUT: %int_4.1ad: %i32 = int_value 4 [template]
  456. // CHECK:STDOUT: %struct.c02: %struct_type.a.b.29a = struct_value (%int_3.781, %int_4.1ad) [template]
  457. // CHECK:STDOUT: %C.729: type = class_type @C, @C(%struct.c02) [template]
  458. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  459. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  460. // CHECK:STDOUT: %int_2: %i32 = int_value 2 [template]
  461. // CHECK:STDOUT: %int_1: %i32 = int_value 1 [template]
  462. // CHECK:STDOUT: %struct.778: %struct_type.a.b.29a = struct_value (%int_1, %int_2) [template]
  463. // CHECK:STDOUT: %C.c37: type = class_type @C, @C(%struct.778) [template]
  464. // CHECK:STDOUT: }
  465. // CHECK:STDOUT:
  466. // CHECK:STDOUT: imports {
  467. // CHECK:STDOUT: %import_ref.970 = import_ref Implicit//default, a_ref, unloaded
  468. // CHECK:STDOUT: %import_ref.dfd = import_ref Implicit//default, b_ref, unloaded
  469. // CHECK:STDOUT: %import_ref.c8a: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic]
  470. // CHECK:STDOUT: %import_ref.f0f: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F]
  471. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  472. // CHECK:STDOUT: .ImplicitAs = %import_ref.edd
  473. // CHECK:STDOUT: import Core//prelude
  474. // CHECK:STDOUT: import Core//prelude/...
  475. // CHECK:STDOUT: }
  476. // CHECK:STDOUT: %import_ref.8f2: <witness> = import_ref Implicit//default, loc8_34, loaded [template = constants.%complete_type.357]
  477. // CHECK:STDOUT: %import_ref.5c7 = import_ref Implicit//default, inst1061 [no loc], unloaded
  478. // CHECK:STDOUT: }
  479. // CHECK:STDOUT:
  480. // CHECK:STDOUT: file {
  481. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  482. // CHECK:STDOUT: .a_ref = imports.%import_ref.970
  483. // CHECK:STDOUT: .b_ref = imports.%import_ref.dfd
  484. // CHECK:STDOUT: .C = imports.%import_ref.c8a
  485. // CHECK:STDOUT: .F = imports.%import_ref.f0f
  486. // CHECK:STDOUT: .Core = imports.%Core
  487. // CHECK:STDOUT: .c_bad = %c_bad
  488. // CHECK:STDOUT: }
  489. // CHECK:STDOUT: %Implicit.import = import Implicit
  490. // CHECK:STDOUT: %default.import = import <invalid>
  491. // CHECK:STDOUT: %Core.import = import Core
  492. // CHECK:STDOUT: %c_bad.var: ref %C.729 = var c_bad
  493. // CHECK:STDOUT: %c_bad: ref %C.729 = bind_name c_bad, %c_bad.var
  494. // CHECK:STDOUT: }
  495. // CHECK:STDOUT:
  496. // CHECK:STDOUT: generic class @C(constants.%S: %struct_type.a.b.29a) [from "implicit.carbon"] {
  497. // CHECK:STDOUT: %S: %struct_type.a.b.29a = bind_symbolic_name S, 0 [symbolic = %S (constants.%S)]
  498. // CHECK:STDOUT: %S.patt: %struct_type.a.b.29a = symbolic_binding_pattern S, 0 [symbolic = %S.patt (constants.%S.patt)]
  499. // CHECK:STDOUT:
  500. // CHECK:STDOUT: !definition:
  501. // CHECK:STDOUT:
  502. // CHECK:STDOUT: class {
  503. // CHECK:STDOUT: !members:
  504. // CHECK:STDOUT: .Self = imports.%import_ref.5c7
  505. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.8f2
  506. // CHECK:STDOUT: }
  507. // CHECK:STDOUT: }
  508. // CHECK:STDOUT:
  509. // CHECK:STDOUT: fn @F() -> %C.c37 [from "implicit.carbon"];
  510. // CHECK:STDOUT:
  511. // CHECK:STDOUT: fn @__global_init() {
  512. // CHECK:STDOUT: !entry:
  513. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.f0f [template = constants.%F]
  514. // CHECK:STDOUT: %.loc9_36: ref %C.c37 = temporary_storage
  515. // CHECK:STDOUT: %F.call: init %C.c37 = call %F.ref() to %.loc9_36
  516. // CHECK:STDOUT: %.loc9_37: %C.729 = converted %F.call, <error> [template = <error>]
  517. // CHECK:STDOUT: assign file.%c_bad.var, <error>
  518. // CHECK:STDOUT: return
  519. // CHECK:STDOUT: }
  520. // CHECK:STDOUT:
  521. // CHECK:STDOUT: specific @C(constants.%S) {
  522. // CHECK:STDOUT: %S => constants.%S
  523. // CHECK:STDOUT: %S.patt => constants.%S
  524. // CHECK:STDOUT: }
  525. // CHECK:STDOUT:
  526. // CHECK:STDOUT: specific @C(constants.%struct.c02) {
  527. // CHECK:STDOUT: %S => constants.%struct.c02
  528. // CHECK:STDOUT: %S.patt => constants.%struct.c02
  529. // CHECK:STDOUT:
  530. // CHECK:STDOUT: !definition:
  531. // CHECK:STDOUT: }
  532. // CHECK:STDOUT:
  533. // CHECK:STDOUT: specific @C(constants.%struct.778) {
  534. // CHECK:STDOUT: %S => constants.%struct.778
  535. // CHECK:STDOUT: %S.patt => constants.%struct.778
  536. // CHECK:STDOUT:
  537. // CHECK:STDOUT: !definition:
  538. // CHECK:STDOUT: }
  539. // CHECK:STDOUT: