mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Interop support for initialization via std::initializer_list. (#6672)
Add a new builtin function `cpp.std.initializer_list.make` that takes an array and returns a `std::initializer_list`, initialized to refer to that array. When C++ initialization wants to perform a `std::initializer_list`-from-array construction, synthesize a declaration of a matching builtin function and use that to perform the initialization. Ideally we would specify this conversion as an impl of `ImplicitAs` in the prelude instead of hardcoding it in the interop layer, but unfortunately that's not currently possible, for various reasons -- we can't make the conversion form-generic, we can't deduce the array length from the initializer, and we can't deduce against the arguments of imported C++ class templates yet -- so for now synthesizing a builtin function on demand is the best we can do. Assisted-by: Gemini 3 Pro via Antigravity
This commit is contained in:
+118
-106
@@ -382,48 +382,52 @@ import Cpp library "struct_init.h";
|
||||
fn MakeEmpty() -> ();
|
||||
|
||||
fn Empty(value: (), ref reference: ()) {
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+10]]:20: error: semantics TODO: `Unsupported initialization sequence:
|
||||
// CHECK:STDERR: Normal sequence: list aggregate initialization [struct NoFields]
|
||||
// CHECK:STDERR: ` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:20: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(());
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-13]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:20: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(());
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-14]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:4:28: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassNoFields(NoFields s) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassNoFields(());
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+10]]:20: error: semantics TODO: `Unsupported initialization sequence:
|
||||
// CHECK:STDERR: Normal sequence: list aggregate initialization [struct NoFields]
|
||||
// CHECK:STDERR: ` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:20: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(value);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-25]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:20: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(value);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-27]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:4:28: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassNoFields(NoFields s) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassNoFields(value);
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+10]]:20: error: semantics TODO: `Unsupported initialization sequence:
|
||||
// CHECK:STDERR: Normal sequence: list aggregate initialization [struct NoFields]
|
||||
// CHECK:STDERR: ` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:20: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(reference);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-37]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:20: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(reference);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-40]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:4:28: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassNoFields(NoFields s) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassNoFields(reference);
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+10]]:20: error: semantics TODO: `Unsupported initialization sequence:
|
||||
// CHECK:STDERR: Normal sequence: list aggregate initialization [struct NoFields]
|
||||
// CHECK:STDERR: ` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:20: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(MakeEmpty());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-49]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:20: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(MakeEmpty());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-53]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:4:28: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassNoFields(NoFields s) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
@@ -434,48 +438,52 @@ fn Empty(value: (), ref reference: ()) {
|
||||
fn MakeThreeFields() -> (i32, i32, i32);
|
||||
|
||||
fn ThreeFields(value: (i32, i32, i32), ref reference: (i32, i32, i32)) {
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+10]]:23: error: semantics TODO: `Unsupported initialization sequence:
|
||||
// CHECK:STDERR: Normal sequence: list aggregate initialization [struct ThreeFields]
|
||||
// CHECK:STDERR: ` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `(Core.IntLiteral, Core.IntLiteral, Core.IntLiteral)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields((1, 2, 3));
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-65]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:23: note: type `(Core.IntLiteral, Core.IntLiteral, Core.IntLiteral)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields((1, 2, 3));
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-70]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields((1, 2, 3));
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+10]]:23: error: semantics TODO: `Unsupported initialization sequence:
|
||||
// CHECK:STDERR: Normal sequence: list aggregate initialization [struct ThreeFields]
|
||||
// CHECK:STDERR: ` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(value);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-77]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:23: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(value);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-83]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(value);
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+10]]:23: error: semantics TODO: `Unsupported initialization sequence:
|
||||
// CHECK:STDERR: Normal sequence: list aggregate initialization [struct ThreeFields]
|
||||
// CHECK:STDERR: ` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(reference);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-89]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:23: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(reference);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-96]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(reference);
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+10]]:23: error: semantics TODO: `Unsupported initialization sequence:
|
||||
// CHECK:STDERR: Normal sequence: list aggregate initialization [struct ThreeFields]
|
||||
// CHECK:STDERR: ` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(MakeThreeFields());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-101]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:23: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(MakeThreeFields());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-109]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
@@ -2827,6 +2835,8 @@ fn F() {
|
||||
// CHECK:STDOUT: %PassNoFields__carbon_thunk: %PassNoFields__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
@@ -2838,7 +2848,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %pattern_type.b5a: type = pattern_type %tuple.type.189 [concrete]
|
||||
// CHECK:STDOUT: %MakeThreeFields.type: type = fn_type @MakeThreeFields [concrete]
|
||||
// CHECK:STDOUT: %MakeThreeFields: %MakeThreeFields.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ThreeFields.type: type = fn_type @ThreeFields.loc63 [concrete]
|
||||
// CHECK:STDOUT: %ThreeFields.type: type = fn_type @ThreeFields.loc67 [concrete]
|
||||
// CHECK:STDOUT: %ThreeFields.c3a: %ThreeFields.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %PassThreeFields.cpp_overload_set.type: type = cpp_overload_set_type @PassThreeFields.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %PassThreeFields.cpp_overload_set.value: %PassThreeFields.cpp_overload_set.type = cpp_overload_set_value @PassThreeFields.cpp_overload_set [concrete]
|
||||
@@ -2859,6 +2869,7 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
@@ -2876,6 +2887,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %s.param: %ptr.dd0 = value_param call_param0
|
||||
// CHECK:STDOUT: %s: %ptr.dd0 = value_binding s, %s.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %PassThreeFields.cpp_overload_set.value: %PassThreeFields.cpp_overload_set.type = cpp_overload_set_value @PassThreeFields.cpp_overload_set [concrete = constants.%PassThreeFields.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %PassThreeFields__carbon_thunk.decl: %PassThreeFields__carbon_thunk.type = fn_decl @PassThreeFields__carbon_thunk [concrete = constants.%PassThreeFields__carbon_thunk] {
|
||||
@@ -2933,46 +2945,46 @@ fn F() {
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.b5a = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.b5a = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %int_32.loc61_26: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc61_26: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc61_31: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc61_31: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc61_36: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc61_36: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc61_39.1: %tuple.type.ff9 = tuple_literal (%i32.loc61_26, %i32.loc61_31, %i32.loc61_36) [concrete = constants.%tuple.e64]
|
||||
// CHECK:STDOUT: %.loc61_39.2: type = converted %.loc61_39.1, constants.%tuple.type.189 [concrete = constants.%tuple.type.189]
|
||||
// CHECK:STDOUT: %.loc61_39.3: form = init_form %.loc61_39.2, call_param0 [concrete = constants.%.084]
|
||||
// CHECK:STDOUT: %int_32.loc65_26: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc65_26: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc65_31: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc65_31: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc65_36: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc65_36: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc65_39.1: %tuple.type.ff9 = tuple_literal (%i32.loc65_26, %i32.loc65_31, %i32.loc65_36) [concrete = constants.%tuple.e64]
|
||||
// CHECK:STDOUT: %.loc65_39.2: type = converted %.loc65_39.1, constants.%tuple.type.189 [concrete = constants.%tuple.type.189]
|
||||
// CHECK:STDOUT: %.loc65_39.3: form = init_form %.loc65_39.2, call_param0 [concrete = constants.%.084]
|
||||
// CHECK:STDOUT: %return.param: ref %tuple.type.189 = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %tuple.type.189 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %ThreeFields.decl: %ThreeFields.type = fn_decl @ThreeFields.loc63 [concrete = constants.%ThreeFields.c3a] {
|
||||
// CHECK:STDOUT: %ThreeFields.decl: %ThreeFields.type = fn_decl @ThreeFields.loc67 [concrete = constants.%ThreeFields.c3a] {
|
||||
// CHECK:STDOUT: %value.patt: %pattern_type.b5a = value_binding_pattern value [concrete]
|
||||
// CHECK:STDOUT: %value.param_patt: %pattern_type.b5a = value_param_pattern %value.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: %reference.patt: %pattern_type.b5a = ref_binding_pattern reference [concrete]
|
||||
// CHECK:STDOUT: %reference.param_patt: %pattern_type.b5a = ref_param_pattern %reference.patt, call_param1 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %value.param: %tuple.type.189 = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc63_37.1: type = splice_block %.loc63_37.3 [concrete = constants.%tuple.type.189] {
|
||||
// CHECK:STDOUT: %int_32.loc63_24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc63_24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc63_29: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc63_29: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc63_34: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc63_34: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc63_37.2: %tuple.type.ff9 = tuple_literal (%i32.loc63_24, %i32.loc63_29, %i32.loc63_34) [concrete = constants.%tuple.e64]
|
||||
// CHECK:STDOUT: %.loc63_37.3: type = converted %.loc63_37.2, constants.%tuple.type.189 [concrete = constants.%tuple.type.189]
|
||||
// CHECK:STDOUT: %.loc67_37.1: type = splice_block %.loc67_37.3 [concrete = constants.%tuple.type.189] {
|
||||
// CHECK:STDOUT: %int_32.loc67_24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc67_24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc67_29: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc67_29: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc67_34: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc67_34: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc67_37.2: %tuple.type.ff9 = tuple_literal (%i32.loc67_24, %i32.loc67_29, %i32.loc67_34) [concrete = constants.%tuple.e64]
|
||||
// CHECK:STDOUT: %.loc67_37.3: type = converted %.loc67_37.2, constants.%tuple.type.189 [concrete = constants.%tuple.type.189]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %value: %tuple.type.189 = value_binding value, %value.param
|
||||
// CHECK:STDOUT: %reference.param: ref %tuple.type.189 = ref_param call_param1
|
||||
// CHECK:STDOUT: %.loc63_69.1: type = splice_block %.loc63_69.3 [concrete = constants.%tuple.type.189] {
|
||||
// CHECK:STDOUT: %int_32.loc63_56: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc63_56: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc63_61: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc63_61: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc63_66: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc63_66: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc63_69.2: %tuple.type.ff9 = tuple_literal (%i32.loc63_56, %i32.loc63_61, %i32.loc63_66) [concrete = constants.%tuple.e64]
|
||||
// CHECK:STDOUT: %.loc63_69.3: type = converted %.loc63_69.2, constants.%tuple.type.189 [concrete = constants.%tuple.type.189]
|
||||
// CHECK:STDOUT: %.loc67_69.1: type = splice_block %.loc67_69.3 [concrete = constants.%tuple.type.189] {
|
||||
// CHECK:STDOUT: %int_32.loc67_56: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc67_56: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc67_61: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc67_61: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc67_66: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc67_66: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc67_69.2: %tuple.type.ff9 = tuple_literal (%i32.loc67_56, %i32.loc67_61, %i32.loc67_66) [concrete = constants.%tuple.e64]
|
||||
// CHECK:STDOUT: %.loc67_69.3: type = converted %.loc67_69.2, constants.%tuple.type.189 [concrete = constants.%tuple.type.189]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %reference: ref %tuple.type.189 = ref_binding reference, %reference.param
|
||||
// CHECK:STDOUT: }
|
||||
@@ -3009,31 +3021,31 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Empty(%value.param: %empty_tuple.type, %reference.param: %empty_tuple.type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %PassNoFields.ref.loc22: %PassNoFields.cpp_overload_set.type = name_ref PassNoFields, imports.%PassNoFields.cpp_overload_set.value [concrete = constants.%PassNoFields.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc22_21.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc22_21.2: %NoFields = converted %.loc22_21.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr.loc22: %ptr.dd0 = addr_of <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %PassNoFields__carbon_thunk.call.loc22: init %empty_tuple.type = call imports.%PassNoFields__carbon_thunk.decl(%addr.loc22)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc34: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %PassNoFields.ref.loc34: %PassNoFields.cpp_overload_set.type = name_ref PassNoFields, imports.%PassNoFields.cpp_overload_set.value [concrete = constants.%PassNoFields.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc23: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %PassNoFields.ref.loc23: %PassNoFields.cpp_overload_set.type = name_ref PassNoFields, imports.%PassNoFields.cpp_overload_set.value [concrete = constants.%PassNoFields.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc23_21.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc23_21.2: %NoFields = converted %.loc23_21.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr.loc23: %ptr.dd0 = addr_of <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %PassNoFields__carbon_thunk.call.loc23: init %empty_tuple.type = call imports.%PassNoFields__carbon_thunk.decl(%addr.loc23)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc36: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %PassNoFields.ref.loc36: %PassNoFields.cpp_overload_set.type = name_ref PassNoFields, imports.%PassNoFields.cpp_overload_set.value [concrete = constants.%PassNoFields.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %value.ref: %empty_tuple.type = name_ref value, %value
|
||||
// CHECK:STDOUT: %.loc34: %NoFields = converted %value.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr.loc34: %ptr.dd0 = addr_of <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %PassNoFields__carbon_thunk.call.loc34: init %empty_tuple.type = call imports.%PassNoFields__carbon_thunk.decl(%addr.loc34)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc46: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %PassNoFields.ref.loc46: %PassNoFields.cpp_overload_set.type = name_ref PassNoFields, imports.%PassNoFields.cpp_overload_set.value [concrete = constants.%PassNoFields.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc36: %NoFields = converted %value.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr.loc36: %ptr.dd0 = addr_of <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %PassNoFields__carbon_thunk.call.loc36: init %empty_tuple.type = call imports.%PassNoFields__carbon_thunk.decl(%addr.loc36)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc49: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %PassNoFields.ref.loc49: %PassNoFields.cpp_overload_set.type = name_ref PassNoFields, imports.%PassNoFields.cpp_overload_set.value [concrete = constants.%PassNoFields.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %reference.ref: ref %empty_tuple.type = name_ref reference, %reference
|
||||
// CHECK:STDOUT: %.loc46: %NoFields = converted %reference.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr.loc46: %ptr.dd0 = addr_of <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %PassNoFields__carbon_thunk.call.loc46: init %empty_tuple.type = call imports.%PassNoFields__carbon_thunk.decl(%addr.loc46)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc58: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %PassNoFields.ref.loc58: %PassNoFields.cpp_overload_set.type = name_ref PassNoFields, imports.%PassNoFields.cpp_overload_set.value [concrete = constants.%PassNoFields.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc49: %NoFields = converted %reference.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr.loc49: %ptr.dd0 = addr_of <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %PassNoFields__carbon_thunk.call.loc49: init %empty_tuple.type = call imports.%PassNoFields__carbon_thunk.decl(%addr.loc49)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc62: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %PassNoFields.ref.loc62: %PassNoFields.cpp_overload_set.type = name_ref PassNoFields, imports.%PassNoFields.cpp_overload_set.value [concrete = constants.%PassNoFields.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %MakeEmpty.ref: %MakeEmpty.type = name_ref MakeEmpty, file.%MakeEmpty.decl [concrete = constants.%MakeEmpty]
|
||||
// CHECK:STDOUT: %MakeEmpty.call: init %empty_tuple.type = call %MakeEmpty.ref()
|
||||
// CHECK:STDOUT: %.loc58: %NoFields = converted %MakeEmpty.call, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr.loc58: %ptr.dd0 = addr_of <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %PassNoFields__carbon_thunk.call.loc58: init %empty_tuple.type = call imports.%PassNoFields__carbon_thunk.decl(%addr.loc58)
|
||||
// CHECK:STDOUT: %.loc62: %NoFields = converted %MakeEmpty.call, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr.loc62: %ptr.dd0 = addr_of <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %PassNoFields__carbon_thunk.call.loc62: init %empty_tuple.type = call imports.%PassNoFields__carbon_thunk.decl(%addr.loc62)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -3043,37 +3055,37 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @MakeThreeFields() -> out %return.param: %tuple.type.189;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @ThreeFields.loc63(%value.param: %tuple.type.189, %reference.param: %tuple.type.189) {
|
||||
// CHECK:STDOUT: fn @ThreeFields.loc67(%value.param: %tuple.type.189, %reference.param: %tuple.type.189) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc74: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %PassThreeFields.ref.loc74: %PassThreeFields.cpp_overload_set.type = name_ref PassThreeFields, imports.%PassThreeFields.cpp_overload_set.value [concrete = constants.%PassThreeFields.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc79: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %PassThreeFields.ref.loc79: %PassThreeFields.cpp_overload_set.type = name_ref PassThreeFields, imports.%PassThreeFields.cpp_overload_set.value [concrete = constants.%PassThreeFields.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
|
||||
// CHECK:STDOUT: %.loc74_31.1: %tuple.type.37f = tuple_literal (%int_1, %int_2, %int_3) [concrete = constants.%tuple.2d5]
|
||||
// CHECK:STDOUT: %.loc74_31.2: %ThreeFields.942 = converted %.loc74_31.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr.loc74: %ptr.f81 = addr_of <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %PassThreeFields__carbon_thunk.call.loc74: init %empty_tuple.type = call imports.%PassThreeFields__carbon_thunk.decl(%addr.loc74)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc86: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %PassThreeFields.ref.loc86: %PassThreeFields.cpp_overload_set.type = name_ref PassThreeFields, imports.%PassThreeFields.cpp_overload_set.value [concrete = constants.%PassThreeFields.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc79_31.1: %tuple.type.37f = tuple_literal (%int_1, %int_2, %int_3) [concrete = constants.%tuple.2d5]
|
||||
// CHECK:STDOUT: %.loc79_31.2: %ThreeFields.942 = converted %.loc79_31.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr.loc79: %ptr.f81 = addr_of <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %PassThreeFields__carbon_thunk.call.loc79: init %empty_tuple.type = call imports.%PassThreeFields__carbon_thunk.decl(%addr.loc79)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc92: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %PassThreeFields.ref.loc92: %PassThreeFields.cpp_overload_set.type = name_ref PassThreeFields, imports.%PassThreeFields.cpp_overload_set.value [concrete = constants.%PassThreeFields.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %value.ref: %tuple.type.189 = name_ref value, %value
|
||||
// CHECK:STDOUT: %.loc86: %ThreeFields.942 = converted %value.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr.loc86: %ptr.f81 = addr_of <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %PassThreeFields__carbon_thunk.call.loc86: init %empty_tuple.type = call imports.%PassThreeFields__carbon_thunk.decl(%addr.loc86)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc98: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %PassThreeFields.ref.loc98: %PassThreeFields.cpp_overload_set.type = name_ref PassThreeFields, imports.%PassThreeFields.cpp_overload_set.value [concrete = constants.%PassThreeFields.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc92: %ThreeFields.942 = converted %value.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr.loc92: %ptr.f81 = addr_of <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %PassThreeFields__carbon_thunk.call.loc92: init %empty_tuple.type = call imports.%PassThreeFields__carbon_thunk.decl(%addr.loc92)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc105: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %PassThreeFields.ref.loc105: %PassThreeFields.cpp_overload_set.type = name_ref PassThreeFields, imports.%PassThreeFields.cpp_overload_set.value [concrete = constants.%PassThreeFields.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %reference.ref: ref %tuple.type.189 = name_ref reference, %reference
|
||||
// CHECK:STDOUT: %.loc98: %ThreeFields.942 = converted %reference.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr.loc98: %ptr.f81 = addr_of <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %PassThreeFields__carbon_thunk.call.loc98: init %empty_tuple.type = call imports.%PassThreeFields__carbon_thunk.decl(%addr.loc98)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc110: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %PassThreeFields.ref.loc110: %PassThreeFields.cpp_overload_set.type = name_ref PassThreeFields, imports.%PassThreeFields.cpp_overload_set.value [concrete = constants.%PassThreeFields.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc105: %ThreeFields.942 = converted %reference.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr.loc105: %ptr.f81 = addr_of <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %PassThreeFields__carbon_thunk.call.loc105: init %empty_tuple.type = call imports.%PassThreeFields__carbon_thunk.decl(%addr.loc105)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc118: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %PassThreeFields.ref.loc118: %PassThreeFields.cpp_overload_set.type = name_ref PassThreeFields, imports.%PassThreeFields.cpp_overload_set.value [concrete = constants.%PassThreeFields.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %MakeThreeFields.ref: %MakeThreeFields.type = name_ref MakeThreeFields, file.%MakeThreeFields.decl [concrete = constants.%MakeThreeFields]
|
||||
// CHECK:STDOUT: %.loc110_39.1: ref %tuple.type.189 = temporary_storage
|
||||
// CHECK:STDOUT: %MakeThreeFields.call: init %tuple.type.189 to %.loc110_39.1 = call %MakeThreeFields.ref()
|
||||
// CHECK:STDOUT: %.loc110_39.2: %ThreeFields.942 = converted %MakeThreeFields.call, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr.loc110: %ptr.f81 = addr_of <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %PassThreeFields__carbon_thunk.call.loc110: init %empty_tuple.type = call imports.%PassThreeFields__carbon_thunk.decl(%addr.loc110)
|
||||
// CHECK:STDOUT: %.loc118_39.1: ref %tuple.type.189 = temporary_storage
|
||||
// CHECK:STDOUT: %MakeThreeFields.call: init %tuple.type.189 to %.loc118_39.1 = call %MakeThreeFields.ref()
|
||||
// CHECK:STDOUT: %.loc118_39.2: %ThreeFields.942 = converted %MakeThreeFields.call, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr.loc118: %ptr.f81 = addr_of <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %PassThreeFields__carbon_thunk.call.loc118: init %empty_tuple.type = call imports.%PassThreeFields__carbon_thunk.decl(%addr.loc118)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+35
-32
@@ -304,23 +304,26 @@ import Cpp library "aggregate.h";
|
||||
|
||||
fn InitFromTuple() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+6]]:26: error: semantics TODO: `Unsupported initialization sequence:
|
||||
// CHECK:STDERR: Normal sequence: list aggregate initialization [struct Aggregate]
|
||||
// CHECK:STDERR: ` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+7]]:26: error: cannot implicitly convert expression of type `()` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.Aggregate = ();
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+4]]:26: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: let _: Cpp.Aggregate = ();
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Aggregate = ();
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+6]]:26: error: semantics TODO: `Unsupported initialization sequence:
|
||||
// CHECK:STDERR: Normal sequence: list aggregate initialization [struct Aggregate]
|
||||
// CHECK:STDERR: ` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+7]]:26: error: cannot implicitly convert expression of type `(Core.IntLiteral,)` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.Aggregate = (1,);
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+4]]:26: note: type `(Core.IntLiteral,)` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: let _: Cpp.Aggregate = (1,);
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Aggregate = (1,);
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+6]]:26: error: semantics TODO: `Unsupported initialization sequence:
|
||||
// CHECK:STDERR: Normal sequence: list aggregate initialization [struct Aggregate]
|
||||
// CHECK:STDERR: ` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+7]]:26: error: cannot implicitly convert expression of type `(Core.IntLiteral, Core.IntLiteral)` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: let _: Cpp.Aggregate = (1, 2);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+4]]:26: note: type `(Core.IntLiteral, Core.IntLiteral)` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: let _: Cpp.Aggregate = (1, 2);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR:
|
||||
@@ -1263,38 +1266,38 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: fn @InitFromTuple() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc14: %pattern_type.235 = value_binding_pattern _ [concrete]
|
||||
// CHECK:STDOUT: %_.patt.loc15: %pattern_type.235 = value_binding_pattern _ [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc14_27.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc14_13: type = splice_block %Aggregate.ref.loc14 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc14: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: %.loc15_27.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc15_13: type = splice_block %Aggregate.ref.loc15 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc15: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc14_27.2: %Aggregate = converted %.loc14_27.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %_.loc14: %Aggregate = value_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc15_27.2: %Aggregate = converted %.loc15_27.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %_.loc15: %Aggregate = value_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc21: %pattern_type.235 = value_binding_pattern _ [concrete]
|
||||
// CHECK:STDOUT: %_.patt.loc23: %pattern_type.235 = value_binding_pattern _ [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc21: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc21_29.1: %tuple.type.985 = tuple_literal (%int_1.loc21) [concrete = constants.%tuple.378]
|
||||
// CHECK:STDOUT: %.loc21_13: type = splice_block %Aggregate.ref.loc21 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc21: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: %int_1.loc23: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc23_29.1: %tuple.type.985 = tuple_literal (%int_1.loc23) [concrete = constants.%tuple.378]
|
||||
// CHECK:STDOUT: %.loc23_13: type = splice_block %Aggregate.ref.loc23 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc23: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc23: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc21_29.2: %Aggregate = converted %.loc21_29.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %_.loc21: %Aggregate = value_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc23_29.2: %Aggregate = converted %.loc23_29.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %_.loc23: %Aggregate = value_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc28: %pattern_type.235 = value_binding_pattern _ [concrete]
|
||||
// CHECK:STDOUT: %_.patt.loc31: %pattern_type.235 = value_binding_pattern _ [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc28: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_1.loc31: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: %.loc28_31.1: %tuple.type.f94 = tuple_literal (%int_1.loc28, %int_2) [concrete = constants.%tuple.ad8]
|
||||
// CHECK:STDOUT: %.loc28_13: type = splice_block %Aggregate.ref.loc28 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc28: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc28: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: %.loc31_31.1: %tuple.type.f94 = tuple_literal (%int_1.loc31, %int_2) [concrete = constants.%tuple.ad8]
|
||||
// CHECK:STDOUT: %.loc31_13: type = splice_block %Aggregate.ref.loc31 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc31: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc31: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc28_31.2: %Aggregate = converted %.loc28_31.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %_.loc28: %Aggregate = value_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc31_31.2: %Aggregate = converted %.loc31_31.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %_.loc31: %Aggregate = value_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -0,0 +1,375 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/stdlib/initializer_list.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/stdlib/initializer_list.carbon
|
||||
|
||||
// --- initializer_list.h
|
||||
|
||||
namespace std {
|
||||
using size_t = __SIZE_TYPE__;
|
||||
|
||||
template<typename T> class initializer_list {
|
||||
public:
|
||||
initializer_list() {}
|
||||
const T* begin() { return data_; }
|
||||
const T* end() { return data_ + size_; }
|
||||
size_t size() { return size_; }
|
||||
|
||||
private:
|
||||
const T* data_ = nullptr;
|
||||
size_t size_ = 0;
|
||||
};
|
||||
}
|
||||
|
||||
auto Consume(std::initializer_list<int> il) -> void;
|
||||
|
||||
struct InitListConstructor {
|
||||
InitListConstructor(std::initializer_list<int> il) {}
|
||||
};
|
||||
|
||||
// --- convert.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "initializer_list.h";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
fn F() {
|
||||
let _: Cpp.std.initializer_list(i32) = (1, 2, 3);
|
||||
|
||||
Cpp.Consume((1, 2, 3));
|
||||
|
||||
let _: Cpp.InitListConstructor = (1, 2, 3);
|
||||
}
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// CHECK:STDOUT: --- convert.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %initializer_list.type: type = cpp_type_template_type initializer_list [concrete]
|
||||
// CHECK:STDOUT: %initializer_list.template: %initializer_list.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %initializer_list: type = class_type @initializer_list [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.22f: type = pattern_type %initializer_list [concrete]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [concrete]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%int_1.5b8, %int_2.ecc, %int_3.1ba) [concrete]
|
||||
// CHECK:STDOUT: %array_type: type = array_type %int_3.1ba, %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.5d8: type = pattern_type %array_type [concrete]
|
||||
// CHECK:STDOUT: %.cec: form = init_form %initializer_list, call_param1 [concrete]
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.type.9fcb7f.1: type = fn_type @initializer_list.initializer_list.loc8 [concrete]
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.643507.1: %initializer_list.initializer_list.type.9fcb7f.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
|
||||
// CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
|
||||
// CHECK:STDOUT: %.863: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method.38b: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.646: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
|
||||
// CHECK:STDOUT: %bound_method.fa7: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: %array: %array_type = tuple_value (%int_1.5d2, %int_2.ef8, %int_3.822) [concrete]
|
||||
// CHECK:STDOUT: %Consume.cpp_overload_set.type: type = cpp_overload_set_type @Consume.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Consume.cpp_overload_set.value: %Consume.cpp_overload_set.type = cpp_overload_set_value @Consume.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %ptr.82f: type = ptr_type %initializer_list [concrete]
|
||||
// CHECK:STDOUT: %Consume__carbon_thunk.type: type = fn_type @Consume__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %Consume__carbon_thunk: %Consume__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.type.9fcb7f.2: type = fn_type @initializer_list.initializer_list.loc10 [concrete]
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.643507.2: %initializer_list.initializer_list.type.9fcb7f.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %InitListConstructor: type = class_type @InitListConstructor [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.92d: type = pattern_type %InitListConstructor [concrete]
|
||||
// CHECK:STDOUT: %ptr.79d: type = ptr_type %InitListConstructor [concrete]
|
||||
// CHECK:STDOUT: %InitListConstructor__carbon_thunk.type: type = fn_type @InitListConstructor__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %InitListConstructor__carbon_thunk: %InitListConstructor__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.type.9fcb7f.3: type = fn_type @initializer_list.initializer_list.loc12 [concrete]
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.643507.3: %initializer_list.initializer_list.type.9fcb7f.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %InitListConstructor.cpp_destructor.type: type = fn_type @InitListConstructor.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %InitListConstructor.cpp_destructor: %InitListConstructor.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor.type: type = fn_type @initializer_list.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor: %initializer_list.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %DestroyOp.type.3e79c2.6: type = fn_type @DestroyOp.loc12_44.3 [concrete]
|
||||
// CHECK:STDOUT: %DestroyOp.b0ebf8.6: %DestroyOp.type.3e79c2.6 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .std = %std
|
||||
// CHECK:STDOUT: .Consume = %Consume.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .InitListConstructor = %InitListConstructor.decl
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %std: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .initializer_list = %initializer_list.template
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %initializer_list.template: %initializer_list.type = struct_value () [concrete = constants.%initializer_list.template]
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.decl.2bdc3e.1: %initializer_list.initializer_list.type.9fcb7f.1 = fn_decl @initializer_list.initializer_list.loc8 [concrete = constants.%initializer_list.initializer_list.643507.1] {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.5d8 = value_binding_pattern _ [concrete]
|
||||
// CHECK:STDOUT: %_.param_patt: %pattern_type.5d8 = value_param_pattern %_.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.22f = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.22f = out_param_pattern %return.patt, call_param1 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc8: form = init_form constants.%initializer_list, call_param1 [concrete = constants.%.cec]
|
||||
// CHECK:STDOUT: %_.param: %array_type = value_param call_param0
|
||||
// CHECK:STDOUT: %_: %array_type = value_binding _, %_.param
|
||||
// CHECK:STDOUT: %return.param: ref %initializer_list = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %initializer_list = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
|
||||
// CHECK:STDOUT: %Consume.cpp_overload_set.value: %Consume.cpp_overload_set.type = cpp_overload_set_value @Consume.cpp_overload_set [concrete = constants.%Consume.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Consume__carbon_thunk.decl: %Consume__carbon_thunk.type = fn_decl @Consume__carbon_thunk [concrete = constants.%Consume__carbon_thunk] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.decl.2bdc3e.2: %initializer_list.initializer_list.type.9fcb7f.2 = fn_decl @initializer_list.initializer_list.loc10 [concrete = constants.%initializer_list.initializer_list.643507.2] {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.5d8 = value_binding_pattern _ [concrete]
|
||||
// CHECK:STDOUT: %_.param_patt: %pattern_type.5d8 = value_param_pattern %_.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.22f = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.22f = out_param_pattern %return.patt, call_param1 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc10: form = init_form constants.%initializer_list, call_param1 [concrete = constants.%.cec]
|
||||
// CHECK:STDOUT: %_.param: %array_type = value_param call_param0
|
||||
// CHECK:STDOUT: %_: %array_type = value_binding _, %_.param
|
||||
// CHECK:STDOUT: %return.param: ref %initializer_list = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %initializer_list = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %InitListConstructor.decl: type = class_decl @InitListConstructor [concrete = constants.%InitListConstructor] {} {}
|
||||
// CHECK:STDOUT: %InitListConstructor__carbon_thunk.decl: %InitListConstructor__carbon_thunk.type = fn_decl @InitListConstructor__carbon_thunk [concrete = constants.%InitListConstructor__carbon_thunk] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.decl.2bdc3e.3: %initializer_list.initializer_list.type.9fcb7f.3 = fn_decl @initializer_list.initializer_list.loc12 [concrete = constants.%initializer_list.initializer_list.643507.3] {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.5d8 = value_binding_pattern _ [concrete]
|
||||
// CHECK:STDOUT: %_.param_patt: %pattern_type.5d8 = value_param_pattern %_.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.22f = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.22f = out_param_pattern %return.patt, call_param1 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc12: form = init_form constants.%initializer_list, call_param1 [concrete = constants.%.cec]
|
||||
// CHECK:STDOUT: %_.param: %array_type = value_param call_param0
|
||||
// CHECK:STDOUT: %_: %array_type = value_binding _, %_.param
|
||||
// CHECK:STDOUT: %return.param: ref %initializer_list = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %initializer_list = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc8: %pattern_type.22f = value_binding_pattern _ [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc8_43: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int_2.loc8_46: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %int_3.loc8_49: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc8_50.1: %tuple.type = tuple_literal (%int_1.loc8_43, %int_2.loc8_46, %int_3.loc8_49) [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %int_3.loc8_50: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %array_type.loc8: type = array_type %int_3.loc8_50, %i32.1 [concrete = constants.%array_type]
|
||||
// CHECK:STDOUT: %.loc8_50.2: ref %initializer_list = temporary_storage
|
||||
// CHECK:STDOUT: %impl.elem0.loc8_50.1: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
|
||||
// CHECK:STDOUT: %bound_method.loc8_50.1: <bound method> = bound_method %int_1.loc8_43, %impl.elem0.loc8_50.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215]
|
||||
// CHECK:STDOUT: %specific_fn.loc8_50.1: <specific function> = specific_function %impl.elem0.loc8_50.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc8_50.2: <bound method> = bound_method %int_1.loc8_43, %specific_fn.loc8_50.1 [concrete = constants.%bound_method.38b]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_50.1: init %i32 = call %bound_method.loc8_50.2(%int_1.loc8_43) [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc8_50.3: init %i32 = converted %int_1.loc8_43, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_50.1 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc8_50.4: ref %array_type = temporary_storage
|
||||
// CHECK:STDOUT: %int_0.loc8: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: %.loc8_50.5: ref %i32 = array_index %.loc8_50.4, %int_0.loc8
|
||||
// CHECK:STDOUT: %.loc8_50.6: init %i32 to %.loc8_50.5 = initialize_from %.loc8_50.3 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc8_50.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
|
||||
// CHECK:STDOUT: %bound_method.loc8_50.3: <bound method> = bound_method %int_2.loc8_46, %impl.elem0.loc8_50.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5]
|
||||
// CHECK:STDOUT: %specific_fn.loc8_50.2: <specific function> = specific_function %impl.elem0.loc8_50.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc8_50.4: <bound method> = bound_method %int_2.loc8_46, %specific_fn.loc8_50.2 [concrete = constants.%bound_method.646]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_50.2: init %i32 = call %bound_method.loc8_50.4(%int_2.loc8_46) [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc8_50.7: init %i32 = converted %int_2.loc8_46, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_50.2 [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %int_1.loc8_50: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc8_50.8: ref %i32 = array_index %.loc8_50.4, %int_1.loc8_50
|
||||
// CHECK:STDOUT: %.loc8_50.9: init %i32 to %.loc8_50.8 = initialize_from %.loc8_50.7 [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc8_50.3: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
|
||||
// CHECK:STDOUT: %bound_method.loc8_50.5: <bound method> = bound_method %int_3.loc8_49, %impl.elem0.loc8_50.3 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061]
|
||||
// CHECK:STDOUT: %specific_fn.loc8_50.3: <specific function> = specific_function %impl.elem0.loc8_50.3, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc8_50.6: <bound method> = bound_method %int_3.loc8_49, %specific_fn.loc8_50.3 [concrete = constants.%bound_method.fa7]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_50.3: init %i32 = call %bound_method.loc8_50.6(%int_3.loc8_49) [concrete = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc8_50.10: init %i32 = converted %int_3.loc8_49, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_50.3 [concrete = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %int_2.loc8_50: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %.loc8_50.11: ref %i32 = array_index %.loc8_50.4, %int_2.loc8_50
|
||||
// CHECK:STDOUT: %.loc8_50.12: init %i32 to %.loc8_50.11 = initialize_from %.loc8_50.10 [concrete = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc8_50.13: init %array_type to %.loc8_50.4 = array_init (%.loc8_50.6, %.loc8_50.9, %.loc8_50.12) [concrete = constants.%array]
|
||||
// CHECK:STDOUT: %.loc8_50.14: init %array_type = converted %.loc8_50.1, %.loc8_50.13 [concrete = constants.%array]
|
||||
// CHECK:STDOUT: %.loc8_50.15: ref %array_type = temporary %.loc8_50.4, %.loc8_50.14
|
||||
// CHECK:STDOUT: %.loc8_50.16: %array_type = acquire_value %.loc8_50.15
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.loc8: init %initializer_list to %.loc8_50.2 = call imports.%initializer_list.initializer_list.decl.2bdc3e.1(%.loc8_50.16)
|
||||
// CHECK:STDOUT: %.loc8_50.17: init %initializer_list = converted %.loc8_50.1, %initializer_list.initializer_list.call.loc8
|
||||
// CHECK:STDOUT: %.loc8_50.18: ref %initializer_list = temporary %.loc8_50.2, %.loc8_50.17
|
||||
// CHECK:STDOUT: %.loc8_50.19: %initializer_list = acquire_value %.loc8_50.18
|
||||
// CHECK:STDOUT: %_.loc8: %initializer_list = value_binding _, %.loc8_50.19
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Consume.ref: %Consume.cpp_overload_set.type = name_ref Consume, imports.%Consume.cpp_overload_set.value [concrete = constants.%Consume.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1.loc10_16: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int_2.loc10_19: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %int_3.loc10_22: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc10_23.1: %tuple.type = tuple_literal (%int_1.loc10_16, %int_2.loc10_19, %int_3.loc10_22) [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %int_3.loc10_23: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %array_type.loc10: type = array_type %int_3.loc10_23, %i32.2 [concrete = constants.%array_type]
|
||||
// CHECK:STDOUT: %.loc10_23.2: ref %initializer_list = temporary_storage
|
||||
// CHECK:STDOUT: %impl.elem0.loc10_23.1: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
|
||||
// CHECK:STDOUT: %bound_method.loc10_23.1: <bound method> = bound_method %int_1.loc10_16, %impl.elem0.loc10_23.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215]
|
||||
// CHECK:STDOUT: %specific_fn.loc10_23.1: <specific function> = specific_function %impl.elem0.loc10_23.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc10_23.2: <bound method> = bound_method %int_1.loc10_16, %specific_fn.loc10_23.1 [concrete = constants.%bound_method.38b]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_23.1: init %i32 = call %bound_method.loc10_23.2(%int_1.loc10_16) [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc10_23.3: init %i32 = converted %int_1.loc10_16, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_23.1 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc10_23.4: ref %array_type = temporary_storage
|
||||
// CHECK:STDOUT: %int_0.loc10: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: %.loc10_23.5: ref %i32 = array_index %.loc10_23.4, %int_0.loc10
|
||||
// CHECK:STDOUT: %.loc10_23.6: init %i32 to %.loc10_23.5 = initialize_from %.loc10_23.3 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc10_23.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
|
||||
// CHECK:STDOUT: %bound_method.loc10_23.3: <bound method> = bound_method %int_2.loc10_19, %impl.elem0.loc10_23.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5]
|
||||
// CHECK:STDOUT: %specific_fn.loc10_23.2: <specific function> = specific_function %impl.elem0.loc10_23.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc10_23.4: <bound method> = bound_method %int_2.loc10_19, %specific_fn.loc10_23.2 [concrete = constants.%bound_method.646]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_23.2: init %i32 = call %bound_method.loc10_23.4(%int_2.loc10_19) [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc10_23.7: init %i32 = converted %int_2.loc10_19, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_23.2 [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %int_1.loc10_23: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc10_23.8: ref %i32 = array_index %.loc10_23.4, %int_1.loc10_23
|
||||
// CHECK:STDOUT: %.loc10_23.9: init %i32 to %.loc10_23.8 = initialize_from %.loc10_23.7 [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc10_23.3: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
|
||||
// CHECK:STDOUT: %bound_method.loc10_23.5: <bound method> = bound_method %int_3.loc10_22, %impl.elem0.loc10_23.3 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061]
|
||||
// CHECK:STDOUT: %specific_fn.loc10_23.3: <specific function> = specific_function %impl.elem0.loc10_23.3, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc10_23.6: <bound method> = bound_method %int_3.loc10_22, %specific_fn.loc10_23.3 [concrete = constants.%bound_method.fa7]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_23.3: init %i32 = call %bound_method.loc10_23.6(%int_3.loc10_22) [concrete = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc10_23.10: init %i32 = converted %int_3.loc10_22, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_23.3 [concrete = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %int_2.loc10_23: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %.loc10_23.11: ref %i32 = array_index %.loc10_23.4, %int_2.loc10_23
|
||||
// CHECK:STDOUT: %.loc10_23.12: init %i32 to %.loc10_23.11 = initialize_from %.loc10_23.10 [concrete = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc10_23.13: init %array_type to %.loc10_23.4 = array_init (%.loc10_23.6, %.loc10_23.9, %.loc10_23.12) [concrete = constants.%array]
|
||||
// CHECK:STDOUT: %.loc10_23.14: init %array_type = converted %.loc10_23.1, %.loc10_23.13 [concrete = constants.%array]
|
||||
// CHECK:STDOUT: %.loc10_23.15: ref %array_type = temporary %.loc10_23.4, %.loc10_23.14
|
||||
// CHECK:STDOUT: %.loc10_23.16: %array_type = acquire_value %.loc10_23.15
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.loc10: init %initializer_list to %.loc10_23.2 = call imports.%initializer_list.initializer_list.decl.2bdc3e.2(%.loc10_23.16)
|
||||
// CHECK:STDOUT: %.loc10_23.17: init %initializer_list = converted %.loc10_23.1, %initializer_list.initializer_list.call.loc10
|
||||
// CHECK:STDOUT: %.loc10_23.18: ref %initializer_list = temporary %.loc10_23.2, %.loc10_23.17
|
||||
// CHECK:STDOUT: %.loc10_23.19: %initializer_list = acquire_value %.loc10_23.18
|
||||
// CHECK:STDOUT: %.loc10_23.20: ref %initializer_list = value_as_ref %.loc10_23.19
|
||||
// CHECK:STDOUT: %addr.loc10: %ptr.82f = addr_of %.loc10_23.20
|
||||
// CHECK:STDOUT: %Consume__carbon_thunk.call: init %empty_tuple.type = call imports.%Consume__carbon_thunk.decl(%addr.loc10)
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc12: %pattern_type.92d = value_binding_pattern _ [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc12_37: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int_2.loc12_40: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %int_3.loc12_43: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc12_44.1: %tuple.type = tuple_literal (%int_1.loc12_37, %int_2.loc12_40, %int_3.loc12_43) [concrete = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc12_13: type = splice_block %InitListConstructor.ref [concrete = constants.%InitListConstructor] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %InitListConstructor.ref: type = name_ref InitListConstructor, imports.%InitListConstructor.decl [concrete = constants.%InitListConstructor]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc12_44.2: ref %InitListConstructor = temporary_storage
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %int_3.loc12_44: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %array_type.loc12: type = array_type %int_3.loc12_44, %i32.3 [concrete = constants.%array_type]
|
||||
// CHECK:STDOUT: %.loc12_44.3: ref %initializer_list = temporary_storage
|
||||
// CHECK:STDOUT: %impl.elem0.loc12_44.1: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
|
||||
// CHECK:STDOUT: %bound_method.loc12_44.1: <bound method> = bound_method %int_1.loc12_37, %impl.elem0.loc12_44.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215]
|
||||
// CHECK:STDOUT: %specific_fn.loc12_44.1: <specific function> = specific_function %impl.elem0.loc12_44.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc12_44.2: <bound method> = bound_method %int_1.loc12_37, %specific_fn.loc12_44.1 [concrete = constants.%bound_method.38b]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc12_44.1: init %i32 = call %bound_method.loc12_44.2(%int_1.loc12_37) [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc12_44.4: init %i32 = converted %int_1.loc12_37, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc12_44.1 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc12_44.5: ref %array_type = temporary_storage
|
||||
// CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: %.loc12_44.6: ref %i32 = array_index %.loc12_44.5, %int_0.loc12
|
||||
// CHECK:STDOUT: %.loc12_44.7: init %i32 to %.loc12_44.6 = initialize_from %.loc12_44.4 [concrete = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc12_44.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
|
||||
// CHECK:STDOUT: %bound_method.loc12_44.3: <bound method> = bound_method %int_2.loc12_40, %impl.elem0.loc12_44.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5]
|
||||
// CHECK:STDOUT: %specific_fn.loc12_44.2: <specific function> = specific_function %impl.elem0.loc12_44.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc12_44.4: <bound method> = bound_method %int_2.loc12_40, %specific_fn.loc12_44.2 [concrete = constants.%bound_method.646]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc12_44.2: init %i32 = call %bound_method.loc12_44.4(%int_2.loc12_40) [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc12_44.8: init %i32 = converted %int_2.loc12_40, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc12_44.2 [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %int_1.loc12_44: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc12_44.9: ref %i32 = array_index %.loc12_44.5, %int_1.loc12_44
|
||||
// CHECK:STDOUT: %.loc12_44.10: init %i32 to %.loc12_44.9 = initialize_from %.loc12_44.8 [concrete = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc12_44.3: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
|
||||
// CHECK:STDOUT: %bound_method.loc12_44.5: <bound method> = bound_method %int_3.loc12_43, %impl.elem0.loc12_44.3 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061]
|
||||
// CHECK:STDOUT: %specific_fn.loc12_44.3: <specific function> = specific_function %impl.elem0.loc12_44.3, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc12_44.6: <bound method> = bound_method %int_3.loc12_43, %specific_fn.loc12_44.3 [concrete = constants.%bound_method.fa7]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc12_44.3: init %i32 = call %bound_method.loc12_44.6(%int_3.loc12_43) [concrete = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc12_44.11: init %i32 = converted %int_3.loc12_43, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc12_44.3 [concrete = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %int_2.loc12_44: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %.loc12_44.12: ref %i32 = array_index %.loc12_44.5, %int_2.loc12_44
|
||||
// CHECK:STDOUT: %.loc12_44.13: init %i32 to %.loc12_44.12 = initialize_from %.loc12_44.11 [concrete = constants.%int_3.822]
|
||||
// CHECK:STDOUT: %.loc12_44.14: init %array_type to %.loc12_44.5 = array_init (%.loc12_44.7, %.loc12_44.10, %.loc12_44.13) [concrete = constants.%array]
|
||||
// CHECK:STDOUT: %.loc12_44.15: init %array_type = converted %.loc12_44.1, %.loc12_44.14 [concrete = constants.%array]
|
||||
// CHECK:STDOUT: %.loc12_44.16: ref %array_type = temporary %.loc12_44.5, %.loc12_44.15
|
||||
// CHECK:STDOUT: %.loc12_44.17: %array_type = acquire_value %.loc12_44.16
|
||||
// CHECK:STDOUT: %initializer_list.initializer_list.call.loc12: init %initializer_list to %.loc12_44.3 = call imports.%initializer_list.initializer_list.decl.2bdc3e.3(%.loc12_44.17)
|
||||
// CHECK:STDOUT: %.loc12_44.18: init %initializer_list = converted %.loc12_44.1, %initializer_list.initializer_list.call.loc12
|
||||
// CHECK:STDOUT: %.loc12_44.19: ref %initializer_list = temporary %.loc12_44.3, %.loc12_44.18
|
||||
// CHECK:STDOUT: %.loc12_44.20: %initializer_list = acquire_value %.loc12_44.19
|
||||
// CHECK:STDOUT: %.loc12_44.21: ref %initializer_list = value_as_ref %.loc12_44.20
|
||||
// CHECK:STDOUT: %addr.loc12_44.1: %ptr.82f = addr_of %.loc12_44.21
|
||||
// CHECK:STDOUT: %addr.loc12_44.2: %ptr.79d = addr_of %.loc12_44.2
|
||||
// CHECK:STDOUT: %InitListConstructor__carbon_thunk.call: init %empty_tuple.type = call imports.%InitListConstructor__carbon_thunk.decl(%addr.loc12_44.1, %addr.loc12_44.2)
|
||||
// CHECK:STDOUT: %.loc12_44.22: init %InitListConstructor to %.loc12_44.2 = in_place_init %InitListConstructor__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc12_44.23: init %InitListConstructor = converted %.loc12_44.1, %.loc12_44.22
|
||||
// CHECK:STDOUT: %.loc12_44.24: ref %InitListConstructor = temporary %.loc12_44.2, %.loc12_44.23
|
||||
// CHECK:STDOUT: %.loc12_44.25: %InitListConstructor = acquire_value %.loc12_44.24
|
||||
// CHECK:STDOUT: %_.loc12: %InitListConstructor = value_binding _, %.loc12_44.25
|
||||
// CHECK:STDOUT: %InitListConstructor.cpp_destructor.bound: <bound method> = bound_method %.loc12_44.24, constants.%InitListConstructor.cpp_destructor
|
||||
// CHECK:STDOUT: %InitListConstructor.cpp_destructor.call: init %empty_tuple.type = call %InitListConstructor.cpp_destructor.bound(%.loc12_44.24)
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor.bound.loc12: <bound method> = bound_method %.loc12_44.19, constants.%initializer_list.cpp_destructor
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor.call.loc12: init %empty_tuple.type = call %initializer_list.cpp_destructor.bound.loc12(%.loc12_44.19)
|
||||
// CHECK:STDOUT: %DestroyOp.bound.loc12: <bound method> = bound_method %.loc12_44.16, constants.%DestroyOp.b0ebf8.6
|
||||
// CHECK:STDOUT: %DestroyOp.call.loc12: init %empty_tuple.type = call %DestroyOp.bound.loc12(%.loc12_44.16)
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor.bound.loc10: <bound method> = bound_method %.loc10_23.18, constants.%initializer_list.cpp_destructor
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor.call.loc10: init %empty_tuple.type = call %initializer_list.cpp_destructor.bound.loc10(%.loc10_23.18)
|
||||
// CHECK:STDOUT: %DestroyOp.bound.loc10: <bound method> = bound_method %.loc10_23.15, constants.%DestroyOp.b0ebf8.6
|
||||
// CHECK:STDOUT: %DestroyOp.call.loc10: init %empty_tuple.type = call %DestroyOp.bound.loc10(%.loc10_23.15)
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor.bound.loc8: <bound method> = bound_method %.loc8_50.18, constants.%initializer_list.cpp_destructor
|
||||
// CHECK:STDOUT: %initializer_list.cpp_destructor.call.loc8: init %empty_tuple.type = call %initializer_list.cpp_destructor.bound.loc8(%.loc8_50.18)
|
||||
// CHECK:STDOUT: %DestroyOp.bound.loc8: <bound method> = bound_method %.loc8_50.15, constants.%DestroyOp.b0ebf8.6
|
||||
// CHECK:STDOUT: %DestroyOp.call.loc8: init %empty_tuple.type = call %DestroyOp.bound.loc8(%.loc8_50.15)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @initializer_list.initializer_list.loc8(%_.param: %array_type) -> out %return.param: %initializer_list = "cpp.std.initializer_list.make";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @initializer_list.initializer_list.loc10(%_.param: %array_type) -> out %return.param: %initializer_list = "cpp.std.initializer_list.make";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @initializer_list.initializer_list.loc12(%_.param: %array_type) -> out %return.param: %initializer_list = "cpp.std.initializer_list.make";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @DestroyOp.loc12_44.1(%self.param: %InitListConstructor) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @DestroyOp.loc12_44.2(%self.param: %initializer_list) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @DestroyOp.loc12_44.3(%self.param: %array_type) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
Reference in New Issue
Block a user