builtins.llp64.carbon 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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/testdata/min_prelude/uint.carbon
  6. // EXTRA-ARGS: --target=x86_64-pc-windows-msvc --clang-arg=-fno-PIE
  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/interop/cpp/builtins.llp64.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/builtins.llp64.carbon
  13. // --- supported_types.carbon
  14. library "[[@TEST_NAME]]";
  15. import Cpp inline "";
  16. fn F() {
  17. //@dump-sem-ir-begin
  18. let cpp_long_long : Cpp.long_long = 1 as i64;
  19. let carbon_long_long: i64 = cpp_long_long;
  20. let cpp_unsigned_long_long : Cpp.unsigned_long_long = 1 as u64;
  21. let carbon_unsigned_long_long: u64 = cpp_unsigned_long_long;
  22. //@dump-sem-ir-end
  23. }
  24. // --- fail_todo_unsupported_types.carbon
  25. library "[[@TEST_NAME]]";
  26. import Cpp inline "";
  27. fn F() {
  28. //@dump-sem-ir-begin
  29. // CHECK:STDERR: fail_todo_unsupported_types.carbon:[[@LINE+7]]:18: error: semantics TODO: `Unsupported: builtin type: long` [SemanticsTodo]
  30. // CHECK:STDERR: let cpp_long : Cpp.long = 1 as i64;
  31. // CHECK:STDERR: ^~~~~~~~
  32. // CHECK:STDERR: fail_todo_unsupported_types.carbon:[[@LINE+4]]:18: note: in `Cpp` name lookup for `long` [InCppNameLookup]
  33. // CHECK:STDERR: let cpp_long : Cpp.long = 1 as i64;
  34. // CHECK:STDERR: ^~~~~~~~
  35. // CHECK:STDERR:
  36. let cpp_long : Cpp.long = 1 as i64;
  37. let carbon_long: i64 = cpp_long;
  38. // CHECK:STDERR: fail_todo_unsupported_types.carbon:[[@LINE+7]]:27: error: semantics TODO: `Unsupported: builtin type: unsigned long` [SemanticsTodo]
  39. // CHECK:STDERR: let cpp_unsigned_long : Cpp.unsigned_long = 1 as u64;
  40. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~
  41. // CHECK:STDERR: fail_todo_unsupported_types.carbon:[[@LINE+4]]:27: note: in `Cpp` name lookup for `unsigned_long` [InCppNameLookup]
  42. // CHECK:STDERR: let cpp_unsigned_long : Cpp.unsigned_long = 1 as u64;
  43. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~
  44. // CHECK:STDERR:
  45. let cpp_unsigned_long : Cpp.unsigned_long = 1 as u64;
  46. let carbon_unsigned_long: u64 = cpp_unsigned_long;
  47. //@dump-sem-ir-end
  48. }
  49. // CHECK:STDOUT: --- supported_types.carbon
  50. // CHECK:STDOUT:
  51. // CHECK:STDOUT: constants {
  52. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete]
  53. // CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [concrete]
  54. // CHECK:STDOUT: %pattern_type.95b: type = pattern_type %i64 [concrete]
  55. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  56. // CHECK:STDOUT: %As.type.bbb: type = facet_type <@As, @As(%i64)> [concrete]
  57. // CHECK:STDOUT: %As.Convert.type.d57: type = fn_type @As.Convert, @As(%i64) [concrete]
  58. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  59. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.565: type = fn_type @Core.IntLiteral.as.As.impl.Convert.1, @Core.IntLiteral.as.As.impl.dc4(%To) [symbolic]
  60. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.d2c: %Core.IntLiteral.as.As.impl.Convert.type.565 = struct_value () [symbolic]
  61. // CHECK:STDOUT: %As.impl_witness.4f1: <witness> = impl_witness imports.%As.impl_witness_table.5ad, @Core.IntLiteral.as.As.impl.dc4(%int_64) [concrete]
  62. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.9ac: type = fn_type @Core.IntLiteral.as.As.impl.Convert.1, @Core.IntLiteral.as.As.impl.dc4(%int_64) [concrete]
  63. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.fe2: %Core.IntLiteral.as.As.impl.Convert.type.9ac = struct_value () [concrete]
  64. // CHECK:STDOUT: %As.facet.888: %As.type.bbb = facet_value Core.IntLiteral, (%As.impl_witness.4f1) [concrete]
  65. // CHECK:STDOUT: %.b12: type = fn_type_with_self_type %As.Convert.type.d57, %As.facet.888 [concrete]
  66. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.0c0: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.fe2 [concrete]
  67. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn.96b: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.fe2, @Core.IntLiteral.as.As.impl.Convert.1(%int_64) [concrete]
  68. // CHECK:STDOUT: %bound_method.b11: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn.96b [concrete]
  69. // CHECK:STDOUT: %int_1.41a: %i64 = int_value 1 [concrete]
  70. // CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [concrete]
  71. // CHECK:STDOUT: %pattern_type.157: type = pattern_type %u64 [concrete]
  72. // CHECK:STDOUT: %As.type.465: type = facet_type <@As, @As(%u64)> [concrete]
  73. // CHECK:STDOUT: %As.Convert.type.7eb: type = fn_type @As.Convert, @As(%u64) [concrete]
  74. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.972: type = fn_type @Core.IntLiteral.as.As.impl.Convert.2, @Core.IntLiteral.as.As.impl.cc4(%To) [symbolic]
  75. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.276: %Core.IntLiteral.as.As.impl.Convert.type.972 = struct_value () [symbolic]
  76. // CHECK:STDOUT: %As.impl_witness.feb: <witness> = impl_witness imports.%As.impl_witness_table.e4e, @Core.IntLiteral.as.As.impl.cc4(%int_64) [concrete]
  77. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.da0: type = fn_type @Core.IntLiteral.as.As.impl.Convert.2, @Core.IntLiteral.as.As.impl.cc4(%int_64) [concrete]
  78. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.467: %Core.IntLiteral.as.As.impl.Convert.type.da0 = struct_value () [concrete]
  79. // CHECK:STDOUT: %As.facet.218: %As.type.465 = facet_value Core.IntLiteral, (%As.impl_witness.feb) [concrete]
  80. // CHECK:STDOUT: %.e88: type = fn_type_with_self_type %As.Convert.type.7eb, %As.facet.218 [concrete]
  81. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.fec: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.467 [concrete]
  82. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn.6f5: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.467, @Core.IntLiteral.as.As.impl.Convert.2(%int_64) [concrete]
  83. // CHECK:STDOUT: %bound_method.290: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn.6f5 [concrete]
  84. // CHECK:STDOUT: %int_1.f23: %u64 = int_value 1 [concrete]
  85. // CHECK:STDOUT: }
  86. // CHECK:STDOUT:
  87. // CHECK:STDOUT: imports {
  88. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  89. // CHECK:STDOUT: .long_long = @F.%i64.1
  90. // CHECK:STDOUT: .unsigned_long_long = @F.%u64.1
  91. // CHECK:STDOUT: import Cpp//...
  92. // CHECK:STDOUT: }
  93. // CHECK:STDOUT: %Core.import_ref.99c: @Core.IntLiteral.as.As.impl.dc4.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.565) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.dc4.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.d2c)]
  94. // CHECK:STDOUT: %As.impl_witness_table.5ad = impl_witness_table (%Core.import_ref.99c), @Core.IntLiteral.as.As.impl.dc4 [concrete]
  95. // CHECK:STDOUT: %Core.import_ref.611: @Core.IntLiteral.as.As.impl.cc4.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.972) = import_ref Core//prelude/parts/uint, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.cc4.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.276)]
  96. // CHECK:STDOUT: %As.impl_witness_table.e4e = impl_witness_table (%Core.import_ref.611), @Core.IntLiteral.as.As.impl.cc4 [concrete]
  97. // CHECK:STDOUT: }
  98. // CHECK:STDOUT:
  99. // CHECK:STDOUT: fn @F() {
  100. // CHECK:STDOUT: !entry:
  101. // CHECK:STDOUT: name_binding_decl {
  102. // CHECK:STDOUT: %cpp_long_long.patt: %pattern_type.95b = binding_pattern cpp_long_long [concrete]
  103. // CHECK:STDOUT: }
  104. // CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  105. // CHECK:STDOUT: %int_64.loc8: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
  106. // CHECK:STDOUT: %i64.loc8: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64]
  107. // CHECK:STDOUT: %impl.elem0.loc8: %.b12 = impl_witness_access constants.%As.impl_witness.4f1, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.fe2]
  108. // CHECK:STDOUT: %bound_method.loc8_41.1: <bound method> = bound_method %int_1.loc8, %impl.elem0.loc8 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.0c0]
  109. // CHECK:STDOUT: %specific_fn.loc8: <specific function> = specific_function %impl.elem0.loc8, @Core.IntLiteral.as.As.impl.Convert.1(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn.96b]
  110. // CHECK:STDOUT: %bound_method.loc8_41.2: <bound method> = bound_method %int_1.loc8, %specific_fn.loc8 [concrete = constants.%bound_method.b11]
  111. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc8: init %i64 = call %bound_method.loc8_41.2(%int_1.loc8) [concrete = constants.%int_1.41a]
  112. // CHECK:STDOUT: %.loc8_41.1: %i64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc8 [concrete = constants.%int_1.41a]
  113. // CHECK:STDOUT: %.loc8_41.2: %i64 = converted %int_1.loc8, %.loc8_41.1 [concrete = constants.%int_1.41a]
  114. // CHECK:STDOUT: %.loc8_26: type = splice_block %long_long.ref [concrete = constants.%i64] {
  115. // CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  116. // CHECK:STDOUT: <elided>
  117. // CHECK:STDOUT: %long_long.ref: type = name_ref long_long, %i64.1 [concrete = constants.%i64]
  118. // CHECK:STDOUT: }
  119. // CHECK:STDOUT: %cpp_long_long: %i64 = bind_name cpp_long_long, %.loc8_41.2
  120. // CHECK:STDOUT: name_binding_decl {
  121. // CHECK:STDOUT: %carbon_long_long.patt: %pattern_type.95b = binding_pattern carbon_long_long [concrete]
  122. // CHECK:STDOUT: }
  123. // CHECK:STDOUT: %cpp_long_long.ref: %i64 = name_ref cpp_long_long, %cpp_long_long
  124. // CHECK:STDOUT: %.loc9: type = splice_block %i64.loc9 [concrete = constants.%i64] {
  125. // CHECK:STDOUT: %int_64.loc9: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
  126. // CHECK:STDOUT: %i64.loc9: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64]
  127. // CHECK:STDOUT: }
  128. // CHECK:STDOUT: %carbon_long_long: %i64 = bind_name carbon_long_long, %cpp_long_long.ref
  129. // CHECK:STDOUT: name_binding_decl {
  130. // CHECK:STDOUT: %cpp_unsigned_long_long.patt: %pattern_type.157 = binding_pattern cpp_unsigned_long_long [concrete]
  131. // CHECK:STDOUT: }
  132. // CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  133. // CHECK:STDOUT: %int_64.loc11: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
  134. // CHECK:STDOUT: %u64.loc11: type = class_type @UInt, @UInt(constants.%int_64) [concrete = constants.%u64]
  135. // CHECK:STDOUT: %impl.elem0.loc11: %.e88 = impl_witness_access constants.%As.impl_witness.feb, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.467]
  136. // CHECK:STDOUT: %bound_method.loc11_59.1: <bound method> = bound_method %int_1.loc11, %impl.elem0.loc11 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.fec]
  137. // CHECK:STDOUT: %specific_fn.loc11: <specific function> = specific_function %impl.elem0.loc11, @Core.IntLiteral.as.As.impl.Convert.2(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn.6f5]
  138. // CHECK:STDOUT: %bound_method.loc11_59.2: <bound method> = bound_method %int_1.loc11, %specific_fn.loc11 [concrete = constants.%bound_method.290]
  139. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc11: init %u64 = call %bound_method.loc11_59.2(%int_1.loc11) [concrete = constants.%int_1.f23]
  140. // CHECK:STDOUT: %.loc11_59.1: %u64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc11 [concrete = constants.%int_1.f23]
  141. // CHECK:STDOUT: %.loc11_59.2: %u64 = converted %int_1.loc11, %.loc11_59.1 [concrete = constants.%int_1.f23]
  142. // CHECK:STDOUT: %.loc11_35: type = splice_block %unsigned_long_long.ref [concrete = constants.%u64] {
  143. // CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  144. // CHECK:STDOUT: <elided>
  145. // CHECK:STDOUT: %unsigned_long_long.ref: type = name_ref unsigned_long_long, %u64.1 [concrete = constants.%u64]
  146. // CHECK:STDOUT: }
  147. // CHECK:STDOUT: %cpp_unsigned_long_long: %u64 = bind_name cpp_unsigned_long_long, %.loc11_59.2
  148. // CHECK:STDOUT: name_binding_decl {
  149. // CHECK:STDOUT: %carbon_unsigned_long_long.patt: %pattern_type.157 = binding_pattern carbon_unsigned_long_long [concrete]
  150. // CHECK:STDOUT: }
  151. // CHECK:STDOUT: %cpp_unsigned_long_long.ref: %u64 = name_ref cpp_unsigned_long_long, %cpp_unsigned_long_long
  152. // CHECK:STDOUT: %.loc12: type = splice_block %u64.loc12 [concrete = constants.%u64] {
  153. // CHECK:STDOUT: %int_64.loc12: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
  154. // CHECK:STDOUT: %u64.loc12: type = class_type @UInt, @UInt(constants.%int_64) [concrete = constants.%u64]
  155. // CHECK:STDOUT: }
  156. // CHECK:STDOUT: %carbon_unsigned_long_long: %u64 = bind_name carbon_unsigned_long_long, %cpp_unsigned_long_long.ref
  157. // CHECK:STDOUT: <elided>
  158. // CHECK:STDOUT: }
  159. // CHECK:STDOUT:
  160. // CHECK:STDOUT: --- fail_todo_unsupported_types.carbon
  161. // CHECK:STDOUT:
  162. // CHECK:STDOUT: constants {
  163. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  164. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete]
  165. // CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [concrete]
  166. // CHECK:STDOUT: %As.type.bbb: type = facet_type <@As, @As(%i64)> [concrete]
  167. // CHECK:STDOUT: %As.Convert.type.d57: type = fn_type @As.Convert, @As(%i64) [concrete]
  168. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  169. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.565: type = fn_type @Core.IntLiteral.as.As.impl.Convert.1, @Core.IntLiteral.as.As.impl.dc4(%To) [symbolic]
  170. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.d2c: %Core.IntLiteral.as.As.impl.Convert.type.565 = struct_value () [symbolic]
  171. // CHECK:STDOUT: %As.impl_witness.4f1: <witness> = impl_witness imports.%As.impl_witness_table.5ad, @Core.IntLiteral.as.As.impl.dc4(%int_64) [concrete]
  172. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.9ac: type = fn_type @Core.IntLiteral.as.As.impl.Convert.1, @Core.IntLiteral.as.As.impl.dc4(%int_64) [concrete]
  173. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.fe2: %Core.IntLiteral.as.As.impl.Convert.type.9ac = struct_value () [concrete]
  174. // CHECK:STDOUT: %As.facet.888: %As.type.bbb = facet_value Core.IntLiteral, (%As.impl_witness.4f1) [concrete]
  175. // CHECK:STDOUT: %.b12: type = fn_type_with_self_type %As.Convert.type.d57, %As.facet.888 [concrete]
  176. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.0c0: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.fe2 [concrete]
  177. // CHECK:STDOUT: %pattern_type.95b: type = pattern_type %i64 [concrete]
  178. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn.96b: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.fe2, @Core.IntLiteral.as.As.impl.Convert.1(%int_64) [concrete]
  179. // CHECK:STDOUT: %bound_method.b11: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn.96b [concrete]
  180. // CHECK:STDOUT: %int_1.41a: %i64 = int_value 1 [concrete]
  181. // CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [concrete]
  182. // CHECK:STDOUT: %As.type.465: type = facet_type <@As, @As(%u64)> [concrete]
  183. // CHECK:STDOUT: %As.Convert.type.7eb: type = fn_type @As.Convert, @As(%u64) [concrete]
  184. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.972: type = fn_type @Core.IntLiteral.as.As.impl.Convert.2, @Core.IntLiteral.as.As.impl.cc4(%To) [symbolic]
  185. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.276: %Core.IntLiteral.as.As.impl.Convert.type.972 = struct_value () [symbolic]
  186. // CHECK:STDOUT: %As.impl_witness.feb: <witness> = impl_witness imports.%As.impl_witness_table.e4e, @Core.IntLiteral.as.As.impl.cc4(%int_64) [concrete]
  187. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.da0: type = fn_type @Core.IntLiteral.as.As.impl.Convert.2, @Core.IntLiteral.as.As.impl.cc4(%int_64) [concrete]
  188. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.467: %Core.IntLiteral.as.As.impl.Convert.type.da0 = struct_value () [concrete]
  189. // CHECK:STDOUT: %As.facet.218: %As.type.465 = facet_value Core.IntLiteral, (%As.impl_witness.feb) [concrete]
  190. // CHECK:STDOUT: %.e88: type = fn_type_with_self_type %As.Convert.type.7eb, %As.facet.218 [concrete]
  191. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.fec: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.467 [concrete]
  192. // CHECK:STDOUT: %pattern_type.157: type = pattern_type %u64 [concrete]
  193. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn.6f5: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.467, @Core.IntLiteral.as.As.impl.Convert.2(%int_64) [concrete]
  194. // CHECK:STDOUT: %bound_method.290: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn.6f5 [concrete]
  195. // CHECK:STDOUT: %int_1.f23: %u64 = int_value 1 [concrete]
  196. // CHECK:STDOUT: }
  197. // CHECK:STDOUT:
  198. // CHECK:STDOUT: imports {
  199. // CHECK:STDOUT: %Core.import_ref.99c: @Core.IntLiteral.as.As.impl.dc4.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.565) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.dc4.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.d2c)]
  200. // CHECK:STDOUT: %As.impl_witness_table.5ad = impl_witness_table (%Core.import_ref.99c), @Core.IntLiteral.as.As.impl.dc4 [concrete]
  201. // CHECK:STDOUT: %Core.import_ref.611: @Core.IntLiteral.as.As.impl.cc4.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.972) = import_ref Core//prelude/parts/uint, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.cc4.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.276)]
  202. // CHECK:STDOUT: %As.impl_witness_table.e4e = impl_witness_table (%Core.import_ref.611), @Core.IntLiteral.as.As.impl.cc4 [concrete]
  203. // CHECK:STDOUT: }
  204. // CHECK:STDOUT:
  205. // CHECK:STDOUT: fn @F() {
  206. // CHECK:STDOUT: !entry:
  207. // CHECK:STDOUT: name_binding_decl {
  208. // CHECK:STDOUT: %cpp_long.patt: <error> = binding_pattern cpp_long [concrete]
  209. // CHECK:STDOUT: }
  210. // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  211. // CHECK:STDOUT: %int_64.loc15: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
  212. // CHECK:STDOUT: %i64.loc15: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64]
  213. // CHECK:STDOUT: %impl.elem0.loc15: %.b12 = impl_witness_access constants.%As.impl_witness.4f1, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.fe2]
  214. // CHECK:STDOUT: %bound_method.loc15_31.1: <bound method> = bound_method %int_1.loc15, %impl.elem0.loc15 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.0c0]
  215. // CHECK:STDOUT: %specific_fn.loc15: <specific function> = specific_function %impl.elem0.loc15, @Core.IntLiteral.as.As.impl.Convert.1(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn.96b]
  216. // CHECK:STDOUT: %bound_method.loc15_31.2: <bound method> = bound_method %int_1.loc15, %specific_fn.loc15 [concrete = constants.%bound_method.b11]
  217. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc15: init %i64 = call %bound_method.loc15_31.2(%int_1.loc15) [concrete = constants.%int_1.41a]
  218. // CHECK:STDOUT: %.loc15_31.1: %i64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc15 [concrete = constants.%int_1.41a]
  219. // CHECK:STDOUT: %.loc15_31.2: %i64 = converted %int_1.loc15, %.loc15_31.1 [concrete = constants.%int_1.41a]
  220. // CHECK:STDOUT: <elided>
  221. // CHECK:STDOUT: %cpp_long: <error> = bind_name cpp_long, <error> [concrete = <error>]
  222. // CHECK:STDOUT: name_binding_decl {
  223. // CHECK:STDOUT: %carbon_long.patt: %pattern_type.95b = binding_pattern carbon_long [concrete]
  224. // CHECK:STDOUT: }
  225. // CHECK:STDOUT: %cpp_long.ref: <error> = name_ref cpp_long, %cpp_long [concrete = <error>]
  226. // CHECK:STDOUT: %.loc16: type = splice_block %i64.loc16 [concrete = constants.%i64] {
  227. // CHECK:STDOUT: %int_64.loc16: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
  228. // CHECK:STDOUT: %i64.loc16: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64]
  229. // CHECK:STDOUT: }
  230. // CHECK:STDOUT: %carbon_long: %i64 = bind_name carbon_long, <error> [concrete = <error>]
  231. // CHECK:STDOUT: name_binding_decl {
  232. // CHECK:STDOUT: %cpp_unsigned_long.patt: <error> = binding_pattern cpp_unsigned_long [concrete]
  233. // CHECK:STDOUT: }
  234. // CHECK:STDOUT: %int_1.loc25: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  235. // CHECK:STDOUT: %int_64.loc25: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
  236. // CHECK:STDOUT: %u64.loc25: type = class_type @UInt, @UInt(constants.%int_64) [concrete = constants.%u64]
  237. // CHECK:STDOUT: %impl.elem0.loc25: %.e88 = impl_witness_access constants.%As.impl_witness.feb, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.467]
  238. // CHECK:STDOUT: %bound_method.loc25_49.1: <bound method> = bound_method %int_1.loc25, %impl.elem0.loc25 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.fec]
  239. // CHECK:STDOUT: %specific_fn.loc25: <specific function> = specific_function %impl.elem0.loc25, @Core.IntLiteral.as.As.impl.Convert.2(constants.%int_64) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn.6f5]
  240. // CHECK:STDOUT: %bound_method.loc25_49.2: <bound method> = bound_method %int_1.loc25, %specific_fn.loc25 [concrete = constants.%bound_method.290]
  241. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc25: init %u64 = call %bound_method.loc25_49.2(%int_1.loc25) [concrete = constants.%int_1.f23]
  242. // CHECK:STDOUT: %.loc25_49.1: %u64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc25 [concrete = constants.%int_1.f23]
  243. // CHECK:STDOUT: %.loc25_49.2: %u64 = converted %int_1.loc25, %.loc25_49.1 [concrete = constants.%int_1.f23]
  244. // CHECK:STDOUT: <elided>
  245. // CHECK:STDOUT: %cpp_unsigned_long: <error> = bind_name cpp_unsigned_long, <error> [concrete = <error>]
  246. // CHECK:STDOUT: name_binding_decl {
  247. // CHECK:STDOUT: %carbon_unsigned_long.patt: %pattern_type.157 = binding_pattern carbon_unsigned_long [concrete]
  248. // CHECK:STDOUT: }
  249. // CHECK:STDOUT: %cpp_unsigned_long.ref: <error> = name_ref cpp_unsigned_long, %cpp_unsigned_long [concrete = <error>]
  250. // CHECK:STDOUT: %.loc26: type = splice_block %u64.loc26 [concrete = constants.%u64] {
  251. // CHECK:STDOUT: %int_64.loc26: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
  252. // CHECK:STDOUT: %u64.loc26: type = class_type @UInt, @UInt(constants.%int_64) [concrete = constants.%u64]
  253. // CHECK:STDOUT: }
  254. // CHECK:STDOUT: %carbon_unsigned_long: %u64 = bind_name carbon_unsigned_long, <error> [concrete = <error>]
  255. // CHECK:STDOUT: <elided>
  256. // CHECK:STDOUT: }
  257. // CHECK:STDOUT: