mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 06:21:04 +01:00
The offsets were originally added to deal with churn from builtins in the raw semir. In textual semir, we mostly see instruction IDs for imports, and builtins have also settled down more. On imports, where possible, use the `EntityNameId` for an import instead of printing an instruction. Next, show the source location if we have a node. Only show the instruction if there's no location. This also exposes `Parse::Tree` and `TokenizedBuffer`, so that we can pass a `SemIR::File` without the component parts. In particular this allows us to get the `TokenizedBuffer` for import IRs without substantial structural modifications. We may want to make these optional for serialized `SemIR` later, but the nodes/tokens contain source location, which we'd need for debug information -- so it's not clear how much we can really make them optional without substantial information loss. Reduce arguments to just `File` in a few spots, as a result of the accompanying `TokenizedBuffer` and `Parse::Tree`. Also updates style to pass around `const File*` where the reference is maintained, instead of `const File&`. I was considering keeping a direct reference to the tree and tokens on `Context`, but initially my thought was it wouldn't make much difference. I can re-add those if desired, just as direct caching of the `File` fields.
280 lines
18 KiB
Plaintext
280 lines
18 KiB
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// AUTOUPDATE
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/deduce/int_float.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/deduce/int_float.carbon
|
|
|
|
// --- int.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
fn F[N:! Core.IntLiteral()](n: Core.Int(N)) -> Core.IntLiteral() {
|
|
return N;
|
|
}
|
|
|
|
fn G(a: i64) -> Core.IntLiteral() {
|
|
return F(a);
|
|
}
|
|
|
|
// --- fail_todo_float.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
// TODO: This should pass once we accept symbolic widths for Core.Float.
|
|
// CHECK:STDERR: fail_todo_float.carbon:[[@LINE+3]]:32: error: cannot evaluate type expression [TypeExprEvaluationFailure]
|
|
// CHECK:STDERR: fn F[N:! Core.IntLiteral()](n: Core.Float(N)) -> Core.IntLiteral() {
|
|
// CHECK:STDERR: ^~~~~~~~~~~~~
|
|
fn F[N:! Core.IntLiteral()](n: Core.Float(N)) -> Core.IntLiteral() {
|
|
return N;
|
|
}
|
|
|
|
fn G(a: f64) -> Core.IntLiteral() {
|
|
return F(a);
|
|
}
|
|
|
|
// CHECK:STDOUT: --- int.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template]
|
|
// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template]
|
|
// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
|
|
// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic]
|
|
// CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
|
|
// CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
|
|
// CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic]
|
|
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
|
|
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
|
|
// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template]
|
|
// CHECK:STDOUT: %i64: type = int_type signed, %int_64 [template]
|
|
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
|
|
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
|
|
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%int_64) [template]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
|
// CHECK:STDOUT: .IntLiteral = %import_ref.1
|
|
// CHECK:STDOUT: .Int = %import_ref.2
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types, IntLiteral, loaded [template = constants.%IntLiteral]
|
|
// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types, Int, loaded [template = constants.%Int]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .F = %F.decl
|
|
// CHECK:STDOUT: .G = %G.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
|
|
// CHECK:STDOUT: %N.patt.loc4_6.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_6.2 (constants.%N.patt)]
|
|
// CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc4_6.1, runtime_param<invalid> [symbolic = %N.patt.loc4_6.2 (constants.%N.patt)]
|
|
// CHECK:STDOUT: %n.patt: @F.%iN (%iN) = binding_pattern n
|
|
// CHECK:STDOUT: %n.param_patt: @F.%iN (%iN) = value_param_pattern %n.patt, runtime_param0
|
|
// CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern
|
|
// CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %Core.ref.loc4_10: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
|
// CHECK:STDOUT: %IntLiteral.ref.loc4_14: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral]
|
|
// CHECK:STDOUT: %int_literal.make_type.loc4_26: init type = call %IntLiteral.ref.loc4_14() [template = Core.IntLiteral]
|
|
// CHECK:STDOUT: %.loc4_26.1: type = value_of_initializer %int_literal.make_type.loc4_26 [template = Core.IntLiteral]
|
|
// CHECK:STDOUT: %.loc4_26.2: type = converted %int_literal.make_type.loc4_26, %.loc4_26.1 [template = Core.IntLiteral]
|
|
// CHECK:STDOUT: %Core.ref.loc4_32: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
|
// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int]
|
|
// CHECK:STDOUT: %N.ref.loc4: Core.IntLiteral = name_ref N, %N.loc4_6.1 [symbolic = %N.loc4_6.2 (constants.%N)]
|
|
// CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%N.ref.loc4) [symbolic = %iN (constants.%iN)]
|
|
// CHECK:STDOUT: %.loc4_42.1: type = value_of_initializer %int.make_type_signed [symbolic = %iN (constants.%iN)]
|
|
// CHECK:STDOUT: %.loc4_42.2: type = converted %int.make_type_signed, %.loc4_42.1 [symbolic = %iN (constants.%iN)]
|
|
// CHECK:STDOUT: %Core.ref.loc4_48: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
|
// CHECK:STDOUT: %IntLiteral.ref.loc4_52: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral]
|
|
// CHECK:STDOUT: %int_literal.make_type.loc4_64: init type = call %IntLiteral.ref.loc4_52() [template = Core.IntLiteral]
|
|
// CHECK:STDOUT: %.loc4_64.1: type = value_of_initializer %int_literal.make_type.loc4_64 [template = Core.IntLiteral]
|
|
// CHECK:STDOUT: %.loc4_64.2: type = converted %int_literal.make_type.loc4_64, %.loc4_64.1 [template = Core.IntLiteral]
|
|
// CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param<invalid>
|
|
// CHECK:STDOUT: %N.loc4_6.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc4_6.2 (constants.%N)]
|
|
// CHECK:STDOUT: %n.param: @F.%iN (%iN) = value_param runtime_param0
|
|
// CHECK:STDOUT: %n: @F.%iN (%iN) = bind_name n, %n.param
|
|
// CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1
|
|
// CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
|
|
// CHECK:STDOUT: %a.patt: %i64 = binding_pattern a
|
|
// CHECK:STDOUT: %a.param_patt: %i64 = value_param_pattern %a.patt, runtime_param0
|
|
// CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern
|
|
// CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64]
|
|
// CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%int_64) [template = constants.%i64]
|
|
// CHECK:STDOUT: %.loc8_9.1: type = value_of_initializer %int.make_type_signed [template = constants.%i64]
|
|
// CHECK:STDOUT: %.loc8_9.2: type = converted %int.make_type_signed, %.loc8_9.1 [template = constants.%i64]
|
|
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
|
// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral]
|
|
// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
|
|
// CHECK:STDOUT: %.loc8_33.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
|
|
// CHECK:STDOUT: %.loc8_33.2: type = converted %int_literal.make_type, %.loc8_33.1 [template = Core.IntLiteral]
|
|
// CHECK:STDOUT: %a.param: %i64 = value_param runtime_param0
|
|
// CHECK:STDOUT: %a: %i64 = bind_name a, %a.param
|
|
// CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1
|
|
// CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic fn @F(%N.loc4_6.1: Core.IntLiteral) {
|
|
// CHECK:STDOUT: %N.loc4_6.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc4_6.2 (constants.%N)]
|
|
// CHECK:STDOUT: %N.patt.loc4_6.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc4_6.2 (constants.%N.patt)]
|
|
// CHECK:STDOUT: %iN: type = int_type signed, %N.loc4_6.2 [symbolic = %iN (constants.%iN)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn[%N.param_patt: Core.IntLiteral](%n.param_patt: @F.%iN (%iN)) -> Core.IntLiteral {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %N.ref.loc5: Core.IntLiteral = name_ref N, %N.loc4_6.1 [symbolic = %N.loc4_6.2 (constants.%N)]
|
|
// CHECK:STDOUT: return %N.ref.loc5
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @G(%a.param_patt: %i64) -> Core.IntLiteral {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F]
|
|
// CHECK:STDOUT: %a.ref: %i64 = name_ref a, %a
|
|
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%int_64) [template = constants.%F.specific_fn]
|
|
// CHECK:STDOUT: %F.call: init Core.IntLiteral = call %F.specific_fn(%a.ref)
|
|
// CHECK:STDOUT: %.loc9_14.1: Core.IntLiteral = value_of_initializer %F.call
|
|
// CHECK:STDOUT: %.loc9_14.2: Core.IntLiteral = converted %F.call, %.loc9_14.1
|
|
// CHECK:STDOUT: return %.loc9_14.2
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @F(constants.%N) {
|
|
// CHECK:STDOUT: %N.loc4_6.2 => constants.%N
|
|
// CHECK:STDOUT: %N.patt.loc4_6.2 => constants.%N
|
|
// CHECK:STDOUT: %iN => constants.%iN
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @F(constants.%int_64) {
|
|
// CHECK:STDOUT: %N.loc4_6.2 => constants.%int_64
|
|
// CHECK:STDOUT: %N.patt.loc4_6.2 => constants.%int_64
|
|
// CHECK:STDOUT: %iN => constants.%i64
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_todo_float.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template]
|
|
// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template]
|
|
// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
|
|
// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic]
|
|
// CHECK:STDOUT: %Float.type: type = fn_type @Float [template]
|
|
// CHECK:STDOUT: %Float: %Float.type = struct_value () [template]
|
|
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
|
|
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
|
|
// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template]
|
|
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
|
|
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
|
// CHECK:STDOUT: .IntLiteral = %import_ref.1
|
|
// CHECK:STDOUT: .Float = %import_ref.2
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Core//prelude/types, IntLiteral, loaded [template = constants.%IntLiteral]
|
|
// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, Float, loaded [template = constants.%Float]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .F = %F.decl
|
|
// CHECK:STDOUT: .G = %G.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
|
|
// CHECK:STDOUT: %N.patt.loc8_6.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc8_6.2 (constants.%N.patt)]
|
|
// CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc8_6.1, runtime_param<invalid> [symbolic = %N.patt.loc8_6.2 (constants.%N.patt)]
|
|
// CHECK:STDOUT: %n.patt: <error> = binding_pattern n
|
|
// CHECK:STDOUT: %n.param_patt: <error> = value_param_pattern %n.patt, runtime_param0
|
|
// CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern
|
|
// CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %Core.ref.loc8_10: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
|
// CHECK:STDOUT: %IntLiteral.ref.loc8_14: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral]
|
|
// CHECK:STDOUT: %int_literal.make_type.loc8_26: init type = call %IntLiteral.ref.loc8_14() [template = Core.IntLiteral]
|
|
// CHECK:STDOUT: %.loc8_26.1: type = value_of_initializer %int_literal.make_type.loc8_26 [template = Core.IntLiteral]
|
|
// CHECK:STDOUT: %.loc8_26.2: type = converted %int_literal.make_type.loc8_26, %.loc8_26.1 [template = Core.IntLiteral]
|
|
// CHECK:STDOUT: %Core.ref.loc8_32: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
|
// CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, imports.%import_ref.2 [template = constants.%Float]
|
|
// CHECK:STDOUT: %N.ref.loc8: Core.IntLiteral = name_ref N, %N.loc8_6.1 [symbolic = %N.loc8_6.2 (constants.%N)]
|
|
// CHECK:STDOUT: %float.make_type: init type = call %Float.ref(%N.ref.loc8)
|
|
// CHECK:STDOUT: %.loc8_44.1: type = value_of_initializer %float.make_type
|
|
// CHECK:STDOUT: %.loc8_44.2: type = converted %float.make_type, %.loc8_44.1
|
|
// CHECK:STDOUT: %Core.ref.loc8_50: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
|
// CHECK:STDOUT: %IntLiteral.ref.loc8_54: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral]
|
|
// CHECK:STDOUT: %int_literal.make_type.loc8_66: init type = call %IntLiteral.ref.loc8_54() [template = Core.IntLiteral]
|
|
// CHECK:STDOUT: %.loc8_66.1: type = value_of_initializer %int_literal.make_type.loc8_66 [template = Core.IntLiteral]
|
|
// CHECK:STDOUT: %.loc8_66.2: type = converted %int_literal.make_type.loc8_66, %.loc8_66.1 [template = Core.IntLiteral]
|
|
// CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param<invalid>
|
|
// CHECK:STDOUT: %N.loc8_6.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc8_6.2 (constants.%N)]
|
|
// CHECK:STDOUT: %n.param: <error> = value_param runtime_param0
|
|
// CHECK:STDOUT: %n: <error> = bind_name n, %n.param
|
|
// CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1
|
|
// CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
|
|
// CHECK:STDOUT: %a.patt: f64 = binding_pattern a
|
|
// CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0
|
|
// CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern
|
|
// CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64]
|
|
// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64]
|
|
// CHECK:STDOUT: %.loc12_9.1: type = value_of_initializer %float.make_type [template = f64]
|
|
// CHECK:STDOUT: %.loc12_9.2: type = converted %float.make_type, %.loc12_9.1 [template = f64]
|
|
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
|
// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral]
|
|
// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
|
|
// CHECK:STDOUT: %.loc12_33.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
|
|
// CHECK:STDOUT: %.loc12_33.2: type = converted %int_literal.make_type, %.loc12_33.1 [template = Core.IntLiteral]
|
|
// CHECK:STDOUT: %a.param: f64 = value_param runtime_param0
|
|
// CHECK:STDOUT: %a: f64 = bind_name a, %a.param
|
|
// CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1
|
|
// CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic fn @F(%N.loc8_6.1: Core.IntLiteral) {
|
|
// CHECK:STDOUT: %N.loc8_6.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc8_6.2 (constants.%N)]
|
|
// CHECK:STDOUT: %N.patt.loc8_6.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc8_6.2 (constants.%N.patt)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn[%N.param_patt: Core.IntLiteral](%n.param_patt: <error>) -> Core.IntLiteral {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %N.ref.loc9: Core.IntLiteral = name_ref N, %N.loc8_6.1 [symbolic = %N.loc8_6.2 (constants.%N)]
|
|
// CHECK:STDOUT: return %N.ref.loc9
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @G(%a.param_patt: f64) -> Core.IntLiteral {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F]
|
|
// CHECK:STDOUT: %a.ref: f64 = name_ref a, %a
|
|
// CHECK:STDOUT: return <error>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @F(constants.%N) {
|
|
// CHECK:STDOUT: %N.loc8_6.2 => constants.%N
|
|
// CHECK:STDOUT: %N.patt.loc8_6.2 => constants.%N
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|