int_float.carbon 18 KB

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