builtins.lp64.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-linux-gnu
  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.lp64.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.lp64.carbon
  13. // --- supported_types.carbon
  14. library "[[@TEST_NAME]]";
  15. import Cpp;
  16. fn F() {
  17. //@dump-sem-ir-begin
  18. let cpp_long : Cpp.long = 1 as i64;
  19. let carbon_long: i64 = cpp_long;
  20. let cpp_unsigned_long : Cpp.unsigned_long = 1 as u64;
  21. let carbon_unsigned_long: u64 = cpp_unsigned_long;
  22. //@dump-sem-ir-end
  23. }
  24. // --- fail_todo_unsupported_types.carbon
  25. library "[[@TEST_NAME]]";
  26. import Cpp;
  27. fn F() {
  28. //@dump-sem-ir-begin
  29. // CHECK:STDERR: fail_todo_unsupported_types.carbon:[[@LINE+7]]:23: error: semantics TODO: `Unsupported: builtin type: long long` [SemanticsTodo]
  30. // CHECK:STDERR: let cpp_long_long : Cpp.long_long = 1 as i64;
  31. // CHECK:STDERR: ^~~~~~~~~~~~~
  32. // CHECK:STDERR: fail_todo_unsupported_types.carbon:[[@LINE+4]]:23: note: in `Cpp` name lookup for `long_long` [InCppNameLookup]
  33. // CHECK:STDERR: let cpp_long_long : Cpp.long_long = 1 as i64;
  34. // CHECK:STDERR: ^~~~~~~~~~~~~
  35. // CHECK:STDERR:
  36. let cpp_long_long : Cpp.long_long = 1 as i64;
  37. let carbon_long_long: i64 = cpp_long_long;
  38. // CHECK:STDERR: fail_todo_unsupported_types.carbon:[[@LINE+7]]:32: error: semantics TODO: `Unsupported: builtin type: unsigned long long` [SemanticsTodo]
  39. // CHECK:STDERR: let cpp_unsigned_long_long : Cpp.unsigned_long_long = 1 as u64;
  40. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
  41. // CHECK:STDERR: fail_todo_unsupported_types.carbon:[[@LINE+4]]:32: note: in `Cpp` name lookup for `unsigned_long_long` [InCppNameLookup]
  42. // CHECK:STDERR: let cpp_unsigned_long_long : Cpp.unsigned_long_long = 1 as u64;
  43. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
  44. // CHECK:STDERR:
  45. let cpp_unsigned_long_long : Cpp.unsigned_long_long = 1 as u64;
  46. let carbon_unsigned_long_long: u64 = cpp_unsigned_long_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 = symbolic_binding To, 0 [symbolic]
  59. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.0fd: type = fn_type @Core.IntLiteral.as.As.impl.Convert.1, @Core.IntLiteral.as.As.impl.863(%To) [symbolic]
  60. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.2b1: %Core.IntLiteral.as.As.impl.Convert.type.0fd = struct_value () [symbolic]
  61. // CHECK:STDOUT: %As.impl_witness.c40: <witness> = impl_witness imports.%As.impl_witness_table.251, @Core.IntLiteral.as.As.impl.863(%int_64) [concrete]
  62. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.4f0: type = fn_type @Core.IntLiteral.as.As.impl.Convert.1, @Core.IntLiteral.as.As.impl.863(%int_64) [concrete]
  63. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.108: %Core.IntLiteral.as.As.impl.Convert.type.4f0 = struct_value () [concrete]
  64. // CHECK:STDOUT: %As.facet.2cd: %As.type.bbb = facet_value Core.IntLiteral, (%As.impl_witness.c40) [concrete]
  65. // CHECK:STDOUT: %.277: type = fn_type_with_self_type %As.Convert.type.d57, %As.facet.2cd [concrete]
  66. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.373: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.108 [concrete]
  67. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn.83e: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.108, @Core.IntLiteral.as.As.impl.Convert.1(%int_64) [concrete]
  68. // CHECK:STDOUT: %bound_method.c84: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn.83e [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.56b: type = fn_type @Core.IntLiteral.as.As.impl.Convert.2, @Core.IntLiteral.as.As.impl.38a(%To) [symbolic]
  75. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.02d: %Core.IntLiteral.as.As.impl.Convert.type.56b = struct_value () [symbolic]
  76. // CHECK:STDOUT: %As.impl_witness.ed2: <witness> = impl_witness imports.%As.impl_witness_table.a7d, @Core.IntLiteral.as.As.impl.38a(%int_64) [concrete]
  77. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.422: type = fn_type @Core.IntLiteral.as.As.impl.Convert.2, @Core.IntLiteral.as.As.impl.38a(%int_64) [concrete]
  78. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.a09: %Core.IntLiteral.as.As.impl.Convert.type.422 = struct_value () [concrete]
  79. // CHECK:STDOUT: %As.facet.bf5: %As.type.465 = facet_value Core.IntLiteral, (%As.impl_witness.ed2) [concrete]
  80. // CHECK:STDOUT: %.5b8: type = fn_type_with_self_type %As.Convert.type.7eb, %As.facet.bf5 [concrete]
  81. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.eb8: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.a09 [concrete]
  82. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn.009: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.a09, @Core.IntLiteral.as.As.impl.Convert.2(%int_64) [concrete]
  83. // CHECK:STDOUT: %bound_method.bb9: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn.009 [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 = @F.%i64.1
  90. // CHECK:STDOUT: .unsigned_long = @F.%u64.1
  91. // CHECK:STDOUT: import Cpp//...
  92. // CHECK:STDOUT: }
  93. // CHECK:STDOUT: %Core.import_ref.05d: @Core.IntLiteral.as.As.impl.863.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.0fd) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.863.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.2b1)]
  94. // CHECK:STDOUT: %As.impl_witness_table.251 = impl_witness_table (%Core.import_ref.05d), @Core.IntLiteral.as.As.impl.863 [concrete]
  95. // CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.As.impl.38a.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.56b) = import_ref Core//prelude/parts/uint, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.38a.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.02d)]
  96. // CHECK:STDOUT: %As.impl_witness_table.a7d = impl_witness_table (%Core.import_ref.7bb), @Core.IntLiteral.as.As.impl.38a [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.patt: %pattern_type.95b = value_binding_pattern cpp_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: %.277 = impl_witness_access constants.%As.impl_witness.c40, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.108]
  108. // CHECK:STDOUT: %bound_method.loc8_31.1: <bound method> = bound_method %int_1.loc8, %impl.elem0.loc8 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.373]
  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.83e]
  110. // CHECK:STDOUT: %bound_method.loc8_31.2: <bound method> = bound_method %int_1.loc8, %specific_fn.loc8 [concrete = constants.%bound_method.c84]
  111. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc8: init %i64 = call %bound_method.loc8_31.2(%int_1.loc8) [concrete = constants.%int_1.41a]
  112. // CHECK:STDOUT: %.loc8_31.1: %i64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc8 [concrete = constants.%int_1.41a]
  113. // CHECK:STDOUT: %.loc8_31.2: %i64 = converted %int_1.loc8, %.loc8_31.1 [concrete = constants.%int_1.41a]
  114. // CHECK:STDOUT: %.loc8_21: type = splice_block %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.ref: type = name_ref long, %i64.1 [concrete = constants.%i64]
  118. // CHECK:STDOUT: }
  119. // CHECK:STDOUT: %cpp_long: %i64 = value_binding cpp_long, %.loc8_31.2
  120. // CHECK:STDOUT: name_binding_decl {
  121. // CHECK:STDOUT: %carbon_long.patt: %pattern_type.95b = value_binding_pattern carbon_long [concrete]
  122. // CHECK:STDOUT: }
  123. // CHECK:STDOUT: %cpp_long.ref: %i64 = name_ref cpp_long, %cpp_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: %i64 = value_binding carbon_long, %cpp_long.ref
  129. // CHECK:STDOUT: name_binding_decl {
  130. // CHECK:STDOUT: %cpp_unsigned_long.patt: %pattern_type.157 = value_binding_pattern cpp_unsigned_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: %.5b8 = impl_witness_access constants.%As.impl_witness.ed2, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.a09]
  136. // CHECK:STDOUT: %bound_method.loc11_49.1: <bound method> = bound_method %int_1.loc11, %impl.elem0.loc11 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.eb8]
  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.009]
  138. // CHECK:STDOUT: %bound_method.loc11_49.2: <bound method> = bound_method %int_1.loc11, %specific_fn.loc11 [concrete = constants.%bound_method.bb9]
  139. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc11: init %u64 = call %bound_method.loc11_49.2(%int_1.loc11) [concrete = constants.%int_1.f23]
  140. // CHECK:STDOUT: %.loc11_49.1: %u64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc11 [concrete = constants.%int_1.f23]
  141. // CHECK:STDOUT: %.loc11_49.2: %u64 = converted %int_1.loc11, %.loc11_49.1 [concrete = constants.%int_1.f23]
  142. // CHECK:STDOUT: %.loc11_30: type = splice_block %unsigned_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.ref: type = name_ref unsigned_long, %u64.1 [concrete = constants.%u64]
  146. // CHECK:STDOUT: }
  147. // CHECK:STDOUT: %cpp_unsigned_long: %u64 = value_binding cpp_unsigned_long, %.loc11_49.2
  148. // CHECK:STDOUT: name_binding_decl {
  149. // CHECK:STDOUT: %carbon_unsigned_long.patt: %pattern_type.157 = value_binding_pattern carbon_unsigned_long [concrete]
  150. // CHECK:STDOUT: }
  151. // CHECK:STDOUT: %cpp_unsigned_long.ref: %u64 = name_ref cpp_unsigned_long, %cpp_unsigned_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: %u64 = value_binding carbon_unsigned_long, %cpp_unsigned_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 = symbolic_binding To, 0 [symbolic]
  169. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.0fd: type = fn_type @Core.IntLiteral.as.As.impl.Convert.1, @Core.IntLiteral.as.As.impl.863(%To) [symbolic]
  170. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.2b1: %Core.IntLiteral.as.As.impl.Convert.type.0fd = struct_value () [symbolic]
  171. // CHECK:STDOUT: %As.impl_witness.c40: <witness> = impl_witness imports.%As.impl_witness_table.251, @Core.IntLiteral.as.As.impl.863(%int_64) [concrete]
  172. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.4f0: type = fn_type @Core.IntLiteral.as.As.impl.Convert.1, @Core.IntLiteral.as.As.impl.863(%int_64) [concrete]
  173. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.108: %Core.IntLiteral.as.As.impl.Convert.type.4f0 = struct_value () [concrete]
  174. // CHECK:STDOUT: %As.facet.2cd: %As.type.bbb = facet_value Core.IntLiteral, (%As.impl_witness.c40) [concrete]
  175. // CHECK:STDOUT: %.277: type = fn_type_with_self_type %As.Convert.type.d57, %As.facet.2cd [concrete]
  176. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.373: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.108 [concrete]
  177. // CHECK:STDOUT: %pattern_type.95b: type = pattern_type %i64 [concrete]
  178. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn.83e: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.108, @Core.IntLiteral.as.As.impl.Convert.1(%int_64) [concrete]
  179. // CHECK:STDOUT: %bound_method.c84: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn.83e [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.56b: type = fn_type @Core.IntLiteral.as.As.impl.Convert.2, @Core.IntLiteral.as.As.impl.38a(%To) [symbolic]
  185. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.02d: %Core.IntLiteral.as.As.impl.Convert.type.56b = struct_value () [symbolic]
  186. // CHECK:STDOUT: %As.impl_witness.ed2: <witness> = impl_witness imports.%As.impl_witness_table.a7d, @Core.IntLiteral.as.As.impl.38a(%int_64) [concrete]
  187. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.422: type = fn_type @Core.IntLiteral.as.As.impl.Convert.2, @Core.IntLiteral.as.As.impl.38a(%int_64) [concrete]
  188. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.a09: %Core.IntLiteral.as.As.impl.Convert.type.422 = struct_value () [concrete]
  189. // CHECK:STDOUT: %As.facet.bf5: %As.type.465 = facet_value Core.IntLiteral, (%As.impl_witness.ed2) [concrete]
  190. // CHECK:STDOUT: %.5b8: type = fn_type_with_self_type %As.Convert.type.7eb, %As.facet.bf5 [concrete]
  191. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.eb8: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.a09 [concrete]
  192. // CHECK:STDOUT: %pattern_type.157: type = pattern_type %u64 [concrete]
  193. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn.009: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.a09, @Core.IntLiteral.as.As.impl.Convert.2(%int_64) [concrete]
  194. // CHECK:STDOUT: %bound_method.bb9: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn.009 [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.05d: @Core.IntLiteral.as.As.impl.863.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.0fd) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.863.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.2b1)]
  200. // CHECK:STDOUT: %As.impl_witness_table.251 = impl_witness_table (%Core.import_ref.05d), @Core.IntLiteral.as.As.impl.863 [concrete]
  201. // CHECK:STDOUT: %Core.import_ref.7bb: @Core.IntLiteral.as.As.impl.38a.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.56b) = import_ref Core//prelude/parts/uint, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.38a.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.02d)]
  202. // CHECK:STDOUT: %As.impl_witness_table.a7d = impl_witness_table (%Core.import_ref.7bb), @Core.IntLiteral.as.As.impl.38a [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_long.patt: <error> = value_binding_pattern cpp_long_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: %.277 = impl_witness_access constants.%As.impl_witness.c40, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.108]
  214. // CHECK:STDOUT: %bound_method.loc15_41.1: <bound method> = bound_method %int_1.loc15, %impl.elem0.loc15 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.373]
  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.83e]
  216. // CHECK:STDOUT: %bound_method.loc15_41.2: <bound method> = bound_method %int_1.loc15, %specific_fn.loc15 [concrete = constants.%bound_method.c84]
  217. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc15: init %i64 = call %bound_method.loc15_41.2(%int_1.loc15) [concrete = constants.%int_1.41a]
  218. // CHECK:STDOUT: %.loc15_41.1: %i64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc15 [concrete = constants.%int_1.41a]
  219. // CHECK:STDOUT: %.loc15_41.2: %i64 = converted %int_1.loc15, %.loc15_41.1 [concrete = constants.%int_1.41a]
  220. // CHECK:STDOUT: <elided>
  221. // CHECK:STDOUT: %cpp_long_long: <error> = value_binding cpp_long_long, <error> [concrete = <error>]
  222. // CHECK:STDOUT: name_binding_decl {
  223. // CHECK:STDOUT: %carbon_long_long.patt: %pattern_type.95b = value_binding_pattern carbon_long_long [concrete]
  224. // CHECK:STDOUT: }
  225. // CHECK:STDOUT: %cpp_long_long.ref: <error> = name_ref cpp_long_long, %cpp_long_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_long: %i64 = value_binding carbon_long_long, <error> [concrete = <error>]
  231. // CHECK:STDOUT: name_binding_decl {
  232. // CHECK:STDOUT: %cpp_unsigned_long_long.patt: <error> = value_binding_pattern cpp_unsigned_long_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: %.5b8 = impl_witness_access constants.%As.impl_witness.ed2, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.a09]
  238. // CHECK:STDOUT: %bound_method.loc25_59.1: <bound method> = bound_method %int_1.loc25, %impl.elem0.loc25 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.eb8]
  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.009]
  240. // CHECK:STDOUT: %bound_method.loc25_59.2: <bound method> = bound_method %int_1.loc25, %specific_fn.loc25 [concrete = constants.%bound_method.bb9]
  241. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc25: init %u64 = call %bound_method.loc25_59.2(%int_1.loc25) [concrete = constants.%int_1.f23]
  242. // CHECK:STDOUT: %.loc25_59.1: %u64 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc25 [concrete = constants.%int_1.f23]
  243. // CHECK:STDOUT: %.loc25_59.2: %u64 = converted %int_1.loc25, %.loc25_59.1 [concrete = constants.%int_1.f23]
  244. // CHECK:STDOUT: <elided>
  245. // CHECK:STDOUT: %cpp_unsigned_long_long: <error> = value_binding cpp_unsigned_long_long, <error> [concrete = <error>]
  246. // CHECK:STDOUT: name_binding_decl {
  247. // CHECK:STDOUT: %carbon_unsigned_long_long.patt: %pattern_type.157 = value_binding_pattern carbon_unsigned_long_long [concrete]
  248. // CHECK:STDOUT: }
  249. // CHECK:STDOUT: %cpp_unsigned_long_long.ref: <error> = name_ref cpp_unsigned_long_long, %cpp_unsigned_long_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_long: %u64 = value_binding carbon_unsigned_long_long, <error> [concrete = <error>]
  255. // CHECK:STDOUT: <elided>
  256. // CHECK:STDOUT: }
  257. // CHECK:STDOUT: