int_float.carbon 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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/deduce/int_float.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/deduce/int_float.carbon
  10. // --- int.carbon
  11. library "[[@TEST_NAME]]";
  12. fn F[N:! Core.IntLiteral()](n: Core.Int(N)) -> Core.IntLiteral() {
  13. return N;
  14. }
  15. fn G(a: i64) -> Core.IntLiteral() {
  16. return F(a);
  17. }
  18. // --- fail_todo_float.carbon
  19. library "[[@TEST_NAME]]";
  20. // TODO: This should pass once we accept symbolic widths for Core.Float.
  21. // CHECK:STDERR: fail_todo_float.carbon:[[@LINE+4]]:32: error: cannot evaluate type expression [TypeExprEvaluationFailure]
  22. // CHECK:STDERR: fn F[N:! Core.IntLiteral()](n: Core.Float(N)) -> Core.IntLiteral() {
  23. // CHECK:STDERR: ^~~~~~~~~~~~~
  24. // CHECK:STDERR:
  25. fn F[N:! Core.IntLiteral()](n: Core.Float(N)) -> Core.IntLiteral() {
  26. return N;
  27. }
  28. fn G(a: f64) -> Core.IntLiteral() {
  29. return F(a);
  30. }
  31. // CHECK:STDOUT: --- int.carbon
  32. // CHECK:STDOUT:
  33. // CHECK:STDOUT: constants {
  34. // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete]
  35. // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete]
  36. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  37. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic]
  38. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  39. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  40. // CHECK:STDOUT: %Int: type = class_type @Int, @Int(%N) [symbolic]
  41. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  42. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  43. // CHECK:STDOUT: %require_complete.b4f: <witness> = require_complete_type %Int [symbolic]
  44. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete]
  45. // CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [concrete]
  46. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  47. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  48. // CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64 [concrete]
  49. // CHECK:STDOUT: %complete_type.4a1: <witness> = complete_type_witness %i64.builtin [concrete]
  50. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%int_64) [concrete]
  51. // CHECK:STDOUT: }
  52. // CHECK:STDOUT:
  53. // CHECK:STDOUT: imports {
  54. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  55. // CHECK:STDOUT: .IntLiteral = %Core.IntLiteral
  56. // CHECK:STDOUT: .Int = %Core.Int
  57. // CHECK:STDOUT: import Core//prelude
  58. // CHECK:STDOUT: import Core//prelude/...
  59. // CHECK:STDOUT: }
  60. // CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral]
  61. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
  62. // CHECK:STDOUT: }
  63. // CHECK:STDOUT:
  64. // CHECK:STDOUT: file {
  65. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  66. // CHECK:STDOUT: .Core = imports.%Core
  67. // CHECK:STDOUT: .F = %F.decl
  68. // CHECK:STDOUT: .G = %G.decl
  69. // CHECK:STDOUT: }
  70. // CHECK:STDOUT: %Core.import = import Core
  71. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  72. // CHECK:STDOUT: %N.patt.loc4_6.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_6.2 (constants.%N.patt)]
  73. // CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc4_6.1, runtime_param<none> [symbolic = %N.patt.loc4_6.2 (constants.%N.patt)]
  74. // CHECK:STDOUT: %n.patt: @F.%Int.loc4_42.2 (%Int) = binding_pattern n
  75. // CHECK:STDOUT: %n.param_patt: @F.%Int.loc4_42.2 (%Int) = value_param_pattern %n.patt, runtime_param0
  76. // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern
  77. // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1
  78. // CHECK:STDOUT: } {
  79. // CHECK:STDOUT: %Core.ref.loc4_48: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  80. // CHECK:STDOUT: %IntLiteral.ref.loc4_52: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
  81. // CHECK:STDOUT: %int_literal.make_type.loc4_64: init type = call %IntLiteral.ref.loc4_52() [concrete = Core.IntLiteral]
  82. // CHECK:STDOUT: %.loc4_64.1: type = value_of_initializer %int_literal.make_type.loc4_64 [concrete = Core.IntLiteral]
  83. // CHECK:STDOUT: %.loc4_64.2: type = converted %int_literal.make_type.loc4_64, %.loc4_64.1 [concrete = Core.IntLiteral]
  84. // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param<none>
  85. // CHECK:STDOUT: %.loc4_26.1: type = splice_block %.loc4_26.3 [concrete = Core.IntLiteral] {
  86. // CHECK:STDOUT: %Core.ref.loc4_10: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  87. // CHECK:STDOUT: %IntLiteral.ref.loc4_14: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
  88. // CHECK:STDOUT: %int_literal.make_type.loc4_26: init type = call %IntLiteral.ref.loc4_14() [concrete = Core.IntLiteral]
  89. // CHECK:STDOUT: %.loc4_26.2: type = value_of_initializer %int_literal.make_type.loc4_26 [concrete = Core.IntLiteral]
  90. // CHECK:STDOUT: %.loc4_26.3: type = converted %int_literal.make_type.loc4_26, %.loc4_26.2 [concrete = Core.IntLiteral]
  91. // CHECK:STDOUT: }
  92. // CHECK:STDOUT: %N.loc4_6.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_6.2 (constants.%N)]
  93. // CHECK:STDOUT: %n.param: @F.%Int.loc4_42.2 (%Int) = value_param runtime_param0
  94. // CHECK:STDOUT: %.loc4_42: type = splice_block %Int.loc4_42.1 [symbolic = %Int.loc4_42.2 (constants.%Int)] {
  95. // CHECK:STDOUT: %Core.ref.loc4_32: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  96. // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic]
  97. // CHECK:STDOUT: %N.ref.loc4: Core.IntLiteral = name_ref N, %N.loc4_6.1 [symbolic = %N.loc4_6.2 (constants.%N)]
  98. // CHECK:STDOUT: %Int.loc4_42.1: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc4_42.2 (constants.%Int)]
  99. // CHECK:STDOUT: }
  100. // CHECK:STDOUT: %n: @F.%Int.loc4_42.2 (%Int) = bind_name n, %n.param
  101. // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1
  102. // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param
  103. // CHECK:STDOUT: }
  104. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  105. // CHECK:STDOUT: %a.patt: %i64 = binding_pattern a
  106. // CHECK:STDOUT: %a.param_patt: %i64 = value_param_pattern %a.patt, runtime_param0
  107. // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern
  108. // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1
  109. // CHECK:STDOUT: } {
  110. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  111. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
  112. // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
  113. // CHECK:STDOUT: %.loc8_33.1: type = value_of_initializer %int_literal.make_type [concrete = Core.IntLiteral]
  114. // CHECK:STDOUT: %.loc8_33.2: type = converted %int_literal.make_type, %.loc8_33.1 [concrete = Core.IntLiteral]
  115. // CHECK:STDOUT: %a.param: %i64 = value_param runtime_param0
  116. // CHECK:STDOUT: %.loc8_9: type = splice_block %i64 [concrete = constants.%i64] {
  117. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
  118. // CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64]
  119. // CHECK:STDOUT: }
  120. // CHECK:STDOUT: %a: %i64 = bind_name a, %a.param
  121. // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1
  122. // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param
  123. // CHECK:STDOUT: }
  124. // CHECK:STDOUT: }
  125. // CHECK:STDOUT:
  126. // CHECK:STDOUT: generic fn @F(%N.loc4_6.1: Core.IntLiteral) {
  127. // CHECK:STDOUT: %N.loc4_6.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc4_6.2 (constants.%N)]
  128. // CHECK:STDOUT: %N.patt.loc4_6.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_6.2 (constants.%N.patt)]
  129. // CHECK:STDOUT: %Int.loc4_42.2: type = class_type @Int, @Int(%N.loc4_6.2) [symbolic = %Int.loc4_42.2 (constants.%Int)]
  130. // CHECK:STDOUT:
  131. // CHECK:STDOUT: !definition:
  132. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @F.%Int.loc4_42.2 (%Int) [symbolic = %require_complete (constants.%require_complete.b4f)]
  133. // CHECK:STDOUT:
  134. // CHECK:STDOUT: fn[%N.param_patt: Core.IntLiteral](%n.param_patt: @F.%Int.loc4_42.2 (%Int)) -> Core.IntLiteral {
  135. // CHECK:STDOUT: !entry:
  136. // CHECK:STDOUT: %N.ref.loc5: Core.IntLiteral = name_ref N, %N.loc4_6.1 [symbolic = %N.loc4_6.2 (constants.%N)]
  137. // CHECK:STDOUT: return %N.ref.loc5
  138. // CHECK:STDOUT: }
  139. // CHECK:STDOUT: }
  140. // CHECK:STDOUT:
  141. // CHECK:STDOUT: fn @G(%a.param_patt: %i64) -> Core.IntLiteral {
  142. // CHECK:STDOUT: !entry:
  143. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  144. // CHECK:STDOUT: %a.ref: %i64 = name_ref a, %a
  145. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%int_64) [concrete = constants.%F.specific_fn]
  146. // CHECK:STDOUT: %F.call: init Core.IntLiteral = call %F.specific_fn(%a.ref)
  147. // CHECK:STDOUT: %.loc9_14.1: Core.IntLiteral = value_of_initializer %F.call
  148. // CHECK:STDOUT: %.loc9_14.2: Core.IntLiteral = converted %F.call, %.loc9_14.1
  149. // CHECK:STDOUT: return %.loc9_14.2
  150. // CHECK:STDOUT: }
  151. // CHECK:STDOUT:
  152. // CHECK:STDOUT: specific @F(constants.%N) {
  153. // CHECK:STDOUT: %N.loc4_6.2 => constants.%N
  154. // CHECK:STDOUT: %N.patt.loc4_6.2 => constants.%N
  155. // CHECK:STDOUT: %Int.loc4_42.2 => constants.%Int
  156. // CHECK:STDOUT: }
  157. // CHECK:STDOUT:
  158. // CHECK:STDOUT: specific @F(constants.%int_64) {
  159. // CHECK:STDOUT: %N.loc4_6.2 => constants.%int_64
  160. // CHECK:STDOUT: %N.patt.loc4_6.2 => constants.%int_64
  161. // CHECK:STDOUT: %Int.loc4_42.2 => constants.%i64
  162. // CHECK:STDOUT:
  163. // CHECK:STDOUT: !definition:
  164. // CHECK:STDOUT: %require_complete => constants.%complete_type.4a1
  165. // CHECK:STDOUT: }
  166. // CHECK:STDOUT:
  167. // CHECK:STDOUT: --- fail_todo_float.carbon
  168. // CHECK:STDOUT:
  169. // CHECK:STDOUT: constants {
  170. // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete]
  171. // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete]
  172. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  173. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic]
  174. // CHECK:STDOUT: %Float.type: type = fn_type @Float [concrete]
  175. // CHECK:STDOUT: %Float: %Float.type = struct_value () [concrete]
  176. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  177. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  178. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete]
  179. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  180. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  181. // CHECK:STDOUT: }
  182. // CHECK:STDOUT:
  183. // CHECK:STDOUT: imports {
  184. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  185. // CHECK:STDOUT: .IntLiteral = %Core.IntLiteral
  186. // CHECK:STDOUT: .Float = %Core.Float
  187. // CHECK:STDOUT: import Core//prelude
  188. // CHECK:STDOUT: import Core//prelude/...
  189. // CHECK:STDOUT: }
  190. // CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/types/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral]
  191. // CHECK:STDOUT: %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
  192. // CHECK:STDOUT: }
  193. // CHECK:STDOUT:
  194. // CHECK:STDOUT: file {
  195. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  196. // CHECK:STDOUT: .Core = imports.%Core
  197. // CHECK:STDOUT: .F = %F.decl
  198. // CHECK:STDOUT: .G = %G.decl
  199. // CHECK:STDOUT: }
  200. // CHECK:STDOUT: %Core.import = import Core
  201. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  202. // CHECK:STDOUT: %N.patt.loc9_6.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc9_6.2 (constants.%N.patt)]
  203. // CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc9_6.1, runtime_param<none> [symbolic = %N.patt.loc9_6.2 (constants.%N.patt)]
  204. // CHECK:STDOUT: %n.patt: <error> = binding_pattern n
  205. // CHECK:STDOUT: %n.param_patt: <error> = value_param_pattern %n.patt, runtime_param0
  206. // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern
  207. // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1
  208. // CHECK:STDOUT: } {
  209. // CHECK:STDOUT: %Core.ref.loc9_50: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  210. // CHECK:STDOUT: %IntLiteral.ref.loc9_54: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
  211. // CHECK:STDOUT: %int_literal.make_type.loc9_66: init type = call %IntLiteral.ref.loc9_54() [concrete = Core.IntLiteral]
  212. // CHECK:STDOUT: %.loc9_66.1: type = value_of_initializer %int_literal.make_type.loc9_66 [concrete = Core.IntLiteral]
  213. // CHECK:STDOUT: %.loc9_66.2: type = converted %int_literal.make_type.loc9_66, %.loc9_66.1 [concrete = Core.IntLiteral]
  214. // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param<none>
  215. // CHECK:STDOUT: %.loc9_26.1: type = splice_block %.loc9_26.3 [concrete = Core.IntLiteral] {
  216. // CHECK:STDOUT: %Core.ref.loc9_10: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  217. // CHECK:STDOUT: %IntLiteral.ref.loc9_14: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
  218. // CHECK:STDOUT: %int_literal.make_type.loc9_26: init type = call %IntLiteral.ref.loc9_14() [concrete = Core.IntLiteral]
  219. // CHECK:STDOUT: %.loc9_26.2: type = value_of_initializer %int_literal.make_type.loc9_26 [concrete = Core.IntLiteral]
  220. // CHECK:STDOUT: %.loc9_26.3: type = converted %int_literal.make_type.loc9_26, %.loc9_26.2 [concrete = Core.IntLiteral]
  221. // CHECK:STDOUT: }
  222. // CHECK:STDOUT: %N.loc9_6.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc9_6.2 (constants.%N)]
  223. // CHECK:STDOUT: %n.param: <error> = value_param runtime_param0
  224. // CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
  225. // CHECK:STDOUT: %Core.ref.loc9_32: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  226. // CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, imports.%Core.Float [concrete = constants.%Float]
  227. // CHECK:STDOUT: %N.ref.loc9: Core.IntLiteral = name_ref N, %N.loc9_6.1 [symbolic = %N.loc9_6.2 (constants.%N)]
  228. // CHECK:STDOUT: %float.make_type: init type = call %Float.ref(%N.ref.loc9)
  229. // CHECK:STDOUT: %.loc9_44.1: type = value_of_initializer %float.make_type
  230. // CHECK:STDOUT: %.loc9_44.2: type = converted %float.make_type, %.loc9_44.1
  231. // CHECK:STDOUT: }
  232. // CHECK:STDOUT: %n: <error> = bind_name n, %n.param
  233. // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1
  234. // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param
  235. // CHECK:STDOUT: }
  236. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  237. // CHECK:STDOUT: %a.patt: f64 = binding_pattern a
  238. // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0
  239. // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern
  240. // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1
  241. // CHECK:STDOUT: } {
  242. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  243. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
  244. // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
  245. // CHECK:STDOUT: %.loc13_33.1: type = value_of_initializer %int_literal.make_type [concrete = Core.IntLiteral]
  246. // CHECK:STDOUT: %.loc13_33.2: type = converted %int_literal.make_type, %.loc13_33.1 [concrete = Core.IntLiteral]
  247. // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0
  248. // CHECK:STDOUT: %.loc13_9.1: type = splice_block %.loc13_9.3 [concrete = f64] {
  249. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
  250. // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [concrete = f64]
  251. // CHECK:STDOUT: %.loc13_9.2: type = value_of_initializer %float.make_type [concrete = f64]
  252. // CHECK:STDOUT: %.loc13_9.3: type = converted %float.make_type, %.loc13_9.2 [concrete = f64]
  253. // CHECK:STDOUT: }
  254. // CHECK:STDOUT: %a: f64 = bind_name a, %a.param
  255. // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1
  256. // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param
  257. // CHECK:STDOUT: }
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT:
  260. // CHECK:STDOUT: generic fn @F(%N.loc9_6.1: Core.IntLiteral) {
  261. // CHECK:STDOUT: %N.loc9_6.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc9_6.2 (constants.%N)]
  262. // CHECK:STDOUT: %N.patt.loc9_6.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc9_6.2 (constants.%N.patt)]
  263. // CHECK:STDOUT:
  264. // CHECK:STDOUT: !definition:
  265. // CHECK:STDOUT:
  266. // CHECK:STDOUT: fn[%N.param_patt: Core.IntLiteral](%n.param_patt: <error>) -> Core.IntLiteral {
  267. // CHECK:STDOUT: !entry:
  268. // CHECK:STDOUT: %N.ref.loc10: Core.IntLiteral = name_ref N, %N.loc9_6.1 [symbolic = %N.loc9_6.2 (constants.%N)]
  269. // CHECK:STDOUT: return %N.ref.loc10
  270. // CHECK:STDOUT: }
  271. // CHECK:STDOUT: }
  272. // CHECK:STDOUT:
  273. // CHECK:STDOUT: fn @G(%a.param_patt: f64) -> Core.IntLiteral {
  274. // CHECK:STDOUT: !entry:
  275. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  276. // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a
  277. // CHECK:STDOUT: return <error>
  278. // CHECK:STDOUT: }
  279. // CHECK:STDOUT:
  280. // CHECK:STDOUT: specific @F(constants.%N) {
  281. // CHECK:STDOUT: %N.loc9_6.2 => constants.%N
  282. // CHECK:STDOUT: %N.patt.loc9_6.2 => constants.%N
  283. // CHECK:STDOUT: }
  284. // CHECK:STDOUT: