Add Destroy.SubobjectDestroy as a temporary replacement for Destroy.Op (#7773)

This change partially implements [PR #7362], which revises how objects
are destroyed. It is a partial implementation for two reasons:

1. This change moves `Destroy.Op`'s current behaviour into
`Destroy.SubobjectDestroy`, but it doesn't add support for objects with
non-trivial destruction.
2. `Destroy.SubobjectDestroy` is a workaround for `require impls
SubobjectDestroy`. We aren't able to use the latter until the dependents
add their requirements' implementations to their own witness tables.

[PR #7362]: https://github.com/carbon-language/carbon-lang/pulls/7362
This commit is contained in:
Christopher Di Bella
2026-09-24 00:06:28 +00:00
committed by GitHub
parent 03939a9223
commit f7cd39428e
309 changed files with 51760 additions and 15269 deletions
@@ -1940,16 +1940,30 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: %PublicCall: type = class_type @PublicCall [concrete]
// CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.type: type = cpp_overload_set_type @PublicCall.PublicCall.cpp_overload_set [concrete]
// CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.value: %PublicCall.PublicCall.cpp_overload_set.type = cpp_overload_set_value @PublicCall.PublicCall.cpp_overload_set [concrete]
// CHECK:STDOUT: %pattern_type.871: type = pattern_type %PublicCall [concrete]
// CHECK:STDOUT: %ptr.d0a: type = ptr_type %PublicCall [concrete]
// CHECK:STDOUT: %PublicCall__carbon_thunk.type: type = fn_type @PublicCall__carbon_thunk [concrete]
// CHECK:STDOUT: %PublicCall__carbon_thunk: %PublicCall__carbon_thunk.type = struct_value () [concrete]
// CHECK:STDOUT: %pattern_type.60e: type = pattern_type %OverloadSet [concrete]
// CHECK:STDOUT: %ptr.4a0: type = ptr_type %OverloadSet [concrete]
// CHECK:STDOUT: %OverloadSet__carbon_thunk.type: type = fn_type @OverloadSet__carbon_thunk [concrete]
// CHECK:STDOUT: %OverloadSet__carbon_thunk: %OverloadSet__carbon_thunk.type = struct_value () [concrete]
// CHECK:STDOUT: %self.param_patt.add: %pattern_type.60e = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.986: %pattern_type.60e = wrapper_binding_pattern self, %self.param_patt.add [concrete]
// CHECK:STDOUT: %OverloadSet.cpp_destructor.type: type = fn_type @OverloadSet.cpp_destructor [concrete]
// CHECK:STDOUT: %OverloadSet.cpp_destructor: %OverloadSet.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc8_58 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_58 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
// CHECK:STDOUT: %self.param_patt.ced: %pattern_type.871 = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.d01: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt.ced [concrete]
// CHECK:STDOUT: %PublicCall.cpp_destructor.type: type = fn_type @PublicCall.cpp_destructor [concrete]
// CHECK:STDOUT: %PublicCall.cpp_destructor: %PublicCall.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_57 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_57 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete]
// CHECK:STDOUT: %OverloadSet.Overload.cpp_overload_set.type: type = cpp_overload_set_type @OverloadSet.Overload.cpp_overload_set [concrete]
// CHECK:STDOUT: %OverloadSet.Overload.cpp_overload_set.value: %OverloadSet.Overload.cpp_overload_set.type = cpp_overload_set_value @OverloadSet.Overload.cpp_overload_set [concrete]
// CHECK:STDOUT: %Overload__carbon_thunk.type: type = fn_type @Overload__carbon_thunk [concrete]
@@ -1976,6 +1990,16 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %OverloadSet.cpp_destructor.decl: %OverloadSet.cpp_destructor.type = fn_decl @OverloadSet.cpp_destructor [concrete = constants.%OverloadSet.cpp_destructor] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %PublicCall.cpp_destructor.decl: %PublicCall.cpp_destructor.type = fn_decl @PublicCall.cpp_destructor [concrete = constants.%PublicCall.cpp_destructor] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %OverloadSet.Overload.cpp_overload_set.value: %OverloadSet.Overload.cpp_overload_set.type = cpp_overload_set_value @OverloadSet.Overload.cpp_overload_set [concrete = constants.%OverloadSet.Overload.cpp_overload_set.value]
// CHECK:STDOUT: %Overload__carbon_thunk.decl: %Overload__carbon_thunk.type = fn_decl @Overload__carbon_thunk [concrete = constants.%Overload__carbon_thunk] {
// CHECK:STDOUT: <elided>
@@ -1984,6 +2008,23 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generated {
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc8_58 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.60e = ref_param_pattern [concrete = constants.%self.param_patt.add]
// CHECK:STDOUT: %self.patt: %pattern_type.60e = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.986]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %OverloadSet = ref_param call_param0
// CHECK:STDOUT: %self: ref %OverloadSet = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_57 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.871 = ref_param_pattern [concrete = constants.%self.param_patt.ced]
// CHECK:STDOUT: %self.patt: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d01]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %PublicCall = ref_param call_param0
// CHECK:STDOUT: %self: ref %PublicCall = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Cpp.ref.loc8_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
@@ -2005,10 +2046,10 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: %OverloadSet__carbon_thunk.call: init %empty_tuple.type = call imports.%OverloadSet__carbon_thunk.decl(%addr.loc8_58.1, %addr.loc8_58.2)
// CHECK:STDOUT: %.loc8_58.2: init %OverloadSet to %.loc8_58.1 = mark_in_place_init %OverloadSet__carbon_thunk.call
// CHECK:STDOUT: %.loc8_58.3: ref %OverloadSet = temporary %.loc8_58.1, %.loc8_58.2
// CHECK:STDOUT: %OverloadSet.cpp_destructor.bound: <bound method> = bound_method %.loc8_58.3, constants.%OverloadSet.cpp_destructor
// CHECK:STDOUT: %OverloadSet.cpp_destructor.call: init %empty_tuple.type = call %OverloadSet.cpp_destructor.bound(%.loc8_58.3)
// CHECK:STDOUT: %PublicCall.cpp_destructor.bound.loc8: <bound method> = bound_method %.loc8_57.3, constants.%PublicCall.cpp_destructor
// CHECK:STDOUT: %PublicCall.cpp_destructor.call.loc8: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound.loc8(%.loc8_57.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8_58: <bound method> = bound_method %.loc8_58.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8_58: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8_58(%.loc8_58.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8_57: <bound method> = bound_method %.loc8_57.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8_57: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8_57(%.loc8_57.3)
// CHECK:STDOUT: %Cpp.ref.loc9_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %OverloadSet.ref.loc9: type = name_ref OverloadSet, imports.%OverloadSet.decl [concrete = constants.%OverloadSet]
// CHECK:STDOUT: %Overload.ref: %OverloadSet.Overload.cpp_overload_set.type = name_ref Overload, imports.%OverloadSet.Overload.cpp_overload_set.value [concrete = constants.%OverloadSet.Overload.cpp_overload_set.value]
@@ -2024,11 +2065,29 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: %.loc9_54.5: ref %PublicCall = value_as_ref %.loc9_54.4
// CHECK:STDOUT: %addr.loc9_55: %ptr.d0a = addr_of %.loc9_54.5
// CHECK:STDOUT: %Overload__carbon_thunk.call: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl(%addr.loc9_55)
// CHECK:STDOUT: %PublicCall.cpp_destructor.bound.loc9: <bound method> = bound_method %.loc9_54.3, constants.%PublicCall.cpp_destructor
// CHECK:STDOUT: %PublicCall.cpp_destructor.call.loc9: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound.loc9(%.loc9_54.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: <bound method> = bound_method %.loc9_54.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_54.3)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_58(%self.param: ref %OverloadSet) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_58(%self.param: ref %OverloadSet) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
// CHECK:STDOUT: %OverloadSet.cpp_destructor.call: init %empty_tuple.type = call imports.%OverloadSet.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_57(%self.param: ref %PublicCall) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_57(%self.param: ref %PublicCall) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param)
// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call imports.%PublicCall.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- import_overload_set_protected_base.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
@@ -2042,6 +2101,7 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: %PublicCall: type = class_type @PublicCall [concrete]
// CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.type: type = cpp_overload_set_type @PublicCall.PublicCall.cpp_overload_set [concrete]
// CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.value: %PublicCall.PublicCall.cpp_overload_set.type = cpp_overload_set_value @PublicCall.PublicCall.cpp_overload_set [concrete]
// CHECK:STDOUT: %pattern_type.871: type = pattern_type %PublicCall [concrete]
// CHECK:STDOUT: %ptr.d0a: type = ptr_type %PublicCall [concrete]
// CHECK:STDOUT: %PublicCall__carbon_thunk.type: type = fn_type @PublicCall__carbon_thunk [concrete]
// CHECK:STDOUT: %PublicCall__carbon_thunk: %PublicCall__carbon_thunk.type = struct_value () [concrete]
@@ -2049,18 +2109,31 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: %OverloadSet__carbon_thunk.type.c7f6eb.1: type = fn_type @OverloadSet__carbon_thunk.1 [concrete]
// CHECK:STDOUT: %OverloadSet__carbon_thunk.e50482.1: %OverloadSet__carbon_thunk.type.c7f6eb.1 = struct_value () [concrete]
// CHECK:STDOUT: %.244: type = partial_type %OverloadSet [concrete]
// CHECK:STDOUT: %self.param_patt.ced: %pattern_type.871 = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.d01: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt.ced [concrete]
// CHECK:STDOUT: %PublicCall.cpp_destructor.type: type = fn_type @PublicCall.cpp_destructor [concrete]
// CHECK:STDOUT: %PublicCall.cpp_destructor: %PublicCall.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
// CHECK:STDOUT: %ProtectedCall: type = class_type @ProtectedCall [concrete]
// CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.type: type = cpp_overload_set_type @ProtectedCall.ProtectedCall.cpp_overload_set [concrete]
// CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.value: %ProtectedCall.ProtectedCall.cpp_overload_set.type = cpp_overload_set_value @ProtectedCall.ProtectedCall.cpp_overload_set [concrete]
// CHECK:STDOUT: %pattern_type.5fa: type = pattern_type %ProtectedCall [concrete]
// CHECK:STDOUT: %ptr.bc1: type = ptr_type %ProtectedCall [concrete]
// CHECK:STDOUT: %ProtectedCall__carbon_thunk.type: type = fn_type @ProtectedCall__carbon_thunk [concrete]
// CHECK:STDOUT: %ProtectedCall__carbon_thunk: %ProtectedCall__carbon_thunk.type = struct_value () [concrete]
// CHECK:STDOUT: %OverloadSet__carbon_thunk.type.c7f6eb.2: type = fn_type @OverloadSet__carbon_thunk.2 [concrete]
// CHECK:STDOUT: %OverloadSet__carbon_thunk.e50482.2: %OverloadSet__carbon_thunk.type.c7f6eb.2 = struct_value () [concrete]
// CHECK:STDOUT: %self.param_patt.204: %pattern_type.5fa = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.47c: %pattern_type.5fa = wrapper_binding_pattern self, %self.param_patt.204 [concrete]
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.type: type = fn_type @ProtectedCall.cpp_destructor [concrete]
// CHECK:STDOUT: %ProtectedCall.cpp_destructor: %ProtectedCall.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc17 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc17 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete]
// CHECK:STDOUT: %OverloadSet.Overload.cpp_overload_set.type: type = cpp_overload_set_type @OverloadSet.Overload.cpp_overload_set [concrete]
// CHECK:STDOUT: %OverloadSet.Overload.cpp_overload_set.value: %OverloadSet.Overload.cpp_overload_set.type = cpp_overload_set_value @OverloadSet.Overload.cpp_overload_set [concrete]
// CHECK:STDOUT: %Overload__carbon_thunk.type.3dd392.1: type = fn_type @Overload__carbon_thunk.1 [concrete]
@@ -2090,6 +2163,11 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %PublicCall.cpp_destructor.decl: %PublicCall.cpp_destructor.type = fn_decl @PublicCall.cpp_destructor [concrete = constants.%PublicCall.cpp_destructor] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %ProtectedCall.decl: type = class_decl @ProtectedCall [concrete = constants.%ProtectedCall] {} {}
// CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.value: %ProtectedCall.ProtectedCall.cpp_overload_set.type = cpp_overload_set_value @ProtectedCall.ProtectedCall.cpp_overload_set [concrete = constants.%ProtectedCall.ProtectedCall.cpp_overload_set.value]
// CHECK:STDOUT: %ProtectedCall__carbon_thunk.decl: %ProtectedCall__carbon_thunk.type = fn_decl @ProtectedCall__carbon_thunk [concrete = constants.%ProtectedCall__carbon_thunk] {
@@ -2102,6 +2180,11 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.decl: %ProtectedCall.cpp_destructor.type = fn_decl @ProtectedCall.cpp_destructor [concrete = constants.%ProtectedCall.cpp_destructor] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %OverloadSet.Overload.cpp_overload_set.value: %OverloadSet.Overload.cpp_overload_set.type = cpp_overload_set_value @OverloadSet.Overload.cpp_overload_set [concrete = constants.%OverloadSet.Overload.cpp_overload_set.value]
// CHECK:STDOUT: %Overload__carbon_thunk.decl.c2f84f.1: %Overload__carbon_thunk.type.3dd392.1 = fn_decl @Overload__carbon_thunk.1 [concrete = constants.%Overload__carbon_thunk.1c804c.1] {
// CHECK:STDOUT: <elided>
@@ -2115,6 +2198,23 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generated {
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.871 = ref_param_pattern [concrete = constants.%self.param_patt.ced]
// CHECK:STDOUT: %self.patt: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d01]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %PublicCall = ref_param call_param0
// CHECK:STDOUT: %self: ref %PublicCall = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc17 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.5fa = ref_param_pattern [concrete = constants.%self.param_patt.204]
// CHECK:STDOUT: %self.patt: %pattern_type.5fa = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.47c]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %ProtectedCall = ref_param call_param0
// CHECK:STDOUT: %self: ref %ProtectedCall = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @D {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: complete_type_witness = %complete_type
@@ -2156,8 +2256,8 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: %.loc11_61.5: init %OverloadSet = as_compatible %.loc11_61.4
// CHECK:STDOUT: %.loc11_61.6: init %D to %return.param = class_init (%.loc11_61.5)
// CHECK:STDOUT: %.loc11_62: init %D = converted %.loc11_61.2, %.loc11_61.6
// CHECK:STDOUT: %PublicCall.cpp_destructor.bound: <bound method> = bound_method %.loc11_59.3, constants.%PublicCall.cpp_destructor
// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound(%.loc11_59.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc11_59.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc11_59.3)
// CHECK:STDOUT: return %.loc11_62 to %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -2185,8 +2285,8 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: %.loc17_67.5: init %OverloadSet = as_compatible %.loc17_67.4
// CHECK:STDOUT: %.loc17_67.6: init %D to %return.param = class_init (%.loc17_67.5)
// CHECK:STDOUT: %.loc17_68: init %D = converted %.loc17_67.2, %.loc17_67.6
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.bound: <bound method> = bound_method %.loc17_65.3, constants.%ProtectedCall.cpp_destructor
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.call: init %empty_tuple.type = call %ProtectedCall.cpp_destructor.bound(%.loc17_65.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc17_65.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc17_65.3)
// CHECK:STDOUT: return %.loc17_68 to %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -2205,8 +2305,8 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: %.loc23_40.5: ref %PublicCall = value_as_ref %.loc23_40.4
// CHECK:STDOUT: %addr.loc23_41: %ptr.d0a = addr_of %.loc23_40.5
// CHECK:STDOUT: %Overload__carbon_thunk.call: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl.c2f84f.1(%addr.loc23_41)
// CHECK:STDOUT: %PublicCall.cpp_destructor.bound: <bound method> = bound_method %.loc23_40.3, constants.%PublicCall.cpp_destructor
// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound(%.loc23_40.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc23_40.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc23_40.3)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -2225,11 +2325,29 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: %.loc29_46.5: ref %ProtectedCall = value_as_ref %.loc29_46.4
// CHECK:STDOUT: %addr.loc29_47: %ptr.bc1 = addr_of %.loc29_46.5
// CHECK:STDOUT: %Overload__carbon_thunk.call: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl.c2f84f.2(%addr.loc29_47)
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.bound: <bound method> = bound_method %.loc29_46.3, constants.%ProtectedCall.cpp_destructor
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.call: init %empty_tuple.type = call %ProtectedCall.cpp_destructor.bound(%.loc29_46.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc29_46.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc29_46.3)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %PublicCall) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11(%self.param: ref %PublicCall) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call imports.%PublicCall.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17(%self.param: ref %ProtectedCall) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc17(%self.param: ref %ProtectedCall) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param)
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.call: init %empty_tuple.type = call imports.%ProtectedCall.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- import_overload_set_public_base_class_call_public.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
@@ -2241,13 +2359,20 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: %PublicCall: type = class_type @PublicCall [concrete]
// CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.type: type = cpp_overload_set_type @PublicCall.PublicCall.cpp_overload_set [concrete]
// CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.value: %PublicCall.PublicCall.cpp_overload_set.type = cpp_overload_set_value @PublicCall.PublicCall.cpp_overload_set [concrete]
// CHECK:STDOUT: %pattern_type.871: type = pattern_type %PublicCall [concrete]
// CHECK:STDOUT: %ptr.d0a: type = ptr_type %PublicCall [concrete]
// CHECK:STDOUT: %PublicCall__carbon_thunk.type: type = fn_type @PublicCall__carbon_thunk [concrete]
// CHECK:STDOUT: %PublicCall__carbon_thunk: %PublicCall__carbon_thunk.type = struct_value () [concrete]
// CHECK:STDOUT: %Overload__carbon_thunk.type: type = fn_type @Overload__carbon_thunk [concrete]
// CHECK:STDOUT: %Overload__carbon_thunk: %Overload__carbon_thunk.type = struct_value () [concrete]
// CHECK:STDOUT: %self.param_patt.ced: %pattern_type.871 = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.d01: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt.ced [concrete]
// CHECK:STDOUT: %PublicCall.cpp_destructor.type: type = fn_type @PublicCall.cpp_destructor [concrete]
// CHECK:STDOUT: %PublicCall.cpp_destructor: %PublicCall.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -2270,6 +2395,21 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %PublicCall.cpp_destructor.decl: %PublicCall.cpp_destructor.type = fn_decl @PublicCall.cpp_destructor [concrete = constants.%PublicCall.cpp_destructor] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generated {
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.871 = ref_param_pattern [concrete = constants.%self.param_patt.ced]
// CHECK:STDOUT: %self.patt: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d01]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %PublicCall = ref_param call_param0
// CHECK:STDOUT: %self: ref %PublicCall = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
@@ -2289,11 +2429,20 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: %.loc8_57.5: ref %PublicCall = value_as_ref %.loc8_57.4
// CHECK:STDOUT: %addr.loc8_58: %ptr.d0a = addr_of %.loc8_57.5
// CHECK:STDOUT: %Overload__carbon_thunk.call: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl(%addr.loc8_58)
// CHECK:STDOUT: %PublicCall.cpp_destructor.bound: <bound method> = bound_method %.loc8_57.3, constants.%PublicCall.cpp_destructor
// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound(%.loc8_57.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc8_57.3, constants.%Destroy.WithSelf.SelfDestruct.db3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_57.3)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %PublicCall) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %PublicCall) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call imports.%PublicCall.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- import_overload_set_public_base_class_derived_call_non_private.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
@@ -2306,23 +2455,37 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: %PublicCall: type = class_type @PublicCall [concrete]
// CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.type: type = cpp_overload_set_type @PublicCall.PublicCall.cpp_overload_set [concrete]
// CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.value: %PublicCall.PublicCall.cpp_overload_set.type = cpp_overload_set_value @PublicCall.PublicCall.cpp_overload_set [concrete]
// CHECK:STDOUT: %pattern_type.871: type = pattern_type %PublicCall [concrete]
// CHECK:STDOUT: %ptr.d0a: type = ptr_type %PublicCall [concrete]
// CHECK:STDOUT: %PublicCall__carbon_thunk.type: type = fn_type @PublicCall__carbon_thunk [concrete]
// CHECK:STDOUT: %PublicCall__carbon_thunk: %PublicCall__carbon_thunk.type = struct_value () [concrete]
// CHECK:STDOUT: %Overload__carbon_thunk.type.3dd392.1: type = fn_type @Overload__carbon_thunk.1 [concrete]
// CHECK:STDOUT: %Overload__carbon_thunk.1c804c.1: %Overload__carbon_thunk.type.3dd392.1 = struct_value () [concrete]
// CHECK:STDOUT: %self.param_patt.ced: %pattern_type.871 = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.d01: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt.ced [concrete]
// CHECK:STDOUT: %PublicCall.cpp_destructor.type: type = fn_type @PublicCall.cpp_destructor [concrete]
// CHECK:STDOUT: %PublicCall.cpp_destructor: %PublicCall.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
// CHECK:STDOUT: %ProtectedCall: type = class_type @ProtectedCall [concrete]
// CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.type: type = cpp_overload_set_type @ProtectedCall.ProtectedCall.cpp_overload_set [concrete]
// CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.value: %ProtectedCall.ProtectedCall.cpp_overload_set.type = cpp_overload_set_value @ProtectedCall.ProtectedCall.cpp_overload_set [concrete]
// CHECK:STDOUT: %pattern_type.5fa: type = pattern_type %ProtectedCall [concrete]
// CHECK:STDOUT: %ptr.bc1: type = ptr_type %ProtectedCall [concrete]
// CHECK:STDOUT: %ProtectedCall__carbon_thunk.type: type = fn_type @ProtectedCall__carbon_thunk [concrete]
// CHECK:STDOUT: %ProtectedCall__carbon_thunk: %ProtectedCall__carbon_thunk.type = struct_value () [concrete]
// CHECK:STDOUT: %Overload__carbon_thunk.type.3dd392.2: type = fn_type @Overload__carbon_thunk.2 [concrete]
// CHECK:STDOUT: %Overload__carbon_thunk.1c804c.2: %Overload__carbon_thunk.type.3dd392.2 = struct_value () [concrete]
// CHECK:STDOUT: %self.param_patt.204: %pattern_type.5fa = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.47c: %pattern_type.5fa = wrapper_binding_pattern self, %self.param_patt.204 [concrete]
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.type: type = fn_type @ProtectedCall.cpp_destructor [concrete]
// CHECK:STDOUT: %ProtectedCall.cpp_destructor: %ProtectedCall.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc12 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -2346,6 +2509,11 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %PublicCall.cpp_destructor.decl: %PublicCall.cpp_destructor.type = fn_decl @PublicCall.cpp_destructor [concrete = constants.%PublicCall.cpp_destructor] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %ProtectedCall.decl: type = class_decl @ProtectedCall [concrete = constants.%ProtectedCall] {} {}
// CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.value: %ProtectedCall.ProtectedCall.cpp_overload_set.type = cpp_overload_set_value @ProtectedCall.ProtectedCall.cpp_overload_set [concrete = constants.%ProtectedCall.ProtectedCall.cpp_overload_set.value]
// CHECK:STDOUT: %ProtectedCall__carbon_thunk.decl: %ProtectedCall__carbon_thunk.type = fn_decl @ProtectedCall__carbon_thunk [concrete = constants.%ProtectedCall__carbon_thunk] {
@@ -2358,6 +2526,28 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.decl: %ProtectedCall.cpp_destructor.type = fn_decl @ProtectedCall.cpp_destructor [concrete = constants.%ProtectedCall.cpp_destructor] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generated {
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.871 = ref_param_pattern [concrete = constants.%self.param_patt.ced]
// CHECK:STDOUT: %self.patt: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d01]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %PublicCall = ref_param call_param0
// CHECK:STDOUT: %self: ref %PublicCall = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc12 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.5fa = ref_param_pattern [concrete = constants.%self.param_patt.204]
// CHECK:STDOUT: %self.patt: %pattern_type.5fa = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.47c]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %ProtectedCall = ref_param call_param0
// CHECK:STDOUT: %self: ref %ProtectedCall = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Derived {
@@ -2387,8 +2577,8 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: %.loc11_40.5: ref %PublicCall = value_as_ref %.loc11_40.4
// CHECK:STDOUT: %addr.loc11_41: %ptr.d0a = addr_of %.loc11_40.5
// CHECK:STDOUT: %Overload__carbon_thunk.call.loc11: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl.c2f84f.1(%addr.loc11_41)
// CHECK:STDOUT: %PublicCall.cpp_destructor.bound: <bound method> = bound_method %.loc11_40.3, constants.%PublicCall.cpp_destructor
// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound(%.loc11_40.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11: <bound method> = bound_method %.loc11_40.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11(%.loc11_40.3)
// CHECK:STDOUT: %Overload.ref.loc12: %OverloadPublic.Overload.cpp_overload_set.type = name_ref Overload, imports.%OverloadPublic.Overload.cpp_overload_set.value [concrete = constants.%OverloadPublic.Overload.cpp_overload_set.value]
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %ProtectedCall.ref.loc12_17: type = name_ref ProtectedCall, imports.%ProtectedCall.decl [concrete = constants.%ProtectedCall]
@@ -2402,11 +2592,29 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: %.loc12_46.5: ref %ProtectedCall = value_as_ref %.loc12_46.4
// CHECK:STDOUT: %addr.loc12_47: %ptr.bc1 = addr_of %.loc12_46.5
// CHECK:STDOUT: %Overload__carbon_thunk.call.loc12: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl.c2f84f.2(%addr.loc12_47)
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.bound: <bound method> = bound_method %.loc12_46.3, constants.%ProtectedCall.cpp_destructor
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.call: init %empty_tuple.type = call %ProtectedCall.cpp_destructor.bound(%.loc12_46.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc12: <bound method> = bound_method %.loc12_46.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc12(%.loc12_46.3)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %PublicCall) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11(%self.param: ref %PublicCall) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call imports.%PublicCall.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12(%self.param: ref %ProtectedCall) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12(%self.param: ref %ProtectedCall) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param)
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.call: init %empty_tuple.type = call imports.%ProtectedCall.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- import_overload_set_protected_base_class_derived_call_non_private.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
@@ -2419,23 +2627,37 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: %PublicCall: type = class_type @PublicCall [concrete]
// CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.type: type = cpp_overload_set_type @PublicCall.PublicCall.cpp_overload_set [concrete]
// CHECK:STDOUT: %PublicCall.PublicCall.cpp_overload_set.value: %PublicCall.PublicCall.cpp_overload_set.type = cpp_overload_set_value @PublicCall.PublicCall.cpp_overload_set [concrete]
// CHECK:STDOUT: %pattern_type.871: type = pattern_type %PublicCall [concrete]
// CHECK:STDOUT: %ptr.d0a: type = ptr_type %PublicCall [concrete]
// CHECK:STDOUT: %PublicCall__carbon_thunk.type: type = fn_type @PublicCall__carbon_thunk [concrete]
// CHECK:STDOUT: %PublicCall__carbon_thunk: %PublicCall__carbon_thunk.type = struct_value () [concrete]
// CHECK:STDOUT: %Overload__carbon_thunk.type.3dd392.1: type = fn_type @Overload__carbon_thunk.1 [concrete]
// CHECK:STDOUT: %Overload__carbon_thunk.1c804c.1: %Overload__carbon_thunk.type.3dd392.1 = struct_value () [concrete]
// CHECK:STDOUT: %self.param_patt.ced: %pattern_type.871 = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.d01: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt.ced [concrete]
// CHECK:STDOUT: %PublicCall.cpp_destructor.type: type = fn_type @PublicCall.cpp_destructor [concrete]
// CHECK:STDOUT: %PublicCall.cpp_destructor: %PublicCall.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc11 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc11 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
// CHECK:STDOUT: %ProtectedCall: type = class_type @ProtectedCall [concrete]
// CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.type: type = cpp_overload_set_type @ProtectedCall.ProtectedCall.cpp_overload_set [concrete]
// CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.value: %ProtectedCall.ProtectedCall.cpp_overload_set.type = cpp_overload_set_value @ProtectedCall.ProtectedCall.cpp_overload_set [concrete]
// CHECK:STDOUT: %pattern_type.5fa: type = pattern_type %ProtectedCall [concrete]
// CHECK:STDOUT: %ptr.bc1: type = ptr_type %ProtectedCall [concrete]
// CHECK:STDOUT: %ProtectedCall__carbon_thunk.type: type = fn_type @ProtectedCall__carbon_thunk [concrete]
// CHECK:STDOUT: %ProtectedCall__carbon_thunk: %ProtectedCall__carbon_thunk.type = struct_value () [concrete]
// CHECK:STDOUT: %Overload__carbon_thunk.type.3dd392.2: type = fn_type @Overload__carbon_thunk.2 [concrete]
// CHECK:STDOUT: %Overload__carbon_thunk.1c804c.2: %Overload__carbon_thunk.type.3dd392.2 = struct_value () [concrete]
// CHECK:STDOUT: %self.param_patt.204: %pattern_type.5fa = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.47c: %pattern_type.5fa = wrapper_binding_pattern self, %self.param_patt.204 [concrete]
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.type: type = fn_type @ProtectedCall.cpp_destructor [concrete]
// CHECK:STDOUT: %ProtectedCall.cpp_destructor: %ProtectedCall.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc12 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc12 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -2459,6 +2681,11 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %PublicCall.cpp_destructor.decl: %PublicCall.cpp_destructor.type = fn_decl @PublicCall.cpp_destructor [concrete = constants.%PublicCall.cpp_destructor] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %ProtectedCall.decl: type = class_decl @ProtectedCall [concrete = constants.%ProtectedCall] {} {}
// CHECK:STDOUT: %ProtectedCall.ProtectedCall.cpp_overload_set.value: %ProtectedCall.ProtectedCall.cpp_overload_set.type = cpp_overload_set_value @ProtectedCall.ProtectedCall.cpp_overload_set [concrete = constants.%ProtectedCall.ProtectedCall.cpp_overload_set.value]
// CHECK:STDOUT: %ProtectedCall__carbon_thunk.decl: %ProtectedCall__carbon_thunk.type = fn_decl @ProtectedCall__carbon_thunk [concrete = constants.%ProtectedCall__carbon_thunk] {
@@ -2471,6 +2698,28 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.decl: %ProtectedCall.cpp_destructor.type = fn_decl @ProtectedCall.cpp_destructor [concrete = constants.%ProtectedCall.cpp_destructor] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generated {
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc11 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.871 = ref_param_pattern [concrete = constants.%self.param_patt.ced]
// CHECK:STDOUT: %self.patt: %pattern_type.871 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d01]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %PublicCall = ref_param call_param0
// CHECK:STDOUT: %self: ref %PublicCall = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc12 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.5fa = ref_param_pattern [concrete = constants.%self.param_patt.204]
// CHECK:STDOUT: %self.patt: %pattern_type.5fa = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.47c]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %ProtectedCall = ref_param call_param0
// CHECK:STDOUT: %self: ref %ProtectedCall = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @Derived {
@@ -2500,8 +2749,8 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: %.loc11_40.5: ref %PublicCall = value_as_ref %.loc11_40.4
// CHECK:STDOUT: %addr.loc11_41: %ptr.d0a = addr_of %.loc11_40.5
// CHECK:STDOUT: %Overload__carbon_thunk.call.loc11: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl.c2f84f.1(%addr.loc11_41)
// CHECK:STDOUT: %PublicCall.cpp_destructor.bound: <bound method> = bound_method %.loc11_40.3, constants.%PublicCall.cpp_destructor
// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call %PublicCall.cpp_destructor.bound(%.loc11_40.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc11: <bound method> = bound_method %.loc11_40.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc11(%.loc11_40.3)
// CHECK:STDOUT: %Overload.ref.loc12: %OverloadProtected.Overload.cpp_overload_set.type = name_ref Overload, imports.%OverloadProtected.Overload.cpp_overload_set.value [concrete = constants.%OverloadProtected.Overload.cpp_overload_set.value]
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
// CHECK:STDOUT: %ProtectedCall.ref.loc12_17: type = name_ref ProtectedCall, imports.%ProtectedCall.decl [concrete = constants.%ProtectedCall]
@@ -2515,11 +2764,29 @@ fn Call(var instance: Cpp.PublicPrivate) {
// CHECK:STDOUT: %.loc12_46.5: ref %ProtectedCall = value_as_ref %.loc12_46.4
// CHECK:STDOUT: %addr.loc12_47: %ptr.bc1 = addr_of %.loc12_46.5
// CHECK:STDOUT: %Overload__carbon_thunk.call.loc12: init %empty_tuple.type = call imports.%Overload__carbon_thunk.decl.c2f84f.2(%addr.loc12_47)
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.bound: <bound method> = bound_method %.loc12_46.3, constants.%ProtectedCall.cpp_destructor
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.call: init %empty_tuple.type = call %ProtectedCall.cpp_destructor.bound(%.loc12_46.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc12: <bound method> = bound_method %.loc12_46.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc12: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc12(%.loc12_46.3)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc11(%self.param: ref %PublicCall) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc11(%self.param: ref %PublicCall) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
// CHECK:STDOUT: %PublicCall.cpp_destructor.call: init %empty_tuple.type = call imports.%PublicCall.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc12(%self.param: ref %ProtectedCall) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc12(%self.param: ref %ProtectedCall) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param)
// CHECK:STDOUT: %ProtectedCall.cpp_destructor.call: init %empty_tuple.type = call imports.%ProtectedCall.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- base_class_public_access_allowed.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
@@ -324,8 +324,14 @@ fn F() {
// CHECK:STDOUT: %ptr.d69: type = ptr_type %DefaultC [concrete]
// CHECK:STDOUT: %DefaultC__carbon_thunk.type: type = fn_type @DefaultC__carbon_thunk [concrete]
// CHECK:STDOUT: %DefaultC__carbon_thunk: %DefaultC__carbon_thunk.type = struct_value () [concrete]
// CHECK:STDOUT: %self.param_patt.950: %pattern_type.903 = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.659: %pattern_type.903 = wrapper_binding_pattern self, %self.param_patt.950 [concrete]
// CHECK:STDOUT: %DefaultC.cpp_destructor.type: type = fn_type @DefaultC.cpp_destructor [concrete]
// CHECK:STDOUT: %DefaultC.cpp_destructor: %DefaultC.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -340,6 +346,21 @@ fn F() {
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %DefaultC.cpp_destructor.decl: %DefaultC.cpp_destructor.type = fn_decl @DefaultC.cpp_destructor [concrete = constants.%DefaultC.cpp_destructor] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generated {
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.903 = ref_param_pattern [concrete = constants.%self.param_patt.950]
// CHECK:STDOUT: %self.patt: %pattern_type.903 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.659]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %DefaultC = ref_param call_param0
// CHECK:STDOUT: %self: ref %DefaultC = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
@@ -361,11 +382,20 @@ fn F() {
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %c.patt: %pattern_type.903 = value_binding_pattern c [concrete = constants.%c.patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: %DefaultC.cpp_destructor.bound: <bound method> = bound_method %.loc8_54.3, constants.%DefaultC.cpp_destructor
// CHECK:STDOUT: %DefaultC.cpp_destructor.call: init %empty_tuple.type = call %DefaultC.cpp_destructor.bound(%.loc8_54.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc8_54.3, constants.%Destroy.WithSelf.SelfDestruct.db3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_54.3)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %DefaultC) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %DefaultC) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
// CHECK:STDOUT: %DefaultC.cpp_destructor.call: init %empty_tuple.type = call imports.%DefaultC.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- implicit_default.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
@@ -386,8 +416,14 @@ fn F() {
// CHECK:STDOUT: %Default.facet.53e: %Default.type = facet_value %DefaultC, (%custom_witness.9b4) [concrete]
// CHECK:STDOUT: %DefaultOrUnformed.impl_witness.db1: <witness> = impl_witness imports.%DefaultOrUnformed.impl_witness_table.162, @T.as_type.as.DefaultOrUnformed.impl(%Default.facet.53e) [concrete]
// CHECK:STDOUT: %DefaultOrUnformed.facet.898: %DefaultOrUnformed.type = facet_value %DefaultC, (%DefaultOrUnformed.impl_witness.db1) [concrete]
// CHECK:STDOUT: %self.param_patt.950: %pattern_type.903 = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.659: %pattern_type.903 = wrapper_binding_pattern self, %self.param_patt.950 [concrete]
// CHECK:STDOUT: %DefaultC.cpp_destructor.type: type = fn_type @DefaultC.cpp_destructor [concrete]
// CHECK:STDOUT: %DefaultC.cpp_destructor: %DefaultC.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -398,6 +434,21 @@ fn F() {
// CHECK:STDOUT: %DefaultC.decl: type = class_decl @DefaultC [concrete = constants.%DefaultC] {} {}
// CHECK:STDOUT: %Core.import_ref.c2f: @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op.type (%T.as_type.as.DefaultOrUnformed.impl.Op.type.0c9) = import_ref Core//prelude/parts/default, loc{{\d+_\d+}}, loaded [symbolic = @T.as_type.as.DefaultOrUnformed.impl.%T.as_type.as.DefaultOrUnformed.impl.Op (constants.%T.as_type.as.DefaultOrUnformed.impl.Op.cfe)]
// CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.162 = impl_witness_table (%Core.import_ref.c2f), @T.as_type.as.DefaultOrUnformed.impl [concrete]
// CHECK:STDOUT: %DefaultC.cpp_destructor.decl: %DefaultC.cpp_destructor.type = fn_decl @DefaultC.cpp_destructor [concrete = constants.%DefaultC.cpp_destructor] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generated {
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.903 = ref_param_pattern [concrete = constants.%self.param_patt.950]
// CHECK:STDOUT: %self.patt: %pattern_type.903 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.659]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %DefaultC = ref_param call_param0
// CHECK:STDOUT: %self: ref %DefaultC = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
@@ -420,11 +471,20 @@ fn F() {
// CHECK:STDOUT: %c.patt: %pattern_type.903 = ref_binding_pattern c [concrete = constants.%c.patt]
// CHECK:STDOUT: %c.var_patt: %pattern_type.903 = var_pattern %c.patt [concrete = constants.%c.var_patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: %DefaultC.cpp_destructor.bound: <bound method> = bound_method %c.var, constants.%DefaultC.cpp_destructor
// CHECK:STDOUT: %DefaultC.cpp_destructor.call: init %empty_tuple.type = call %DefaultC.cpp_destructor.bound(%c.var)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %c.var, constants.%Destroy.WithSelf.SelfDestruct.db3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%c.var)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %DefaultC) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %DefaultC) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
// CHECK:STDOUT: %DefaultC.cpp_destructor.call: init %empty_tuple.type = call imports.%DefaultC.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- import_non_default.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
@@ -459,8 +519,14 @@ fn F() {
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.efc: <bound method> = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete]
// CHECK:STDOUT: %bound_method.c5c: <bound method> = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
// CHECK:STDOUT: %int_456.8dd: %i32 = int_value 456 [concrete]
// CHECK:STDOUT: %self.param_patt.409: %pattern_type.714 = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.f57: %pattern_type.714 = wrapper_binding_pattern self, %self.param_patt.409 [concrete]
// CHECK:STDOUT: %NonDefaultC.cpp_destructor.type: type = fn_type @NonDefaultC.cpp_destructor [concrete]
// CHECK:STDOUT: %NonDefaultC.cpp_destructor: %NonDefaultC.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc8 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -477,6 +543,21 @@ fn F() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.845)]
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
// CHECK:STDOUT: %NonDefaultC.cpp_destructor.decl: %NonDefaultC.cpp_destructor.type = fn_decl @NonDefaultC.cpp_destructor [concrete = constants.%NonDefaultC.cpp_destructor] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generated {
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc8 [concrete = constants.%Destroy.WithSelf.Op.403] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.714 = ref_param_pattern [concrete = constants.%self.param_patt.409]
// CHECK:STDOUT: %self.patt: %pattern_type.714 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.f57]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %NonDefaultC = ref_param call_param0
// CHECK:STDOUT: %self: ref %NonDefaultC = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
@@ -514,11 +595,20 @@ fn F() {
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %c.patt: %pattern_type.714 = value_binding_pattern c [concrete = constants.%c.patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: %NonDefaultC.cpp_destructor.bound: <bound method> = bound_method %.loc8_71.3, constants.%NonDefaultC.cpp_destructor
// CHECK:STDOUT: %NonDefaultC.cpp_destructor.call: init %empty_tuple.type = call %NonDefaultC.cpp_destructor.bound(%.loc8_71.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc8_71.3, constants.%Destroy.WithSelf.SelfDestruct.db3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc8_71.3)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8(%self.param: ref %NonDefaultC) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8(%self.param: ref %NonDefaultC) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
// CHECK:STDOUT: %NonDefaultC.cpp_destructor.call: init %empty_tuple.type = call imports.%NonDefaultC.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- import_multiple.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
@@ -556,8 +646,14 @@ fn F() {
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.efc: <bound method> = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e39 [concrete]
// CHECK:STDOUT: %bound_method.c5c: <bound method> = bound_method %int_456.010, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
// CHECK:STDOUT: %int_456.8dd: %i32 = int_value 456 [concrete]
// CHECK:STDOUT: %self.param_patt.cf3: %pattern_type.56a = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.1f8: %pattern_type.56a = wrapper_binding_pattern self, %self.param_patt.cf3 [concrete]
// CHECK:STDOUT: %MultipleC.cpp_destructor.type: type = fn_type @MultipleC.cpp_destructor [concrete]
// CHECK:STDOUT: %MultipleC.cpp_destructor: %MultipleC.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -579,6 +675,21 @@ fn F() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import_ref.edf: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.845)]
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
// CHECK:STDOUT: %MultipleC.cpp_destructor.decl: %MultipleC.cpp_destructor.type = fn_decl @MultipleC.cpp_destructor [concrete = constants.%MultipleC.cpp_destructor] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generated {
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.56a = ref_param_pattern [concrete = constants.%self.param_patt.cf3]
// CHECK:STDOUT: %self.patt: %pattern_type.56a = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1f8]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %MultipleC = ref_param call_param0
// CHECK:STDOUT: %self: ref %MultipleC = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
@@ -633,13 +744,22 @@ fn F() {
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %c2.patt: %pattern_type.56a = value_binding_pattern c2 [concrete = constants.%c2.patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: %MultipleC.cpp_destructor.bound.loc9: <bound method> = bound_method %.loc9_66.3, constants.%MultipleC.cpp_destructor
// CHECK:STDOUT: %MultipleC.cpp_destructor.call.loc9: init %empty_tuple.type = call %MultipleC.cpp_destructor.bound.loc9(%.loc9_66.3)
// CHECK:STDOUT: %MultipleC.cpp_destructor.bound.loc8: <bound method> = bound_method %.loc8_58.3, constants.%MultipleC.cpp_destructor
// CHECK:STDOUT: %MultipleC.cpp_destructor.call.loc8: init %empty_tuple.type = call %MultipleC.cpp_destructor.bound.loc8(%.loc8_58.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: <bound method> = bound_method %.loc9_66.3, constants.%Destroy.WithSelf.SelfDestruct.db3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_66.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: <bound method> = bound_method %.loc8_58.3, constants.%Destroy.WithSelf.SelfDestruct.db3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_58.3)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %MultipleC) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %MultipleC) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
// CHECK:STDOUT: %MultipleC.cpp_destructor.call: init %empty_tuple.type = call imports.%MultipleC.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- import_default_arguments.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
@@ -677,8 +797,14 @@ fn F() {
// CHECK:STDOUT: %c2.patt: %pattern_type.52d = value_binding_pattern c2 [concrete]
// CHECK:STDOUT: %DefaultArgsC__carbon_thunk.type.4c24d7.2: type = fn_type @DefaultArgsC__carbon_thunk.2 [concrete]
// CHECK:STDOUT: %DefaultArgsC__carbon_thunk.137e61.2: %DefaultArgsC__carbon_thunk.type.4c24d7.2 = struct_value () [concrete]
// CHECK:STDOUT: %self.param_patt.32c: %pattern_type.52d = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.8dd: %pattern_type.52d = wrapper_binding_pattern self, %self.param_patt.32c [concrete]
// CHECK:STDOUT: %DefaultArgsC.cpp_destructor.type: type = fn_type @DefaultArgsC.cpp_destructor [concrete]
// CHECK:STDOUT: %DefaultArgsC.cpp_destructor: %DefaultArgsC.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -700,6 +826,21 @@ fn F() {
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %DefaultArgsC.cpp_destructor.decl: %DefaultArgsC.cpp_destructor.type = fn_decl @DefaultArgsC.cpp_destructor [concrete = constants.%DefaultArgsC.cpp_destructor] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generated {
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.52d = ref_param_pattern [concrete = constants.%self.param_patt.32c]
// CHECK:STDOUT: %self.patt: %pattern_type.52d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.8dd]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %DefaultArgsC = ref_param call_param0
// CHECK:STDOUT: %self: ref %DefaultArgsC = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
@@ -762,13 +903,22 @@ fn F() {
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %c2.patt: %pattern_type.52d = value_binding_pattern c2 [concrete = constants.%c2.patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: %DefaultArgsC.cpp_destructor.bound.loc9: <bound method> = bound_method %.loc9_68.3, constants.%DefaultArgsC.cpp_destructor
// CHECK:STDOUT: %DefaultArgsC.cpp_destructor.call.loc9: init %empty_tuple.type = call %DefaultArgsC.cpp_destructor.bound.loc9(%.loc9_68.3)
// CHECK:STDOUT: %DefaultArgsC.cpp_destructor.bound.loc8: <bound method> = bound_method %.loc8_71.3, constants.%DefaultArgsC.cpp_destructor
// CHECK:STDOUT: %DefaultArgsC.cpp_destructor.call.loc8: init %empty_tuple.type = call %DefaultArgsC.cpp_destructor.bound.loc8(%.loc8_71.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: <bound method> = bound_method %.loc9_68.3, constants.%Destroy.WithSelf.SelfDestruct.db3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_68.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: <bound method> = bound_method %.loc8_71.3, constants.%Destroy.WithSelf.SelfDestruct.db3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_71.3)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %DefaultArgsC) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %DefaultArgsC) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
// CHECK:STDOUT: %DefaultArgsC.cpp_destructor.call: init %empty_tuple.type = call imports.%DefaultArgsC.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- import_template.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
@@ -803,6 +953,7 @@ fn F() {
// CHECK:STDOUT: %c2.patt: %pattern_type.f20 = ref_binding_pattern c2 [concrete]
// CHECK:STDOUT: %c2.var_patt: %pattern_type.f20 = var_pattern %c2.patt [concrete]
// CHECK:STDOUT: %true: bool = bool_literal true [concrete]
// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete]
// CHECK:STDOUT: %ptr.bb2: type = ptr_type bool [concrete]
// CHECK:STDOUT: %TemplateC__carbon_thunk.type.7462cf.2: type = fn_type @TemplateC__carbon_thunk.2 [concrete]
// CHECK:STDOUT: %TemplateC__carbon_thunk.a4007a.2: %TemplateC__carbon_thunk.type.7462cf.2 = struct_value () [concrete]
@@ -820,8 +971,23 @@ fn F() {
// CHECK:STDOUT: %c3.var_patt: %pattern_type.f20 = var_pattern %c3.patt [concrete]
// CHECK:STDOUT: %TemplateC__carbon_thunk.type.7462cf.3: type = fn_type @TemplateC__carbon_thunk.3 [concrete]
// CHECK:STDOUT: %TemplateC__carbon_thunk.a4007a.3: %TemplateC__carbon_thunk.type.7462cf.3 = struct_value () [concrete]
// CHECK:STDOUT: %self.param_patt.b59: %pattern_type.f20 = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.9d4: %pattern_type.f20 = wrapper_binding_pattern self, %self.param_patt.b59 [concrete]
// CHECK:STDOUT: %TemplateC.cpp_destructor.type: type = fn_type @TemplateC.cpp_destructor [concrete]
// CHECK:STDOUT: %TemplateC.cpp_destructor: %TemplateC.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01: %Destroy.WithSelf.SubobjectDestroy.type.dfc = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.e3b, %Destroy.WithSelf.SelfDestruct.db3fdb.2 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -850,6 +1016,35 @@ fn F() {
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %TemplateC.cpp_destructor.decl: %TemplateC.cpp_destructor.type = fn_decl @TemplateC.cpp_destructor [concrete = constants.%TemplateC.cpp_destructor] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generated {
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.f20 = ref_param_pattern [concrete = constants.%self.param_patt.b59]
// CHECK:STDOUT: %self.patt: %pattern_type.f20 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.9d4]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %TemplateC = ref_param call_param0
// CHECK:STDOUT: %self: ref %TemplateC = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d]
// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0
// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d]
// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0
// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
@@ -925,17 +1120,36 @@ fn F() {
// CHECK:STDOUT: %c3.patt: %pattern_type.f20 = ref_binding_pattern c3 [concrete = constants.%c3.patt]
// CHECK:STDOUT: %c3.var_patt: %pattern_type.f20 = var_pattern %c3.patt [concrete = constants.%c3.var_patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: %TemplateC.cpp_destructor.bound.loc10: <bound method> = bound_method %c3.var, constants.%TemplateC.cpp_destructor
// CHECK:STDOUT: %TemplateC.cpp_destructor.call.loc10: init %empty_tuple.type = call %TemplateC.cpp_destructor.bound.loc10(%c3.var)
// CHECK:STDOUT: %TemplateC.cpp_destructor.bound.loc9: <bound method> = bound_method %c2.var, constants.%TemplateC.cpp_destructor
// CHECK:STDOUT: %TemplateC.cpp_destructor.call.loc9: init %empty_tuple.type = call %TemplateC.cpp_destructor.bound.loc9(%c2.var)
// CHECK:STDOUT: %TemplateC.cpp_destructor.bound.loc8: <bound method> = bound_method %c1.var, constants.%TemplateC.cpp_destructor
// CHECK:STDOUT: %TemplateC.cpp_destructor.call.loc8: init %empty_tuple.type = call %TemplateC.cpp_destructor.bound.loc8(%c1.var)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: <bound method> = bound_method %c3.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%c3.var)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9_58: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.e3b)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: <bound method> = bound_method %c2.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9_3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%c2.var)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: <bound method> = bound_method %c1.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%c1.var)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %TemplateC) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %TemplateC) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
// CHECK:STDOUT: %TemplateC.cpp_destructor.call: init %empty_tuple.type = call imports.%TemplateC.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9(%self.param: ref bool) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref bool) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref bool) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param)
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- import_implicit_single_argument.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
@@ -979,8 +1193,14 @@ fn F() {
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.8a4 [concrete]
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.8a4, @Core.IntLiteral.as.As.impl.Convert(%int_32) [concrete]
// CHECK:STDOUT: %bound_method.07f: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
// CHECK:STDOUT: %self.param_patt.e73: %pattern_type.bac = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.a03: %pattern_type.bac = wrapper_binding_pattern self, %self.param_patt.e73 [concrete]
// CHECK:STDOUT: %SingleArgC.cpp_destructor.type: type = fn_type @SingleArgC.cpp_destructor [concrete]
// CHECK:STDOUT: %SingleArgC.cpp_destructor: %SingleArgC.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -999,6 +1219,21 @@ fn F() {
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
// CHECK:STDOUT: %Core.import_ref.64b: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.c5d) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.6ee)]
// CHECK:STDOUT: %As.impl_witness_table.d22 = impl_witness_table (%Core.import_ref.64b), @Core.IntLiteral.as.As.impl [concrete]
// CHECK:STDOUT: %SingleArgC.cpp_destructor.decl: %SingleArgC.cpp_destructor.type = fn_decl @SingleArgC.cpp_destructor [concrete = constants.%SingleArgC.cpp_destructor] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generated {
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.bac = ref_param_pattern [concrete = constants.%self.param_patt.e73]
// CHECK:STDOUT: %self.patt: %pattern_type.bac = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a03]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %SingleArgC = ref_param call_param0
// CHECK:STDOUT: %self: ref %SingleArgC = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
@@ -1052,13 +1287,22 @@ fn F() {
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %c2.patt: %pattern_type.bac = value_binding_pattern c2 [concrete = constants.%c2.patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: %SingleArgC.cpp_destructor.bound.loc9: <bound method> = bound_method %.loc9_37.6, constants.%SingleArgC.cpp_destructor
// CHECK:STDOUT: %SingleArgC.cpp_destructor.call.loc9: init %empty_tuple.type = call %SingleArgC.cpp_destructor.bound.loc9(%.loc9_37.6)
// CHECK:STDOUT: %SingleArgC.cpp_destructor.bound.loc8: <bound method> = bound_method %.loc8_62.3, constants.%SingleArgC.cpp_destructor
// CHECK:STDOUT: %SingleArgC.cpp_destructor.call.loc8: init %empty_tuple.type = call %SingleArgC.cpp_destructor.bound.loc8(%.loc8_62.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: <bound method> = bound_method %.loc9_37.6, constants.%Destroy.WithSelf.SelfDestruct.db3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_37.6)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: <bound method> = bound_method %.loc8_62.3, constants.%Destroy.WithSelf.SelfDestruct.db3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_62.3)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %SingleArgC) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %SingleArgC) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
// CHECK:STDOUT: %SingleArgC.cpp_destructor.call: init %empty_tuple.type = call imports.%SingleArgC.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- import_implicit_multi_arguments.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
@@ -1109,8 +1353,14 @@ fn F() {
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.8a4 [concrete]
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.8a4, @Core.IntLiteral.as.As.impl.Convert(%int_32) [concrete]
// CHECK:STDOUT: %bound_method.07f: <bound method> = bound_method %int_8.b85, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
// CHECK:STDOUT: %self.param_patt.fed: %pattern_type.b5c = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.585: %pattern_type.b5c = wrapper_binding_pattern self, %self.param_patt.fed [concrete]
// CHECK:STDOUT: %MultiArgC.cpp_destructor.type: type = fn_type @MultiArgC.cpp_destructor [concrete]
// CHECK:STDOUT: %MultiArgC.cpp_destructor: %MultiArgC.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -1134,6 +1384,21 @@ fn F() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import_ref.64b: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.c5d) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.6ee)]
// CHECK:STDOUT: %As.impl_witness_table.d22 = impl_witness_table (%Core.import_ref.64b), @Core.IntLiteral.as.As.impl [concrete]
// CHECK:STDOUT: %MultiArgC.cpp_destructor.decl: %MultiArgC.cpp_destructor.type = fn_decl @MultiArgC.cpp_destructor [concrete = constants.%MultiArgC.cpp_destructor] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generated {
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.b5c = ref_param_pattern [concrete = constants.%self.param_patt.fed]
// CHECK:STDOUT: %self.patt: %pattern_type.b5c = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.585]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %MultiArgC = ref_param call_param0
// CHECK:STDOUT: %self: ref %MultiArgC = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
@@ -1220,12 +1485,21 @@ fn F() {
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %c3.patt: %pattern_type.b5c = value_binding_pattern c3 [concrete = constants.%c3.patt]
// CHECK:STDOUT: }
// CHECK:STDOUT: %MultiArgC.cpp_destructor.bound.loc10: <bound method> = bound_method %.loc10_36.6, constants.%MultiArgC.cpp_destructor
// CHECK:STDOUT: %MultiArgC.cpp_destructor.call.loc10: init %empty_tuple.type = call %MultiArgC.cpp_destructor.bound.loc10(%.loc10_36.6)
// CHECK:STDOUT: %MultiArgC.cpp_destructor.bound.loc9: <bound method> = bound_method %.loc9_59.3, constants.%MultiArgC.cpp_destructor
// CHECK:STDOUT: %MultiArgC.cpp_destructor.call.loc9: init %empty_tuple.type = call %MultiArgC.cpp_destructor.bound.loc9(%.loc9_59.3)
// CHECK:STDOUT: %MultiArgC.cpp_destructor.bound.loc8: <bound method> = bound_method %.loc8_62.3, constants.%MultiArgC.cpp_destructor
// CHECK:STDOUT: %MultiArgC.cpp_destructor.call.loc8: init %empty_tuple.type = call %MultiArgC.cpp_destructor.bound.loc8(%.loc8_62.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc10: <bound method> = bound_method %.loc10_36.6, constants.%Destroy.WithSelf.SelfDestruct.db3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc10(%.loc10_36.6)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: <bound method> = bound_method %.loc9_59.3, constants.%Destroy.WithSelf.SelfDestruct.db3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%.loc9_59.3)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: <bound method> = bound_method %.loc8_62.3, constants.%Destroy.WithSelf.SelfDestruct.db3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%.loc8_62.3)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %MultiArgC) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %MultiArgC) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
// CHECK:STDOUT: %MultiArgC.cpp_destructor.call: init %empty_tuple.type = call imports.%MultiArgC.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -271,6 +271,7 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded)
// CHECK:STDOUT: constants {
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %HasQualifiers: type = class_type @HasQualifiers [concrete]
// CHECK:STDOUT: %pattern_type.933: type = pattern_type %HasQualifiers [concrete]
// CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete]
@@ -289,6 +290,8 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded)
// CHECK:STDOUT: %const_ref_ref_this__carbon_thunk: %const_ref_ref_this__carbon_thunk.type = struct_value () [concrete]
// CHECK:STDOUT: %HasQualifiers.plain.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.plain.cpp_overload_set [concrete]
// CHECK:STDOUT: %HasQualifiers.plain.cpp_overload_set.value: %HasQualifiers.plain.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.plain.cpp_overload_set [concrete]
// CHECK:STDOUT: %self.param_patt.64a: %pattern_type.933 = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.181: %pattern_type.933 = wrapper_binding_pattern self, %self.param_patt.64a [concrete]
// CHECK:STDOUT: %HasQualifiers.plain.type.99c640.1: type = fn_type @HasQualifiers.plain.1 [concrete]
// CHECK:STDOUT: %HasQualifiers.plain.cdd9ec.1: %HasQualifiers.plain.type.99c640.1 = struct_value () [concrete]
// CHECK:STDOUT: %HasQualifiers.ref_this.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.ref_this.cpp_overload_set [concrete]
@@ -299,8 +302,10 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded)
// CHECK:STDOUT: %HasQualifiers.plain.cdd9ec.2: %HasQualifiers.plain.type.99c640.2 = struct_value () [concrete]
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.type: type = fn_type @HasQualifiers.cpp_destructor [concrete]
// CHECK:STDOUT: %HasQualifiers.cpp_destructor: %HasQualifiers.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %HasQualifiers.Op.type.83af6e.1: type = fn_type @HasQualifiers.Op.1 [concrete]
// CHECK:STDOUT: %HasQualifiers.Op.4dca31.1: %HasQualifiers.Op.type.83af6e.1 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
// CHECK:STDOUT: %HasQualifiers.ref_ref_this.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.ref_ref_this.cpp_overload_set [concrete]
// CHECK:STDOUT: %HasQualifiers.ref_ref_this.cpp_overload_set.value: %HasQualifiers.ref_ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.ref_ref_this.cpp_overload_set [concrete]
// CHECK:STDOUT: %ref_ref_this__carbon_thunk.type: type = fn_type @ref_ref_this__carbon_thunk [concrete]
@@ -312,9 +317,9 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded)
// CHECK:STDOUT: %ptr.e71: type = ptr_type %const.ba8 [concrete]
// CHECK:STDOUT: %HasQualifiers__carbon_thunk.type: type = fn_type @HasQualifiers__carbon_thunk [concrete]
// CHECK:STDOUT: %HasQualifiers__carbon_thunk: %HasQualifiers__carbon_thunk.type = struct_value () [concrete]
// CHECK:STDOUT: %HasQualifiers.Op.type.83af6e.2: type = fn_type @HasQualifiers.Op.2 [concrete]
// CHECK:STDOUT: %HasQualifiers.Op.4dca31.2: %HasQualifiers.Op.type.83af6e.2 = struct_value () [concrete]
// CHECK:STDOUT: %custom_witness.d0d: <witness> = custom_witness (%HasQualifiers.Op.4dca31.2), @Copy [concrete]
// CHECK:STDOUT: %HasQualifiers.Op.type: type = fn_type @HasQualifiers.Op [concrete]
// CHECK:STDOUT: %HasQualifiers.Op: %HasQualifiers.Op.type = struct_value () [concrete]
// CHECK:STDOUT: %custom_witness.d0d: <witness> = custom_witness (%HasQualifiers.Op), @Copy [concrete]
// CHECK:STDOUT: %Copy.facet.11b: %Copy.type = facet_value %HasQualifiers, (%custom_witness.d0d) [concrete]
// CHECK:STDOUT: %Copy.WithSelf.Op.type.033: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.11b) [concrete]
// CHECK:STDOUT: %.703: type = fn_type_with_self_type %Copy.WithSelf.Op.type.033, %Copy.facet.11b [concrete]
@@ -379,6 +384,16 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded)
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generated {
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.933 = ref_param_pattern [concrete = constants.%self.param_patt.64a]
// CHECK:STDOUT: %self.patt: %pattern_type.933 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.181]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %HasQualifiers = ref_param call_param0
// CHECK:STDOUT: %self: ref %HasQualifiers = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F(%v.param: %HasQualifiers, %p.param: %ptr.102) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %v.ref.loc10: %HasQualifiers = name_ref v, %v
@@ -424,10 +439,8 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded)
// CHECK:STDOUT: %.loc19_8.3: %HasQualifiers = acquire_value %.loc19_8.2
// CHECK:STDOUT: %HasQualifiers.plain.call.loc19: init %empty_tuple.type = call imports.%HasQualifiers.plain.decl.3d4ba8.2(%.loc19_8.3)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: %HasQualifiers.Op.bound.loc19: <bound method> = bound_method %.loc19_8.2, constants.%HasQualifiers.Op.4dca31.1
// CHECK:STDOUT: %Op.ref.loc19: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc19: <bound method> = bound_method %.loc19_8.2, %Op.ref.loc19
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc19: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc19(%.loc19_8.2)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: <bound method> = bound_method %.loc19_8.2, constants.%Destroy.WithSelf.SelfDestruct.db3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%.loc19_8.2)
// CHECK:STDOUT: %Make.ref.loc20: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make]
// CHECK:STDOUT: %.loc20_8.1: ref %HasQualifiers = temporary_storage
// CHECK:STDOUT: %Make.call.loc20: init %HasQualifiers to %.loc20_8.1 = call %Make.ref.loc20()
@@ -436,10 +449,8 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded)
// CHECK:STDOUT: %bound_method.loc20: <bound method> = bound_method %.loc20_8.2, %const_this.ref.loc20
// CHECK:STDOUT: %.loc20_8.3: %HasQualifiers = acquire_value %.loc20_8.2
// CHECK:STDOUT: %const_this__carbon_thunk.call.loc20: init %empty_tuple.type = call imports.%const_this__carbon_thunk.decl(%.loc20_8.3)
// CHECK:STDOUT: %HasQualifiers.Op.bound.loc20: <bound method> = bound_method %.loc20_8.2, constants.%HasQualifiers.Op.4dca31.1
// CHECK:STDOUT: %Op.ref.loc20: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc20: <bound method> = bound_method %.loc20_8.2, %Op.ref.loc20
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc20: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc20(%.loc20_8.2)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc20: <bound method> = bound_method %.loc20_8.2, constants.%Destroy.WithSelf.SelfDestruct.db3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc20: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc20(%.loc20_8.2)
// CHECK:STDOUT: %Make.ref.loc21: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make]
// CHECK:STDOUT: %.loc21_8.1: ref %HasQualifiers = temporary_storage
// CHECK:STDOUT: %Make.call.loc21: init %HasQualifiers to %.loc21_8.1 = call %Make.ref.loc21()
@@ -448,10 +459,8 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded)
// CHECK:STDOUT: %bound_method.loc21: <bound method> = bound_method %.loc21_8.2, %const_ref_this.ref.loc21
// CHECK:STDOUT: %.loc21_8.3: %HasQualifiers = acquire_value %.loc21_8.2
// CHECK:STDOUT: %const_ref_this__carbon_thunk.call.loc21: init %empty_tuple.type = call imports.%const_ref_this__carbon_thunk.decl(%.loc21_8.3)
// CHECK:STDOUT: %HasQualifiers.Op.bound.loc21: <bound method> = bound_method %.loc21_8.2, constants.%HasQualifiers.Op.4dca31.1
// CHECK:STDOUT: %Op.ref.loc21: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc21: <bound method> = bound_method %.loc21_8.2, %Op.ref.loc21
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc21: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc21(%.loc21_8.2)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc21: <bound method> = bound_method %.loc21_8.2, constants.%Destroy.WithSelf.SelfDestruct.db3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc21: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc21(%.loc21_8.2)
// CHECK:STDOUT: %Make.ref.loc22: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make]
// CHECK:STDOUT: %.loc22_8.1: ref %HasQualifiers = temporary_storage
// CHECK:STDOUT: %Make.call.loc22: init %HasQualifiers to %.loc22_8.1 = call %Make.ref.loc22()
@@ -460,10 +469,10 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded)
// CHECK:STDOUT: %bound_method.loc22_9: <bound method> = bound_method %.loc22_8.2, %ref_ref_this.ref
// CHECK:STDOUT: %.loc22_8.3: %HasQualifiers = acquire_value %.loc22_8.2
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: %impl.elem0.loc22: %.703 = impl_witness_access constants.%custom_witness.d0d, element0 [concrete = constants.%HasQualifiers.Op.4dca31.2]
// CHECK:STDOUT: %bound_method.loc22_8: <bound method> = bound_method %.loc22_8.3, %impl.elem0.loc22
// CHECK:STDOUT: %impl.elem0: %.703 = impl_witness_access constants.%custom_witness.d0d, element0 [concrete = constants.%HasQualifiers.Op]
// CHECK:STDOUT: %bound_method.loc22_8: <bound method> = bound_method %.loc22_8.3, %impl.elem0
// CHECK:STDOUT: %.loc22_8.4: ref %HasQualifiers = temporary_storage
// CHECK:STDOUT: %Op.ref.loc22_8.1: %HasQualifiers.HasQualifiers.type = name_ref Op, imports.%HasQualifiers.HasQualifiers.decl [concrete = constants.%HasQualifiers.HasQualifiers]
// CHECK:STDOUT: %Op.ref: %HasQualifiers.HasQualifiers.type = name_ref Op, imports.%HasQualifiers.HasQualifiers.decl [concrete = constants.%HasQualifiers.HasQualifiers]
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: %.loc22_8.5: ref %HasQualifiers = value_as_ref %.loc22_8.3
// CHECK:STDOUT: %addr.loc22_8.1: %ptr.102 = addr_of %.loc22_8.5
@@ -475,10 +484,8 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: %ref_ref_this__carbon_thunk.call: init %empty_tuple.type = call imports.%ref_ref_this__carbon_thunk.decl(%self.var)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: %HasQualifiers.Op.bound.loc22: <bound method> = bound_method %.loc22_8.2, constants.%HasQualifiers.Op.4dca31.1
// CHECK:STDOUT: %Op.ref.loc22_8.2: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc22: <bound method> = bound_method %.loc22_8.2, %Op.ref.loc22_8.2
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc22: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc22(%.loc22_8.2)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc22: <bound method> = bound_method %.loc22_8.2, constants.%Destroy.WithSelf.SelfDestruct.db3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc22: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc22(%.loc22_8.2)
// CHECK:STDOUT: %Make.ref.loc23: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make]
// CHECK:STDOUT: %.loc23_8.1: ref %HasQualifiers = temporary_storage
// CHECK:STDOUT: %Make.call.loc23: init %HasQualifiers to %.loc23_8.1 = call %Make.ref.loc23()
@@ -487,13 +494,20 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded)
// CHECK:STDOUT: %bound_method.loc23: <bound method> = bound_method %.loc23_8.2, %const_ref_ref_this.ref.loc23
// CHECK:STDOUT: %.loc23_8.3: %HasQualifiers = acquire_value %.loc23_8.2
// CHECK:STDOUT: %const_ref_ref_this__carbon_thunk.call.loc23: init %empty_tuple.type = call imports.%const_ref_ref_this__carbon_thunk.decl(%.loc23_8.3)
// CHECK:STDOUT: %HasQualifiers.Op.bound.loc23: <bound method> = bound_method %.loc23_8.2, constants.%HasQualifiers.Op.4dca31.1
// CHECK:STDOUT: %Op.ref.loc23: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor]
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc23: <bound method> = bound_method %.loc23_8.2, %Op.ref.loc23
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc23: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc23(%.loc23_8.2)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc23: <bound method> = bound_method %.loc23_8.2, constants.%Destroy.WithSelf.SelfDestruct.db3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc23: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc23(%.loc23_8.2)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %HasQualifiers) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %HasQualifiers) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call: init %empty_tuple.type = call imports.%HasQualifiers.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- use_object_param_qualifiers_overloaded.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
@@ -517,10 +531,29 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded)
// CHECK:STDOUT: %b.var_patt.dede8c.1: %pattern_type.f00 = var_pattern %b.patt.9fb99a.1 [concrete]
// CHECK:STDOUT: %NoRefQualifier.F.type.8b6eff.2: type = fn_type @NoRefQualifier.F.2 [concrete]
// CHECK:STDOUT: %NoRefQualifier.F.dbb5f5.2: %NoRefQualifier.F.type.8b6eff.2 = struct_value () [concrete]
// CHECK:STDOUT: %self.param_patt.af0: %pattern_type.f00 = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.954: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt.af0 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc9 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc9 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc9 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
// CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete]
// CHECK:STDOUT: %self.param_patt.331: %pattern_type.956 = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.319: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt.331 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc8_3.1 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete]
// CHECK:STDOUT: %self.param_patt.705: %pattern_type.6b6 = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.70d: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt.705 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc8_3.2 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc8_3.2 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete]
// CHECK:STDOUT: %WithRefQualifier: type = class_type @WithRefQualifier [concrete]
// CHECK:STDOUT: %ptr.90c: type = ptr_type %WithRefQualifier [concrete]
// CHECK:STDOUT: %a.patt.623a16.2: %pattern_type.6b6 = ref_binding_pattern a [concrete]
@@ -560,6 +593,51 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded)
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generated {
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc9 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.f00 = ref_param_pattern [concrete = constants.%self.param_patt.af0]
// CHECK:STDOUT: %self.patt: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.954]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %ptr.d08 = ref_param call_param0
// CHECK:STDOUT: %self: ref %ptr.d08 = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc9 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.f00 = ref_param_pattern [concrete = constants.%self.param_patt.af0]
// CHECK:STDOUT: %self.patt: %pattern_type.f00 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.954]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %ptr.d08 = ref_param call_param0
// CHECK:STDOUT: %self: ref %ptr.d08 = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331]
// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0
// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc8_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.956 = ref_param_pattern [concrete = constants.%self.param_patt.331]
// CHECK:STDOUT: %self.patt: %pattern_type.956 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.319]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %i32.builtin = ref_param call_param0
// CHECK:STDOUT: %self: ref %i32.builtin = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc8_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705]
// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0
// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc8_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.6b6 = ref_param_pattern [concrete = constants.%self.param_patt.705]
// CHECK:STDOUT: %self.patt: %pattern_type.6b6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.70d]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0
// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @CallFNoRefQualifier(%v.param: %NoRefQualifier, %p.param: %ptr.f7d) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %a.var: ref %i32 = var_storage %a.var_patt
@@ -590,19 +668,46 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded)
// CHECK:STDOUT: %b.patt: %pattern_type.f00 = ref_binding_pattern b [concrete = constants.%b.patt.9fb99a.1]
// CHECK:STDOUT: %b.var_patt: %pattern_type.f00 = var_pattern %b.patt [concrete = constants.%b.var_patt.dede8c.1]
// CHECK:STDOUT: }
// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc9: <bound method> = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.1
// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc9(%b.var)
// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc8: <bound method> = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3
// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc8(%a.var)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc9: <bound method> = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc9(%b.var)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: <bound method> = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%a.var)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc9(%self.param: ref %ptr.d08) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc9(%self.param: ref %ptr.d08) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc9(%self.param: ref %ptr.d08) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.1(%self.param: ref %i32.builtin) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.1(%self.param: ref %i32.builtin) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i32) {
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.1(%self.param: ref %i32.builtin) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param)
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc8_3.2(%self.param: ref %i32) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc8_3.2(%self.param: ref %i32) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc8_3.2(%self.param: ref %i32) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param)
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -636,10 +741,10 @@ fn Call(e: Cpp.ExplicitObjectParamOverloaded, n: i32, a: Cpp.AnotherOverloaded)
// CHECK:STDOUT: %b.patt: %pattern_type.f00 = ref_binding_pattern b [concrete = constants.%b.patt.9fb99a.2]
// CHECK:STDOUT: %b.var_patt: %pattern_type.f00 = var_pattern %b.patt [concrete = constants.%b.var_patt.dede8c.2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc16: <bound method> = bound_method %b.var, constants.%Destroy.WithSelf.Op.403171.1
// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc16(%b.var)
// CHECK:STDOUT: %Destroy.WithSelf.Op.bound.loc15: <bound method> = bound_method %a.var, constants.%Destroy.WithSelf.Op.403171.3
// CHECK:STDOUT: %Destroy.WithSelf.Op.call.loc15: init %empty_tuple.type = call %Destroy.WithSelf.Op.bound.loc15(%a.var)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: <bound method> = bound_method %b.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%b.var)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc15: <bound method> = bound_method %a.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc15: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc15(%a.var)
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -737,14 +737,14 @@ fn G() {
// CHECK:STDOUT: %.972: %.d15 = splice_inst @F.%.loc10_3.27 [template]
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
// CHECK:STDOUT: %Self.0e7: %Destroy.type = symbolic_binding Self, 0 [symbolic]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d3e: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Self.0e7) [symbolic]
// CHECK:STDOUT: %Destroy.WithSelf.Op.42b: %Destroy.WithSelf.Op.type.d3e = struct_value () [symbolic]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.4e5: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Self.0e7) [symbolic]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.4a0: %Destroy.WithSelf.SelfDestruct.type.4e5 = struct_value () [symbolic]
// CHECK:STDOUT: %Destroy.assoc_type: type = assoc_entity_type @Destroy [concrete]
// CHECK:STDOUT: %assoc0.ae8: %Destroy.assoc_type = assoc_entity element0, imports.%Core.import_ref.918 [concrete]
// CHECK:STDOUT: %.e71: type = type_of_inst @F.%.loc10_3.29 [template]
// CHECK:STDOUT: %.1c0: %.e71 = splice_inst @F.%.loc10_3.29 [template]
// CHECK:STDOUT: %.920: type = type_of_inst @F.%.loc10_3.32 [template]
// CHECK:STDOUT: %.024: %.920 = splice_inst @F.%.loc10_3.32 [template]
// CHECK:STDOUT: %assoc2: %Destroy.assoc_type = assoc_entity element2, imports.%Core.import_ref.71d [concrete]
// CHECK:STDOUT: %.409: type = type_of_inst @F.%.loc10_3.29 [template]
// CHECK:STDOUT: %.9b8: %.409 = splice_inst @F.%.loc10_3.29 [template]
// CHECK:STDOUT: %.a75: type = type_of_inst @F.%.loc10_3.32 [template]
// CHECK:STDOUT: %.4ea: %.a75 = splice_inst @F.%.loc10_3.32 [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
// CHECK:STDOUT: %A: type = class_type @A [concrete]
@@ -792,21 +792,27 @@ fn G() {
// CHECK:STDOUT: %.c3f: %.67b = splice_inst %.787 [template]
// CHECK:STDOUT: %.9d9: <instruction> = convert_to_category_action %.c3f, element10 [template]
// CHECK:STDOUT: %.1a1: %A = splice_inst %.9d9 [template]
// CHECK:STDOUT: %self.param_patt.1f1: %pattern_type.b78 = ref_param_pattern [concrete]
// CHECK:STDOUT: %self.patt.6db: %pattern_type.b78 = wrapper_binding_pattern self, %self.param_patt.1f1 [concrete]
// CHECK:STDOUT: %A.cpp_destructor.type: type = fn_type @A.cpp_destructor [concrete]
// CHECK:STDOUT: %A.cpp_destructor: %A.cpp_destructor.type = struct_value () [concrete]
// CHECK:STDOUT: %custom_witness.294: <witness> = custom_witness (%A.cpp_destructor), @Destroy [concrete]
// CHECK:STDOUT: %Destroy.facet.bf5: %Destroy.type = facet_value %A, (%custom_witness.294) [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.d24: type = fn_type @Destroy.WithSelf.Op, @Destroy.WithSelf(%Destroy.facet.bf5) [concrete]
// CHECK:STDOUT: %.429: type = fn_type_with_self_type %Destroy.WithSelf.Op.type.d24, %Destroy.facet.bf5 [concrete]
// CHECK:STDOUT: %inst.splice_block.1c7: <instruction> = inst_value [concrete] {
// CHECK:STDOUT: %.d1c: <bound method> = splice_block %bound_method {
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc10 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc10 [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
// CHECK:STDOUT: %custom_witness.842: <witness> = custom_witness (%Destroy.WithSelf.Op.403, %A.cpp_destructor, %Destroy.WithSelf.SelfDestruct.db3), @Destroy [concrete]
// CHECK:STDOUT: %Destroy.facet.cd4: %Destroy.type = facet_value %A, (%custom_witness.842) [concrete]
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.2fb: type = fn_type @Destroy.WithSelf.SelfDestruct.1, @Destroy.WithSelf(%Destroy.facet.cd4) [concrete]
// CHECK:STDOUT: %.758: type = fn_type_with_self_type %Destroy.WithSelf.SelfDestruct.type.2fb, %Destroy.facet.cd4 [concrete]
// CHECK:STDOUT: %inst.splice_block.df2: <instruction> = inst_value [concrete] {
// CHECK:STDOUT: %.6c0: <bound method> = splice_block %bound_method {
// CHECK:STDOUT: %.30e: ref %A = specific_inst @F.%a.var, @F(%i32)
// CHECK:STDOUT: %impl.elem0: %.429 = impl_witness_access %custom_witness.294, element0 [concrete = %A.cpp_destructor]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %.30e, %impl.elem0
// CHECK:STDOUT: %impl.elem2: %.758 = impl_witness_access %custom_witness.842, element2 [concrete = %Destroy.WithSelf.SelfDestruct.db3]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %.30e, %impl.elem2
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %inst.call: <instruction> = inst_value [concrete] {
// CHECK:STDOUT: %A.cpp_destructor.call: init %empty_tuple.type = call %.d1c(%.30e)
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %.6c0(%.30e)
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -816,7 +822,7 @@ fn G() {
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %A.template: %A.type = struct_value () [concrete = constants.%A.template]
// CHECK:STDOUT: %Core.import_ref.918: @Destroy.WithSelf.%Destroy.WithSelf.Op.type (%Destroy.WithSelf.Op.type.d3e) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.Op (constants.%Destroy.WithSelf.Op.42b)]
// CHECK:STDOUT: %Core.import_ref.71d: @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct.type (%Destroy.WithSelf.SelfDestruct.type.4e5) = import_ref Core//prelude/parts/destroy, loc{{\d+_\d+}}, loaded [symbolic = @Destroy.WithSelf.%Destroy.WithSelf.SelfDestruct (constants.%Destroy.WithSelf.SelfDestruct.4a0)]
// CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
// CHECK:STDOUT: %A.A.cpp_overload_set.value: %A.A.cpp_overload_set.type = cpp_overload_set_value @A.A.cpp_overload_set [concrete = constants.%A.A.cpp_overload_set.value]
// CHECK:STDOUT: %A__carbon_thunk.decl: %A__carbon_thunk.type = fn_decl @A__carbon_thunk [concrete = constants.%A__carbon_thunk] {
@@ -824,6 +830,21 @@ fn G() {
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: %A.cpp_destructor.decl: %A.cpp_destructor.type = fn_decl @A.cpp_destructor [concrete = constants.%A.cpp_destructor] {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: } {
// CHECK:STDOUT: <elided>
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generated {
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc10 [concrete = constants.%Destroy.WithSelf.Op.403] {
// CHECK:STDOUT: %self.param_patt: %pattern_type.b78 = ref_param_pattern [concrete = constants.%self.param_patt.1f1]
// CHECK:STDOUT: %self.patt: %pattern_type.b78 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.6db]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: ref %A = ref_param call_param0
// CHECK:STDOUT: %self: ref %A = wrapper_binding self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
@@ -876,12 +897,12 @@ fn G() {
// CHECK:STDOUT: %.loc10_3.26: @F.%.loc10_3.25 (%.4d4) = splice_inst %.loc10_3.24 [template = %.loc10_3.26 (constants.%.c8d)]
// CHECK:STDOUT: %.loc10_3.27: <instruction> = convert_to_category_action %.loc10_3.9, element10 [template]
// CHECK:STDOUT: %.loc10_3.28: @F.%.loc10_24.9 (%.d15) = splice_inst %.loc10_3.27 [template = %.loc10_3.28 (constants.%.972)]
// CHECK:STDOUT: %.loc10_3.29: <instruction> = compound_member_access_action %a.var, constants.%assoc0.ae8 [template]
// CHECK:STDOUT: %.loc10_3.30: type = type_of_inst %.loc10_3.29 [template = %.loc10_3.30 (constants.%.e71)]
// CHECK:STDOUT: %.loc10_3.31: @F.%.loc10_3.30 (%.e71) = splice_inst %.loc10_3.29 [template = %.loc10_3.31 (constants.%.1c0)]
// CHECK:STDOUT: %.loc10_3.29: <instruction> = compound_member_access_action %a.var, constants.%assoc2 [template]
// CHECK:STDOUT: %.loc10_3.30: type = type_of_inst %.loc10_3.29 [template = %.loc10_3.30 (constants.%.409)]
// CHECK:STDOUT: %.loc10_3.31: @F.%.loc10_3.30 (%.409) = splice_inst %.loc10_3.29 [template = %.loc10_3.31 (constants.%.9b8)]
// CHECK:STDOUT: %.loc10_3.32: <instruction> = call_action (%.loc10_3.12), true [template]
// CHECK:STDOUT: %.loc10_3.33: type = type_of_inst %.loc10_3.32 [template = %.loc10_3.33 (constants.%.920)]
// CHECK:STDOUT: %.loc10_3.34: @F.%.loc10_3.33 (%.920) = splice_inst %.loc10_3.32 [template = %.loc10_3.34 (constants.%.024)]
// CHECK:STDOUT: %.loc10_3.33: type = type_of_inst %.loc10_3.32 [template = %.loc10_3.33 (constants.%.a75)]
// CHECK:STDOUT: %.loc10_3.34: @F.%.loc10_3.33 (%.a75) = splice_inst %.loc10_3.32 [template = %.loc10_3.34 (constants.%.4ea)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn() {
// CHECK:STDOUT: !entry:
@@ -921,14 +942,23 @@ fn G() {
// CHECK:STDOUT: %a.patt.loc10_15.1: @F.%pattern_type (%pattern_type.3c1) = ref_binding_pattern a [template = %a.patt.loc10_15.2 (constants.%a.patt.b2a)]
// CHECK:STDOUT: %a.var_patt.loc10_3.1: @F.%pattern_type (%pattern_type.3c1) = var_pattern %a.patt.loc10_15.1 [template = %a.var_patt.loc10_3.2 (constants.%a.var_patt.66a)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc10_3.11: type = type_of_inst %.loc10_3.29 [template = %.loc10_3.30 (constants.%.e71)]
// CHECK:STDOUT: %.loc10_3.12: @F.%.loc10_3.30 (%.e71) = splice_inst %.loc10_3.29 [template = %.loc10_3.31 (constants.%.1c0)]
// CHECK:STDOUT: %.loc10_3.13: type = type_of_inst %.loc10_3.32 [template = %.loc10_3.33 (constants.%.920)]
// CHECK:STDOUT: %.loc10_3.14: @F.%.loc10_3.33 (%.920) = splice_inst %.loc10_3.32 [template = %.loc10_3.34 (constants.%.024)]
// CHECK:STDOUT: %.loc10_3.11: type = type_of_inst %.loc10_3.29 [template = %.loc10_3.30 (constants.%.409)]
// CHECK:STDOUT: %.loc10_3.12: @F.%.loc10_3.30 (%.409) = splice_inst %.loc10_3.29 [template = %.loc10_3.31 (constants.%.9b8)]
// CHECK:STDOUT: %.loc10_3.13: type = type_of_inst %.loc10_3.32 [template = %.loc10_3.33 (constants.%.a75)]
// CHECK:STDOUT: %.loc10_3.14: @F.%.loc10_3.33 (%.a75) = splice_inst %.loc10_3.32 [template = %.loc10_3.34 (constants.%.4ea)]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc10(%self.param: ref %A) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc10(%self.param: ref %A) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
// CHECK:STDOUT: %A.cpp_destructor.call: init %empty_tuple.type = call imports.%A.cpp_destructor.decl(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F(constants.%T) {
// CHECK:STDOUT: %T.patt.loc9_15.2 => constants.%T.patt
// CHECK:STDOUT: %T.loc9_15.1 => constants.%T
@@ -972,7 +1002,7 @@ fn G() {
// CHECK:STDOUT: %.loc10_3.26 => constants.%.c3f
// CHECK:STDOUT: %.loc10_3.27 => constants.%.9d9
// CHECK:STDOUT: %.loc10_3.28 => constants.%.1a1
// CHECK:STDOUT: %.loc10_3.29 => constants.%inst.splice_block.1c7
// CHECK:STDOUT: %.loc10_3.29 => constants.%inst.splice_block.df2
// CHECK:STDOUT: %.loc10_3.30 => <bound method>
// CHECK:STDOUT: %.loc10_3.31 => invalid
// CHECK:STDOUT: %.loc10_3.32 => constants.%inst.call