| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525 |
- // 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
- //
- // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon
- //
- // AUTOUPDATE
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/generic/call.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/call.carbon
- // --- explicit.carbon
- library "[[@TEST_NAME]]";
- //@dump-sem-ir-begin
- fn Function(T:! Core.Copy, x: T) -> T {
- return x;
- }
- //@dump-sem-ir-end
- fn CallGeneric(T:! Core.Copy, x: T) -> T {
- //@dump-sem-ir-begin
- return Function(T, x);
- //@dump-sem-ir-end
- }
- fn CallGenericPtr(T:! type, x: T*) -> T* {
- //@dump-sem-ir-begin
- return Function(T*, x);
- //@dump-sem-ir-end
- }
- class C {}
- fn CallSpecific(x: C*) -> C* {
- //@dump-sem-ir-begin
- return Function(C*, x);
- //@dump-sem-ir-end
- }
- // --- deduced.carbon
- library "[[@TEST_NAME]]";
- //@dump-sem-ir-begin
- fn Function[T:! Core.Copy](x: T) -> T {
- return x;
- }
- //@dump-sem-ir-end
- fn CallGeneric(T:! Core.Copy, x: T) -> T {
- //@dump-sem-ir-begin
- return Function(x);
- //@dump-sem-ir-end
- }
- fn CallGenericPtr(T:! type, x: T*) -> T* {
- //@dump-sem-ir-begin
- return Function(x);
- //@dump-sem-ir-end
- }
- class C {}
- fn CallSpecific(x: C*) -> C* {
- //@dump-sem-ir-begin
- return Function(x);
- //@dump-sem-ir-end
- }
- // CHECK:STDOUT: --- explicit.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
- // CHECK:STDOUT: %T.be8: %Copy.type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %pattern_type.322: type = pattern_type %Copy.type [concrete]
- // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.be8 [symbolic]
- // CHECK:STDOUT: %pattern_type.965801.1: type = pattern_type %T.as_type [symbolic]
- // CHECK:STDOUT: %Function.type: type = fn_type @Function [concrete]
- // CHECK:STDOUT: %Function: %Function.type = struct_value () [concrete]
- // CHECK:STDOUT: %require_complete.07c: <witness> = require_complete_type %T.as_type [symbolic]
- // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
- // CHECK:STDOUT: %Copy.lookup_impl_witness.e15: <witness> = lookup_impl_witness %T.be8, @Copy [symbolic]
- // CHECK:STDOUT: %Copy.facet.021: %Copy.type = facet_value %T.as_type, (%Copy.lookup_impl_witness.e15) [symbolic]
- // CHECK:STDOUT: %.c50: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.021 [symbolic]
- // CHECK:STDOUT: %impl.elem0.792: %.c50 = impl_witness_access %Copy.lookup_impl_witness.e15, element0 [symbolic]
- // CHECK:STDOUT: %specific_impl_fn.547: <specific function> = specific_impl_function %impl.elem0.792, @Copy.Op(%Copy.facet.021) [symbolic]
- // CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %ptr.79f: type = ptr_type %T.8b3 [symbolic]
- // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.31f: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic]
- // CHECK:STDOUT: %ptr.as.Copy.impl.Op.8a8: %ptr.as.Copy.impl.Op.type.31f = struct_value () [symbolic]
- // CHECK:STDOUT: %pattern_type.afe: type = pattern_type %ptr.79f [symbolic]
- // CHECK:STDOUT: %require_complete.6e5: <witness> = require_complete_type %ptr.79f [symbolic]
- // CHECK:STDOUT: %Function.specific_fn.8cd: <specific function> = specific_function %Function, @Function(%T.be8) [symbolic]
- // CHECK:STDOUT: %Copy.lookup_impl_witness.cb2: <witness> = lookup_impl_witness %ptr.79f, @Copy [symbolic]
- // CHECK:STDOUT: %Copy.facet.2d1: %Copy.type = facet_value %ptr.79f, (%Copy.lookup_impl_witness.cb2) [symbolic]
- // CHECK:STDOUT: %Function.specific_fn.d32: <specific function> = specific_function %Function, @Function(%Copy.facet.2d1) [symbolic]
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
- // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
- // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
- // CHECK:STDOUT: %Copy.impl_witness.999: <witness> = impl_witness imports.%Copy.impl_witness_table.53c, @ptr.as.Copy.impl(%C) [concrete]
- // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.c3f: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%C) [concrete]
- // CHECK:STDOUT: %ptr.as.Copy.impl.Op.fb8: %ptr.as.Copy.impl.Op.type.c3f = struct_value () [concrete]
- // CHECK:STDOUT: %complete_type.d05: <witness> = complete_type_witness %ptr.019 [concrete]
- // CHECK:STDOUT: %Copy.facet.9e3: %Copy.type = facet_value %ptr.019, (%Copy.impl_witness.999) [concrete]
- // CHECK:STDOUT: %Function.specific_fn.d9e: <specific function> = specific_function %Function, @Function(%Copy.facet.9e3) [concrete]
- // CHECK:STDOUT: %.1cc: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.2d1 [symbolic]
- // CHECK:STDOUT: %impl.elem0.751: %.1cc = impl_witness_access %Copy.lookup_impl_witness.cb2, element0 [symbolic]
- // CHECK:STDOUT: %specific_impl_fn.f44: <specific function> = specific_impl_function %impl.elem0.751, @Copy.Op(%Copy.facet.2d1) [symbolic]
- // CHECK:STDOUT: %.7e9: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.9e3 [concrete]
- // CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %ptr.as.Copy.impl.Op.fb8, @ptr.as.Copy.impl.Op(%C) [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
- // CHECK:STDOUT: .Copy = %Core.Copy
- // CHECK:STDOUT: .Destroy = %Core.Destroy
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
- // CHECK:STDOUT: %Core.import_ref.0e4: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.31f) = import_ref Core//prelude/parts/copy, loc36_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.8a8)]
- // CHECK:STDOUT: %Copy.impl_witness_table.53c = impl_witness_table (%Core.import_ref.0e4), @ptr.as.Copy.impl [concrete]
- // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: %Function.decl: %Function.type = fn_decl @Function [concrete = constants.%Function] {
- // CHECK:STDOUT: %T.patt: %pattern_type.322 = symbolic_binding_pattern T, 0 [concrete]
- // CHECK:STDOUT: %x.patt: @Function.%pattern_type (%pattern_type.965801.1) = binding_pattern x [concrete]
- // CHECK:STDOUT: %x.param_patt: @Function.%pattern_type (%pattern_type.965801.1) = value_param_pattern %x.patt, call_param0 [concrete]
- // CHECK:STDOUT: %return.patt: @Function.%pattern_type (%pattern_type.965801.1) = return_slot_pattern [concrete]
- // CHECK:STDOUT: %return.param_patt: @Function.%pattern_type (%pattern_type.965801.1) = out_param_pattern %return.patt, call_param1 [concrete]
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %T.ref.loc5_37: %Copy.type = name_ref T, %T.loc5_13.2 [symbolic = %T.loc5_13.1 (constants.%T.be8)]
- // CHECK:STDOUT: %T.as_type.loc5_37: type = facet_access_type %T.ref.loc5_37 [symbolic = %T.as_type.loc5_31.1 (constants.%T.as_type)]
- // CHECK:STDOUT: %.loc5_37: type = converted %T.ref.loc5_37, %T.as_type.loc5_37 [symbolic = %T.as_type.loc5_31.1 (constants.%T.as_type)]
- // CHECK:STDOUT: %.loc5_21: type = splice_block %Copy.ref [concrete = constants.%Copy.type] {
- // CHECK:STDOUT: <elided>
- // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
- // CHECK:STDOUT: %Copy.ref: type = name_ref Copy, imports.%Core.Copy [concrete = constants.%Copy.type]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %T.loc5_13.2: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.1 (constants.%T.be8)]
- // CHECK:STDOUT: %x.param: @Function.%T.as_type.loc5_31.1 (%T.as_type) = value_param call_param0
- // CHECK:STDOUT: %.loc5_31.1: type = splice_block %.loc5_31.2 [symbolic = %T.as_type.loc5_31.1 (constants.%T.as_type)] {
- // CHECK:STDOUT: %T.ref.loc5_31: %Copy.type = name_ref T, %T.loc5_13.2 [symbolic = %T.loc5_13.1 (constants.%T.be8)]
- // CHECK:STDOUT: %T.as_type.loc5_31.2: type = facet_access_type %T.ref.loc5_31 [symbolic = %T.as_type.loc5_31.1 (constants.%T.as_type)]
- // CHECK:STDOUT: %.loc5_31.2: type = converted %T.ref.loc5_31, %T.as_type.loc5_31.2 [symbolic = %T.as_type.loc5_31.1 (constants.%T.as_type)]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %x: @Function.%T.as_type.loc5_31.1 (%T.as_type) = bind_name x, %x.param
- // CHECK:STDOUT: %return.param: ref @Function.%T.as_type.loc5_31.1 (%T.as_type) = out_param call_param1
- // CHECK:STDOUT: %return: ref @Function.%T.as_type.loc5_31.1 (%T.as_type) = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @Function(%T.loc5_13.2: %Copy.type) {
- // CHECK:STDOUT: %T.loc5_13.1: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.1 (constants.%T.be8)]
- // CHECK:STDOUT: %T.as_type.loc5_31.1: type = facet_access_type %T.loc5_13.1 [symbolic = %T.as_type.loc5_31.1 (constants.%T.as_type)]
- // CHECK:STDOUT: %pattern_type: type = pattern_type %T.as_type.loc5_31.1 [symbolic = %pattern_type (constants.%pattern_type.965801.1)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type.loc5_31.1 [symbolic = %require_complete (constants.%require_complete.07c)]
- // CHECK:STDOUT: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc5_13.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.e15)]
- // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %T.as_type.loc5_31.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.021)]
- // CHECK:STDOUT: %.loc6_10.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc6_10.2 (constants.%.c50)]
- // CHECK:STDOUT: %impl.elem0.loc6_10.2: @Function.%.loc6_10.2 (%.c50) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.792)]
- // CHECK:STDOUT: %specific_impl_fn.loc6_10.2: <specific function> = specific_impl_function %impl.elem0.loc6_10.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.547)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn(%x.param: @Function.%T.as_type.loc5_31.1 (%T.as_type)) -> %return.param: @Function.%T.as_type.loc5_31.1 (%T.as_type) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %x.ref: @Function.%T.as_type.loc5_31.1 (%T.as_type) = name_ref x, %x
- // CHECK:STDOUT: %impl.elem0.loc6_10.1: @Function.%.loc6_10.2 (%.c50) = impl_witness_access constants.%Copy.lookup_impl_witness.e15, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.792)]
- // CHECK:STDOUT: %bound_method.loc6_10.1: <bound method> = bound_method %x.ref, %impl.elem0.loc6_10.1
- // CHECK:STDOUT: %specific_impl_fn.loc6_10.1: <specific function> = specific_impl_function %impl.elem0.loc6_10.1, @Copy.Op(constants.%Copy.facet.021) [symbolic = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.547)]
- // CHECK:STDOUT: %bound_method.loc6_10.2: <bound method> = bound_method %x.ref, %specific_impl_fn.loc6_10.1
- // CHECK:STDOUT: %.loc5_34: ref @Function.%T.as_type.loc5_31.1 (%T.as_type) = splice_block %return {}
- // CHECK:STDOUT: %.loc6_10.1: init @Function.%T.as_type.loc5_31.1 (%T.as_type) = call %bound_method.loc6_10.2(%x.ref) to %.loc5_34
- // CHECK:STDOUT: return %.loc6_10.1 to %return
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @CallGeneric(%T.loc10_16.2: %Copy.type) {
- // CHECK:STDOUT: <elided>
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: <elided>
- // CHECK:STDOUT: %Function.specific_fn.loc12_10.2: <specific function> = specific_function constants.%Function, @Function(%T.loc10_16.1) [symbolic = %Function.specific_fn.loc12_10.2 (constants.%Function.specific_fn.8cd)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn(%x.param: @CallGeneric.%T.as_type.loc10_34.1 (%T.as_type)) -> %return.param: @CallGeneric.%T.as_type.loc10_34.1 (%T.as_type) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Function.ref: %Function.type = name_ref Function, file.%Function.decl [concrete = constants.%Function]
- // CHECK:STDOUT: %T.ref.loc12: %Copy.type = name_ref T, %T.loc10_16.2 [symbolic = %T.loc10_16.1 (constants.%T.be8)]
- // CHECK:STDOUT: %x.ref: @CallGeneric.%T.as_type.loc10_34.1 (%T.as_type) = name_ref x, %x
- // CHECK:STDOUT: %.loc12_23.1: %Copy.type = converted constants.%T.as_type, constants.%T.be8 [symbolic = %T.loc10_16.1 (constants.%T.be8)]
- // CHECK:STDOUT: %.loc12_23.2: %Copy.type = converted constants.%T.as_type, constants.%T.be8 [symbolic = %T.loc10_16.1 (constants.%T.be8)]
- // CHECK:STDOUT: %Function.specific_fn.loc12_10.1: <specific function> = specific_function %Function.ref, @Function(constants.%T.be8) [symbolic = %Function.specific_fn.loc12_10.2 (constants.%Function.specific_fn.8cd)]
- // CHECK:STDOUT: <elided>
- // CHECK:STDOUT: %Function.call: init @CallGeneric.%T.as_type.loc10_34.1 (%T.as_type) = call %Function.specific_fn.loc12_10.1(%x.ref) to %.loc10_37
- // CHECK:STDOUT: return %Function.call to %return
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @CallGenericPtr(%T.loc16_19.2: type) {
- // CHECK:STDOUT: <elided>
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: <elided>
- // CHECK:STDOUT: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %ptr.loc16_33.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.cb2)]
- // CHECK:STDOUT: %Copy.facet.loc18_24.4: %Copy.type = facet_value %ptr.loc16_33.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc18_24.4 (constants.%Copy.facet.2d1)]
- // CHECK:STDOUT: %Function.specific_fn.loc18_10.2: <specific function> = specific_function constants.%Function, @Function(%Copy.facet.loc18_24.4) [symbolic = %Function.specific_fn.loc18_10.2 (constants.%Function.specific_fn.d32)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn(%x.param: @CallGenericPtr.%ptr.loc16_33.1 (%ptr.79f)) -> @CallGenericPtr.%ptr.loc16_33.1 (%ptr.79f) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Function.ref: %Function.type = name_ref Function, file.%Function.decl [concrete = constants.%Function]
- // CHECK:STDOUT: %T.ref.loc18: type = name_ref T, %T.loc16_19.2 [symbolic = %T.loc16_19.1 (constants.%T.8b3)]
- // CHECK:STDOUT: %ptr.loc18: type = ptr_type %T.ref.loc18 [symbolic = %ptr.loc16_33.1 (constants.%ptr.79f)]
- // CHECK:STDOUT: %x.ref: @CallGenericPtr.%ptr.loc16_33.1 (%ptr.79f) = name_ref x, %x
- // CHECK:STDOUT: %Copy.facet.loc18_24.1: %Copy.type = facet_value constants.%ptr.79f, (constants.%Copy.lookup_impl_witness.cb2) [symbolic = %Copy.facet.loc18_24.4 (constants.%Copy.facet.2d1)]
- // CHECK:STDOUT: %.loc18_24.1: %Copy.type = converted %ptr.loc18, %Copy.facet.loc18_24.1 [symbolic = %Copy.facet.loc18_24.4 (constants.%Copy.facet.2d1)]
- // CHECK:STDOUT: %Copy.facet.loc18_24.2: %Copy.type = facet_value constants.%ptr.79f, (constants.%Copy.lookup_impl_witness.cb2) [symbolic = %Copy.facet.loc18_24.4 (constants.%Copy.facet.2d1)]
- // CHECK:STDOUT: %.loc18_24.2: %Copy.type = converted constants.%ptr.79f, %Copy.facet.loc18_24.2 [symbolic = %Copy.facet.loc18_24.4 (constants.%Copy.facet.2d1)]
- // CHECK:STDOUT: %Copy.facet.loc18_24.3: %Copy.type = facet_value constants.%ptr.79f, (constants.%Copy.lookup_impl_witness.cb2) [symbolic = %Copy.facet.loc18_24.4 (constants.%Copy.facet.2d1)]
- // CHECK:STDOUT: %.loc18_24.3: %Copy.type = converted constants.%ptr.79f, %Copy.facet.loc18_24.3 [symbolic = %Copy.facet.loc18_24.4 (constants.%Copy.facet.2d1)]
- // CHECK:STDOUT: %Function.specific_fn.loc18_10.1: <specific function> = specific_function %Function.ref, @Function(constants.%Copy.facet.2d1) [symbolic = %Function.specific_fn.loc18_10.2 (constants.%Function.specific_fn.d32)]
- // CHECK:STDOUT: %Function.call: init @CallGenericPtr.%ptr.loc16_33.1 (%ptr.79f) = call %Function.specific_fn.loc18_10.1(%x.ref)
- // CHECK:STDOUT: return %Function.call to %return
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @CallSpecific(%x.param: %ptr.019) -> %ptr.019 {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Function.ref: %Function.type = name_ref Function, file.%Function.decl [concrete = constants.%Function]
- // CHECK:STDOUT: %C.ref.loc26: type = name_ref C, file.%C.decl [concrete = constants.%C]
- // CHECK:STDOUT: %ptr.loc26: type = ptr_type %C.ref.loc26 [concrete = constants.%ptr.019]
- // CHECK:STDOUT: %x.ref: %ptr.019 = name_ref x, %x
- // CHECK:STDOUT: %Copy.facet.loc26_24.1: %Copy.type = facet_value constants.%ptr.019, (constants.%Copy.impl_witness.999) [concrete = constants.%Copy.facet.9e3]
- // CHECK:STDOUT: %.loc26_24.1: %Copy.type = converted %ptr.loc26, %Copy.facet.loc26_24.1 [concrete = constants.%Copy.facet.9e3]
- // CHECK:STDOUT: %Copy.facet.loc26_24.2: %Copy.type = facet_value constants.%ptr.019, (constants.%Copy.impl_witness.999) [concrete = constants.%Copy.facet.9e3]
- // CHECK:STDOUT: %.loc26_24.2: %Copy.type = converted constants.%ptr.019, %Copy.facet.loc26_24.2 [concrete = constants.%Copy.facet.9e3]
- // CHECK:STDOUT: %Copy.facet.loc26_24.3: %Copy.type = facet_value constants.%ptr.019, (constants.%Copy.impl_witness.999) [concrete = constants.%Copy.facet.9e3]
- // CHECK:STDOUT: %.loc26_24.3: %Copy.type = converted constants.%ptr.019, %Copy.facet.loc26_24.3 [concrete = constants.%Copy.facet.9e3]
- // CHECK:STDOUT: %Function.specific_fn: <specific function> = specific_function %Function.ref, @Function(constants.%Copy.facet.9e3) [concrete = constants.%Function.specific_fn.d9e]
- // CHECK:STDOUT: %Function.call: init %ptr.019 = call %Function.specific_fn(%x.ref)
- // CHECK:STDOUT: return %Function.call to %return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Function(constants.%T.be8) {
- // CHECK:STDOUT: %T.loc5_13.1 => constants.%T.be8
- // CHECK:STDOUT: %T.as_type.loc5_31.1 => constants.%T.as_type
- // CHECK:STDOUT: %pattern_type => constants.%pattern_type.965801.1
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %require_complete => constants.%require_complete.07c
- // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.e15
- // CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.021
- // CHECK:STDOUT: %.loc6_10.2 => constants.%.c50
- // CHECK:STDOUT: %impl.elem0.loc6_10.2 => constants.%impl.elem0.792
- // CHECK:STDOUT: %specific_impl_fn.loc6_10.2 => constants.%specific_impl_fn.547
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @CallGeneric(constants.%T.be8) {
- // CHECK:STDOUT: %T.loc10_16.1 => constants.%T.be8
- // CHECK:STDOUT: %T.as_type.loc10_34.1 => constants.%T.as_type
- // CHECK:STDOUT: %pattern_type => constants.%pattern_type.965801.1
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @CallGenericPtr(constants.%T.8b3) {
- // CHECK:STDOUT: %T.loc16_19.1 => constants.%T.8b3
- // CHECK:STDOUT: %ptr.loc16_33.1 => constants.%ptr.79f
- // CHECK:STDOUT: %pattern_type => constants.%pattern_type.afe
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Function(constants.%Copy.facet.2d1) {
- // CHECK:STDOUT: %T.loc5_13.1 => constants.%Copy.facet.2d1
- // CHECK:STDOUT: %T.as_type.loc5_31.1 => constants.%ptr.79f
- // CHECK:STDOUT: %pattern_type => constants.%pattern_type.afe
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %require_complete => constants.%require_complete.6e5
- // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.cb2
- // CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.2d1
- // CHECK:STDOUT: %.loc6_10.2 => constants.%.1cc
- // CHECK:STDOUT: %impl.elem0.loc6_10.2 => constants.%impl.elem0.751
- // CHECK:STDOUT: %specific_impl_fn.loc6_10.2 => constants.%specific_impl_fn.f44
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Function(constants.%Copy.facet.9e3) {
- // CHECK:STDOUT: %T.loc5_13.1 => constants.%Copy.facet.9e3
- // CHECK:STDOUT: %T.as_type.loc5_31.1 => constants.%ptr.019
- // CHECK:STDOUT: %pattern_type => constants.%pattern_type.44a
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %require_complete => constants.%complete_type.d05
- // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.999
- // CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.9e3
- // CHECK:STDOUT: %.loc6_10.2 => constants.%.7e9
- // CHECK:STDOUT: %impl.elem0.loc6_10.2 => constants.%ptr.as.Copy.impl.Op.fb8
- // CHECK:STDOUT: %specific_impl_fn.loc6_10.2 => constants.%ptr.as.Copy.impl.Op.specific_fn
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- deduced.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
- // CHECK:STDOUT: %T.be8: %Copy.type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %pattern_type.322: type = pattern_type %Copy.type [concrete]
- // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.be8 [symbolic]
- // CHECK:STDOUT: %pattern_type.965801.1: type = pattern_type %T.as_type [symbolic]
- // CHECK:STDOUT: %Function.type: type = fn_type @Function [concrete]
- // CHECK:STDOUT: %Function: %Function.type = struct_value () [concrete]
- // CHECK:STDOUT: %require_complete.07c: <witness> = require_complete_type %T.as_type [symbolic]
- // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
- // CHECK:STDOUT: %Copy.lookup_impl_witness.e15: <witness> = lookup_impl_witness %T.be8, @Copy [symbolic]
- // CHECK:STDOUT: %Copy.facet.021: %Copy.type = facet_value %T.as_type, (%Copy.lookup_impl_witness.e15) [symbolic]
- // CHECK:STDOUT: %.c50: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.021 [symbolic]
- // CHECK:STDOUT: %impl.elem0.792: %.c50 = impl_witness_access %Copy.lookup_impl_witness.e15, element0 [symbolic]
- // CHECK:STDOUT: %specific_impl_fn.547: <specific function> = specific_impl_function %impl.elem0.792, @Copy.Op(%Copy.facet.021) [symbolic]
- // CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic]
- // CHECK:STDOUT: %ptr.79f: type = ptr_type %T.8b3 [symbolic]
- // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.31f: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.8b3) [symbolic]
- // CHECK:STDOUT: %ptr.as.Copy.impl.Op.8a8: %ptr.as.Copy.impl.Op.type.31f = struct_value () [symbolic]
- // CHECK:STDOUT: %pattern_type.afe: type = pattern_type %ptr.79f [symbolic]
- // CHECK:STDOUT: %require_complete.6e5: <witness> = require_complete_type %ptr.79f [symbolic]
- // CHECK:STDOUT: %Function.specific_fn.8cd: <specific function> = specific_function %Function, @Function(%T.be8) [symbolic]
- // CHECK:STDOUT: %Copy.lookup_impl_witness.cb2: <witness> = lookup_impl_witness %ptr.79f, @Copy [symbolic]
- // CHECK:STDOUT: %Copy.facet.2d1: %Copy.type = facet_value %ptr.79f, (%Copy.lookup_impl_witness.cb2) [symbolic]
- // CHECK:STDOUT: %Function.specific_fn.d32: <specific function> = specific_function %Function, @Function(%Copy.facet.2d1) [symbolic]
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
- // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
- // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
- // CHECK:STDOUT: %Copy.impl_witness.999: <witness> = impl_witness imports.%Copy.impl_witness_table.53c, @ptr.as.Copy.impl(%C) [concrete]
- // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.c3f: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%C) [concrete]
- // CHECK:STDOUT: %ptr.as.Copy.impl.Op.fb8: %ptr.as.Copy.impl.Op.type.c3f = struct_value () [concrete]
- // CHECK:STDOUT: %complete_type.d05: <witness> = complete_type_witness %ptr.019 [concrete]
- // CHECK:STDOUT: %Copy.facet.9e3: %Copy.type = facet_value %ptr.019, (%Copy.impl_witness.999) [concrete]
- // CHECK:STDOUT: %Function.specific_fn.d9e: <specific function> = specific_function %Function, @Function(%Copy.facet.9e3) [concrete]
- // CHECK:STDOUT: %.1cc: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.2d1 [symbolic]
- // CHECK:STDOUT: %impl.elem0.751: %.1cc = impl_witness_access %Copy.lookup_impl_witness.cb2, element0 [symbolic]
- // CHECK:STDOUT: %specific_impl_fn.f44: <specific function> = specific_impl_function %impl.elem0.751, @Copy.Op(%Copy.facet.2d1) [symbolic]
- // CHECK:STDOUT: %.7e9: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.9e3 [concrete]
- // CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %ptr.as.Copy.impl.Op.fb8, @ptr.as.Copy.impl.Op(%C) [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
- // CHECK:STDOUT: .Copy = %Core.Copy
- // CHECK:STDOUT: .Destroy = %Core.Destroy
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
- // CHECK:STDOUT: %Core.import_ref.0e4: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.31f) = import_ref Core//prelude/parts/copy, loc36_31, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.8a8)]
- // CHECK:STDOUT: %Copy.impl_witness_table.53c = impl_witness_table (%Core.import_ref.0e4), @ptr.as.Copy.impl [concrete]
- // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: %Function.decl: %Function.type = fn_decl @Function [concrete = constants.%Function] {
- // CHECK:STDOUT: %T.patt: %pattern_type.322 = symbolic_binding_pattern T, 0 [concrete]
- // CHECK:STDOUT: %x.patt: @Function.%pattern_type (%pattern_type.965801.1) = binding_pattern x [concrete]
- // CHECK:STDOUT: %x.param_patt: @Function.%pattern_type (%pattern_type.965801.1) = value_param_pattern %x.patt, call_param0 [concrete]
- // CHECK:STDOUT: %return.patt: @Function.%pattern_type (%pattern_type.965801.1) = return_slot_pattern [concrete]
- // CHECK:STDOUT: %return.param_patt: @Function.%pattern_type (%pattern_type.965801.1) = out_param_pattern %return.patt, call_param1 [concrete]
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %T.ref.loc5_37: %Copy.type = name_ref T, %T.loc5_13.2 [symbolic = %T.loc5_13.1 (constants.%T.be8)]
- // CHECK:STDOUT: %T.as_type.loc5_37: type = facet_access_type %T.ref.loc5_37 [symbolic = %T.as_type.loc5_31.1 (constants.%T.as_type)]
- // CHECK:STDOUT: %.loc5_37: type = converted %T.ref.loc5_37, %T.as_type.loc5_37 [symbolic = %T.as_type.loc5_31.1 (constants.%T.as_type)]
- // CHECK:STDOUT: %.loc5_21: type = splice_block %Copy.ref [concrete = constants.%Copy.type] {
- // CHECK:STDOUT: <elided>
- // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
- // CHECK:STDOUT: %Copy.ref: type = name_ref Copy, imports.%Core.Copy [concrete = constants.%Copy.type]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %T.loc5_13.2: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.1 (constants.%T.be8)]
- // CHECK:STDOUT: %x.param: @Function.%T.as_type.loc5_31.1 (%T.as_type) = value_param call_param0
- // CHECK:STDOUT: %.loc5_31.1: type = splice_block %.loc5_31.2 [symbolic = %T.as_type.loc5_31.1 (constants.%T.as_type)] {
- // CHECK:STDOUT: %T.ref.loc5_31: %Copy.type = name_ref T, %T.loc5_13.2 [symbolic = %T.loc5_13.1 (constants.%T.be8)]
- // CHECK:STDOUT: %T.as_type.loc5_31.2: type = facet_access_type %T.ref.loc5_31 [symbolic = %T.as_type.loc5_31.1 (constants.%T.as_type)]
- // CHECK:STDOUT: %.loc5_31.2: type = converted %T.ref.loc5_31, %T.as_type.loc5_31.2 [symbolic = %T.as_type.loc5_31.1 (constants.%T.as_type)]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %x: @Function.%T.as_type.loc5_31.1 (%T.as_type) = bind_name x, %x.param
- // CHECK:STDOUT: %return.param: ref @Function.%T.as_type.loc5_31.1 (%T.as_type) = out_param call_param1
- // CHECK:STDOUT: %return: ref @Function.%T.as_type.loc5_31.1 (%T.as_type) = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @Function(%T.loc5_13.2: %Copy.type) {
- // CHECK:STDOUT: %T.loc5_13.1: %Copy.type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.1 (constants.%T.be8)]
- // CHECK:STDOUT: %T.as_type.loc5_31.1: type = facet_access_type %T.loc5_13.1 [symbolic = %T.as_type.loc5_31.1 (constants.%T.as_type)]
- // CHECK:STDOUT: %pattern_type: type = pattern_type %T.as_type.loc5_31.1 [symbolic = %pattern_type (constants.%pattern_type.965801.1)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type.loc5_31.1 [symbolic = %require_complete (constants.%require_complete.07c)]
- // CHECK:STDOUT: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc5_13.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.e15)]
- // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %T.as_type.loc5_31.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet (constants.%Copy.facet.021)]
- // CHECK:STDOUT: %.loc6_10.2: type = fn_type_with_self_type constants.%Copy.Op.type, %Copy.facet [symbolic = %.loc6_10.2 (constants.%.c50)]
- // CHECK:STDOUT: %impl.elem0.loc6_10.2: @Function.%.loc6_10.2 (%.c50) = impl_witness_access %Copy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.792)]
- // CHECK:STDOUT: %specific_impl_fn.loc6_10.2: <specific function> = specific_impl_function %impl.elem0.loc6_10.2, @Copy.Op(%Copy.facet) [symbolic = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.547)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn(%x.param: @Function.%T.as_type.loc5_31.1 (%T.as_type)) -> %return.param: @Function.%T.as_type.loc5_31.1 (%T.as_type) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %x.ref: @Function.%T.as_type.loc5_31.1 (%T.as_type) = name_ref x, %x
- // CHECK:STDOUT: %impl.elem0.loc6_10.1: @Function.%.loc6_10.2 (%.c50) = impl_witness_access constants.%Copy.lookup_impl_witness.e15, element0 [symbolic = %impl.elem0.loc6_10.2 (constants.%impl.elem0.792)]
- // CHECK:STDOUT: %bound_method.loc6_10.1: <bound method> = bound_method %x.ref, %impl.elem0.loc6_10.1
- // CHECK:STDOUT: %specific_impl_fn.loc6_10.1: <specific function> = specific_impl_function %impl.elem0.loc6_10.1, @Copy.Op(constants.%Copy.facet.021) [symbolic = %specific_impl_fn.loc6_10.2 (constants.%specific_impl_fn.547)]
- // CHECK:STDOUT: %bound_method.loc6_10.2: <bound method> = bound_method %x.ref, %specific_impl_fn.loc6_10.1
- // CHECK:STDOUT: %.loc5_34: ref @Function.%T.as_type.loc5_31.1 (%T.as_type) = splice_block %return {}
- // CHECK:STDOUT: %.loc6_10.1: init @Function.%T.as_type.loc5_31.1 (%T.as_type) = call %bound_method.loc6_10.2(%x.ref) to %.loc5_34
- // CHECK:STDOUT: return %.loc6_10.1 to %return
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @CallGeneric(%T.loc10_16.2: %Copy.type) {
- // CHECK:STDOUT: <elided>
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: <elided>
- // CHECK:STDOUT: %Function.specific_fn.loc12_10.2: <specific function> = specific_function constants.%Function, @Function(%T.loc10_16.1) [symbolic = %Function.specific_fn.loc12_10.2 (constants.%Function.specific_fn.8cd)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn(%x.param: @CallGeneric.%T.as_type.loc10_34.1 (%T.as_type)) -> %return.param: @CallGeneric.%T.as_type.loc10_34.1 (%T.as_type) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Function.ref: %Function.type = name_ref Function, file.%Function.decl [concrete = constants.%Function]
- // CHECK:STDOUT: %x.ref: @CallGeneric.%T.as_type.loc10_34.1 (%T.as_type) = name_ref x, %x
- // CHECK:STDOUT: %.loc12_20.1: %Copy.type = converted constants.%T.as_type, constants.%T.be8 [symbolic = %T.loc10_16.1 (constants.%T.be8)]
- // CHECK:STDOUT: %.loc12_20.2: %Copy.type = converted constants.%T.as_type, constants.%T.be8 [symbolic = %T.loc10_16.1 (constants.%T.be8)]
- // CHECK:STDOUT: %Function.specific_fn.loc12_10.1: <specific function> = specific_function %Function.ref, @Function(constants.%T.be8) [symbolic = %Function.specific_fn.loc12_10.2 (constants.%Function.specific_fn.8cd)]
- // CHECK:STDOUT: <elided>
- // CHECK:STDOUT: %Function.call: init @CallGeneric.%T.as_type.loc10_34.1 (%T.as_type) = call %Function.specific_fn.loc12_10.1(%x.ref) to %.loc10_37
- // CHECK:STDOUT: return %Function.call to %return
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @CallGenericPtr(%T.loc16_19.2: type) {
- // CHECK:STDOUT: <elided>
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: <elided>
- // CHECK:STDOUT: %Copy.lookup_impl_witness: <witness> = lookup_impl_witness %ptr.loc16_33.1, @Copy [symbolic = %Copy.lookup_impl_witness (constants.%Copy.lookup_impl_witness.cb2)]
- // CHECK:STDOUT: %Copy.facet.loc18_20.3: %Copy.type = facet_value %ptr.loc16_33.1, (%Copy.lookup_impl_witness) [symbolic = %Copy.facet.loc18_20.3 (constants.%Copy.facet.2d1)]
- // CHECK:STDOUT: %Function.specific_fn.loc18_10.2: <specific function> = specific_function constants.%Function, @Function(%Copy.facet.loc18_20.3) [symbolic = %Function.specific_fn.loc18_10.2 (constants.%Function.specific_fn.d32)]
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn(%x.param: @CallGenericPtr.%ptr.loc16_33.1 (%ptr.79f)) -> @CallGenericPtr.%ptr.loc16_33.1 (%ptr.79f) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Function.ref: %Function.type = name_ref Function, file.%Function.decl [concrete = constants.%Function]
- // CHECK:STDOUT: %x.ref: @CallGenericPtr.%ptr.loc16_33.1 (%ptr.79f) = name_ref x, %x
- // CHECK:STDOUT: %Copy.facet.loc18_20.1: %Copy.type = facet_value constants.%ptr.79f, (constants.%Copy.lookup_impl_witness.cb2) [symbolic = %Copy.facet.loc18_20.3 (constants.%Copy.facet.2d1)]
- // CHECK:STDOUT: %.loc18_20.1: %Copy.type = converted constants.%ptr.79f, %Copy.facet.loc18_20.1 [symbolic = %Copy.facet.loc18_20.3 (constants.%Copy.facet.2d1)]
- // CHECK:STDOUT: %Copy.facet.loc18_20.2: %Copy.type = facet_value constants.%ptr.79f, (constants.%Copy.lookup_impl_witness.cb2) [symbolic = %Copy.facet.loc18_20.3 (constants.%Copy.facet.2d1)]
- // CHECK:STDOUT: %.loc18_20.2: %Copy.type = converted constants.%ptr.79f, %Copy.facet.loc18_20.2 [symbolic = %Copy.facet.loc18_20.3 (constants.%Copy.facet.2d1)]
- // CHECK:STDOUT: %Function.specific_fn.loc18_10.1: <specific function> = specific_function %Function.ref, @Function(constants.%Copy.facet.2d1) [symbolic = %Function.specific_fn.loc18_10.2 (constants.%Function.specific_fn.d32)]
- // CHECK:STDOUT: %Function.call: init @CallGenericPtr.%ptr.loc16_33.1 (%ptr.79f) = call %Function.specific_fn.loc18_10.1(%x.ref)
- // CHECK:STDOUT: return %Function.call to %return
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @CallSpecific(%x.param: %ptr.019) -> %ptr.019 {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %Function.ref: %Function.type = name_ref Function, file.%Function.decl [concrete = constants.%Function]
- // CHECK:STDOUT: %x.ref: %ptr.019 = name_ref x, %x
- // CHECK:STDOUT: %Copy.facet.loc26_20.1: %Copy.type = facet_value constants.%ptr.019, (constants.%Copy.impl_witness.999) [concrete = constants.%Copy.facet.9e3]
- // CHECK:STDOUT: %.loc26_20.1: %Copy.type = converted constants.%ptr.019, %Copy.facet.loc26_20.1 [concrete = constants.%Copy.facet.9e3]
- // CHECK:STDOUT: %Copy.facet.loc26_20.2: %Copy.type = facet_value constants.%ptr.019, (constants.%Copy.impl_witness.999) [concrete = constants.%Copy.facet.9e3]
- // CHECK:STDOUT: %.loc26_20.2: %Copy.type = converted constants.%ptr.019, %Copy.facet.loc26_20.2 [concrete = constants.%Copy.facet.9e3]
- // CHECK:STDOUT: %Function.specific_fn: <specific function> = specific_function %Function.ref, @Function(constants.%Copy.facet.9e3) [concrete = constants.%Function.specific_fn.d9e]
- // CHECK:STDOUT: %Function.call: init %ptr.019 = call %Function.specific_fn(%x.ref)
- // CHECK:STDOUT: return %Function.call to %return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Function(constants.%T.be8) {
- // CHECK:STDOUT: %T.loc5_13.1 => constants.%T.be8
- // CHECK:STDOUT: %T.as_type.loc5_31.1 => constants.%T.as_type
- // CHECK:STDOUT: %pattern_type => constants.%pattern_type.965801.1
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %require_complete => constants.%require_complete.07c
- // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.e15
- // CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.021
- // CHECK:STDOUT: %.loc6_10.2 => constants.%.c50
- // CHECK:STDOUT: %impl.elem0.loc6_10.2 => constants.%impl.elem0.792
- // CHECK:STDOUT: %specific_impl_fn.loc6_10.2 => constants.%specific_impl_fn.547
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @CallGeneric(constants.%T.be8) {
- // CHECK:STDOUT: %T.loc10_16.1 => constants.%T.be8
- // CHECK:STDOUT: %T.as_type.loc10_34.1 => constants.%T.as_type
- // CHECK:STDOUT: %pattern_type => constants.%pattern_type.965801.1
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @CallGenericPtr(constants.%T.8b3) {
- // CHECK:STDOUT: %T.loc16_19.1 => constants.%T.8b3
- // CHECK:STDOUT: %ptr.loc16_33.1 => constants.%ptr.79f
- // CHECK:STDOUT: %pattern_type => constants.%pattern_type.afe
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Function(constants.%Copy.facet.2d1) {
- // CHECK:STDOUT: %T.loc5_13.1 => constants.%Copy.facet.2d1
- // CHECK:STDOUT: %T.as_type.loc5_31.1 => constants.%ptr.79f
- // CHECK:STDOUT: %pattern_type => constants.%pattern_type.afe
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %require_complete => constants.%require_complete.6e5
- // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.lookup_impl_witness.cb2
- // CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.2d1
- // CHECK:STDOUT: %.loc6_10.2 => constants.%.1cc
- // CHECK:STDOUT: %impl.elem0.loc6_10.2 => constants.%impl.elem0.751
- // CHECK:STDOUT: %specific_impl_fn.loc6_10.2 => constants.%specific_impl_fn.f44
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @Function(constants.%Copy.facet.9e3) {
- // CHECK:STDOUT: %T.loc5_13.1 => constants.%Copy.facet.9e3
- // CHECK:STDOUT: %T.as_type.loc5_31.1 => constants.%ptr.019
- // CHECK:STDOUT: %pattern_type => constants.%pattern_type.44a
- // CHECK:STDOUT:
- // CHECK:STDOUT: !definition:
- // CHECK:STDOUT: %require_complete => constants.%complete_type.d05
- // CHECK:STDOUT: %Copy.lookup_impl_witness => constants.%Copy.impl_witness.999
- // CHECK:STDOUT: %Copy.facet => constants.%Copy.facet.9e3
- // CHECK:STDOUT: %.loc6_10.2 => constants.%.7e9
- // CHECK:STDOUT: %impl.elem0.loc6_10.2 => constants.%ptr.as.Copy.impl.Op.fb8
- // CHECK:STDOUT: %specific_impl_fn.loc6_10.2 => constants.%ptr.as.Copy.impl.Op.specific_fn
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
|